1 Sep 2008 16:25
MySQL user variables (was Re: [MediaWiki-CVS] SVN: [40279] trunk/phase3)
aaron@... wrote: > Added: trunk/phase3/maintenance/archives/patch-ss_active_users.sql > =================================================================== > --- trunk/phase3/maintenance/archives/patch-ss_active_users.sql (rev 0) > +++ trunk/phase3/maintenance/archives/patch-ss_active_users.sql 2008-08-31 19:29:37 UTC (rev 40279) > <at> <at> -0,0 +1,6 <at> <at> > +-- More statistics, for version 1.14 > + > +ALTER TABLE /*$wgDBprefix*/site_stats ADD ss_active_users bigint default '-1'; > +SELECT <at> activeusers := COUNT( DISTINCT rc_user_text ) FROM /*$wgDBprefix*/recentchanges > +WHERE rc_user != 0 AND rc_bot = 0 AND rc_log_type != 'newusers'; > +UPDATE /*$wgDBprefix*/site_stats SET ss_active_users= <at> activeusers; > User variables are not replication-safe, and should be avoided. It's better to use a custom function in updaters.inc, and a schema-only patch. Yes, I know I used a user variable too, back in 2006 for ss_images, but I was young and naive. -- Tim Starling
RSS Feed