r111675 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111674‎ | r111675 | r111676 >
Date:20:19, 16 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_19/phase3 (modified) (history)
  • /branches/REL1_19/phase3/includes (modified) (history)
  • /branches/REL1_19/phase3/includes/api (modified) (history)
  • /branches/REL1_19/phase3/includes/api/ApiQueryAllUsers.php (modified) (history)
  • /branches/wmf/1.19wmf1 (modified) (history)
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/api (modified) (history)
  • /branches/wmf/1.19wmf1/includes/api/ApiQueryAllUsers.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/api/ApiQueryAllUsers.php
@@ -60,10 +60,15 @@
6161 $from = is_null( $params['from'] ) ? null : $this->keyToTitle( $params['from'] );
6262 $to = is_null( $params['to'] ) ? null : $this->keyToTitle( $params['to'] );
6363
64 - $this->addWhereRange( 'user_name', $dir, $from, $to );
 64+ # MySQL doesn't seem to use 'equality propagation' here, so like the
 65+ # ActiveUsers special page, we have to use rc_user_text for some cases.
 66+ $userFieldToSort = $params['activeusers'] ? 'rc_user_text' : 'user_name';
6567
 68+ $this->addWhereRange( $userFieldToSort, $dir, $from, $to );
 69+
6670 if ( !is_null( $params['prefix'] ) ) {
67 - $this->addWhere( 'user_name' . $db->buildLike( $this->keyToTitle( $params['prefix'] ), $db->anyString() ) );
 71+ $this->addWhere( $userFieldToSort .
 72+ $db->buildLike( $this->keyToTitle( $params['prefix'] ), $db->anyString() ) );
6873 }
6974
7075 if ( !is_null( $params['rights'] ) ) {
@@ -143,7 +148,7 @@
144149 $timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 );
145150 $this->addWhere( "rc_timestamp >= {$db->addQuotes( $timestamp )}" );
146151
147 - $this->addOption( 'GROUP BY', 'user_name' );
 152+ $this->addOption( 'GROUP BY', $userFieldToSort );
148153 }
149154
150155 $this->addOption( 'LIMIT', $sqlLimit );
Property changes on: branches/wmf/1.19wmf1/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
151156 Merged /trunk/phase3/includes/api:r111673
152157 Merged /branches/wmf/1.18wmf1/includes/api:r111667
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
153158 Merged /branches/wmf/1.18wmf1/includes:r111667
154159 Merged /trunk/phase3/includes:r111673
Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
155160 Merged /branches/wmf/1.18wmf1:r111667
156161 Merged /trunk/phase3:r111673
Index: branches/REL1_19/phase3/includes/api/ApiQueryAllUsers.php
@@ -60,10 +60,15 @@
6161 $from = is_null( $params['from'] ) ? null : $this->keyToTitle( $params['from'] );
6262 $to = is_null( $params['to'] ) ? null : $this->keyToTitle( $params['to'] );
6363
64 - $this->addWhereRange( 'user_name', $dir, $from, $to );
 64+ # MySQL doesn't seem to use 'equality propagation' here, so like the
 65+ # ActiveUsers special page, we have to use rc_user_text for some cases.
 66+ $userFieldToSort = $params['activeusers'] ? 'rc_user_text' : 'user_name';
6567
 68+ $this->addWhereRange( $userFieldToSort, $dir, $from, $to );
 69+
6670 if ( !is_null( $params['prefix'] ) ) {
67 - $this->addWhere( 'user_name' . $db->buildLike( $this->keyToTitle( $params['prefix'] ), $db->anyString() ) );
 71+ $this->addWhere( $userFieldToSort .
 72+ $db->buildLike( $this->keyToTitle( $params['prefix'] ), $db->anyString() ) );
6873 }
6974
7075 if ( !is_null( $params['rights'] ) ) {
@@ -143,7 +148,7 @@
144149 $timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 );
145150 $this->addWhere( "rc_timestamp >= {$db->addQuotes( $timestamp )}" );
146151
147 - $this->addOption( 'GROUP BY', 'user_name' );
 152+ $this->addOption( 'GROUP BY', $userFieldToSort );
148153 }
149154
150155 $this->addOption( 'LIMIT', $sqlLimit );
Property changes on: branches/REL1_19/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
151156 Merged /trunk/phase3/includes/api:r111673
152157 Merged /branches/wmf/1.18wmf1/includes/api:r111667
Property changes on: branches/REL1_19/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
153158 Merged /branches/wmf/1.18wmf1/includes:r111667
154159 Merged /trunk/phase3/includes:r111673
Property changes on: branches/REL1_19/phase3
___________________________________________________________________
Modified: svn:mergeinfo
155160 Merged /branches/wmf/1.18wmf1:r111667
156161 Merged /trunk/phase3:r111673

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111673Merge r111667 into trunkreedy20:13, 16 February 2012

Status & tagging log