Last modified: 2008-09-21 22:57:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T17682, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15682 - bad count for Active Users, query compares to a NULL field and fails for many users
bad count for Active Users, query compares to a NULL field and fails for many...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://el.wiktionary.org/wiki/Ειδικό:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-21 22:50 UTC by Ariel T. Glenn
Modified: 2008-09-21 22:57 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ariel T. Glenn 2008-09-21 22:50:22 UTC
The active user count is done in SiteStats.php, the query is 

                $activeUsers = $dbr->selectField( 'recentchanges', 'COUNT( DISTINCT rc_user_text )',
                        array( 'rc_user != 0', 'rc_bot' => 0, "rc_log_type != 'newusers'" ),
                        __METHOD__ );

I saw that it showed 6 users, and I could count more than that myself in RC, so I went to the toolserver to check it out.

mysql> select rc_user_text, rc_title, rc_log_type, rc_user, rc_bot from recentchanges where rc_title='πορτραίτο';
| Francostas   | πορτραίτο | NULL        |     801 |      0 |

there you can see that rc_log_type = NULL

mysql> select  DISTINCT rc_user_text  from recentchanges where rc_user != 0 and rc_bot=0 and rc_log_type != 'newusers';
Francostas is not in the list, only 6 users are returned

mysql> select  DISTINCT rc_user_text  from recentchanges where rc_user != 0 and rc_bot=0;
this does return his name.  

this is because... 
mysql> select NULL != 'newuser';
|             NULL | 

Maybe the rc_log_type should be an empty string?
Comment 1 Aaron Schulz 2008-09-21 22:57:37 UTC
Query fixed for this in r41137

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links