Index: branches/wmf/1.19wmf1/includes/api/ApiQueryAllUsers.php |
— | — | @@ -60,10 +60,15 @@ |
61 | 61 | $from = is_null( $params['from'] ) ? null : $this->keyToTitle( $params['from'] ); |
62 | 62 | $to = is_null( $params['to'] ) ? null : $this->keyToTitle( $params['to'] ); |
63 | 63 | |
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'; |
65 | 67 | |
| 68 | + $this->addWhereRange( $userFieldToSort, $dir, $from, $to ); |
| 69 | + |
66 | 70 | 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() ) ); |
68 | 73 | } |
69 | 74 | |
70 | 75 | if ( !is_null( $params['rights'] ) ) { |
— | — | @@ -143,7 +148,7 @@ |
144 | 149 | $timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 ); |
145 | 150 | $this->addWhere( "rc_timestamp >= {$db->addQuotes( $timestamp )}" ); |
146 | 151 | |
147 | | - $this->addOption( 'GROUP BY', 'user_name' ); |
| 152 | + $this->addOption( 'GROUP BY', $userFieldToSort ); |
148 | 153 | } |
149 | 154 | |
150 | 155 | $this->addOption( 'LIMIT', $sqlLimit ); |
Property changes on: branches/wmf/1.19wmf1/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
151 | 156 | Merged /trunk/phase3/includes/api:r111673 |
152 | 157 | Merged /branches/wmf/1.18wmf1/includes/api:r111667 |
Property changes on: branches/wmf/1.19wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
153 | 158 | Merged /branches/wmf/1.18wmf1/includes:r111667 |
154 | 159 | Merged /trunk/phase3/includes:r111673 |
Property changes on: branches/wmf/1.19wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
155 | 160 | Merged /branches/wmf/1.18wmf1:r111667 |
156 | 161 | Merged /trunk/phase3:r111673 |
Index: branches/REL1_19/phase3/includes/api/ApiQueryAllUsers.php |
— | — | @@ -60,10 +60,15 @@ |
61 | 61 | $from = is_null( $params['from'] ) ? null : $this->keyToTitle( $params['from'] ); |
62 | 62 | $to = is_null( $params['to'] ) ? null : $this->keyToTitle( $params['to'] ); |
63 | 63 | |
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'; |
65 | 67 | |
| 68 | + $this->addWhereRange( $userFieldToSort, $dir, $from, $to ); |
| 69 | + |
66 | 70 | 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() ) ); |
68 | 73 | } |
69 | 74 | |
70 | 75 | if ( !is_null( $params['rights'] ) ) { |
— | — | @@ -143,7 +148,7 @@ |
144 | 149 | $timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 ); |
145 | 150 | $this->addWhere( "rc_timestamp >= {$db->addQuotes( $timestamp )}" ); |
146 | 151 | |
147 | | - $this->addOption( 'GROUP BY', 'user_name' ); |
| 152 | + $this->addOption( 'GROUP BY', $userFieldToSort ); |
148 | 153 | } |
149 | 154 | |
150 | 155 | $this->addOption( 'LIMIT', $sqlLimit ); |
Property changes on: branches/REL1_19/phase3/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
151 | 156 | Merged /trunk/phase3/includes/api:r111673 |
152 | 157 | Merged /branches/wmf/1.18wmf1/includes/api:r111667 |
Property changes on: branches/REL1_19/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
153 | 158 | Merged /branches/wmf/1.18wmf1/includes:r111667 |
154 | 159 | Merged /trunk/phase3/includes:r111673 |
Property changes on: branches/REL1_19/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
155 | 160 | Merged /branches/wmf/1.18wmf1:r111667 |
156 | 161 | Merged /trunk/phase3:r111673 |