Index: branches/REL1_18/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -147,11 +147,18 @@ |
148 | 148 | $this->addWhereRange( 'cl_sortkey', $dir, null, null ); |
149 | 149 | $this->addWhereRange( 'cl_from', $dir, null, null ); |
150 | 150 | } else { |
| 151 | + $startsortkey = $params['startsortkeyprefix'] !== null ? |
| 152 | + Collation::singleton()->getSortkey( $params['startsortkeyprefix'] ) : |
| 153 | + $params['startsortkey']; |
| 154 | + $endsortkey = $params['endsortkeyprefix'] !== null ? |
| 155 | + Collation::singleton()->getSortkey( $params['endsortkeyprefix'] ) : |
| 156 | + $params['endsortkey']; |
| 157 | + |
151 | 158 | // The below produces ORDER BY cl_sortkey, cl_from, possibly with DESC added to each of them |
152 | 159 | $this->addWhereRange( 'cl_sortkey', |
153 | 160 | $dir, |
154 | | - $params['startsortkey'], |
155 | | - $params['endsortkey'] ); |
| 161 | + $startsortkey, |
| 162 | + $endsortkey ); |
156 | 163 | $this->addWhereRange( 'cl_from', $dir, null, null ); |
157 | 164 | } |
158 | 165 | $this->addOption( 'USE INDEX', 'cl_sortkey' ); |
— | — | @@ -325,6 +332,8 @@ |
326 | 333 | ), |
327 | 334 | 'startsortkey' => null, |
328 | 335 | 'endsortkey' => null, |
| 336 | + 'startsortkeyprefix' => null, |
| 337 | + 'endsortkeyprefix' => null, |
329 | 338 | ); |
330 | 339 | } |
331 | 340 | |
— | — | @@ -351,6 +360,8 @@ |
352 | 361 | 'end' => "Timestamp to end listing at. Can only be used with {$p}sort=timestamp", |
353 | 362 | 'startsortkey' => "Sortkey to start listing from. Must be given in binary format. Can only be used with {$p}sort=sortkey", |
354 | 363 | 'endsortkey' => "Sortkey to end listing at. Must be given in binary format. Can only be used with {$p}sort=sortkey", |
| 364 | + 'startsortkeyprefix' => "Sortkey prefix to start listing from. Can only be used with {$p}sort=sortkey. Overrides {$p}startsortkey", |
| 365 | + 'endsortkeyprefix' => "Sortkey prefix to end listing BEFORE (not at, if this value occurs it will not be included!). Can only be used with {$p}sort=sortkey. Overrides {$p}endsortkey", |
355 | 366 | 'continue' => 'For large categories, give the value retured from previous query', |
356 | 367 | 'limit' => 'The maximum number of pages to return.', |
357 | 368 | ); |
Property changes on: branches/REL1_18/phase3/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
358 | 369 | Merged /trunk/phase3/includes/api:r101306 |
Property changes on: branches/REL1_18/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
359 | 370 | Merged /trunk/phase3/includes:r101306 |
Property changes on: branches/REL1_18/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
360 | 371 | Merged /trunk/phase3:r101306 |
Index: branches/wmf/1.18wmf1/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -147,11 +147,18 @@ |
148 | 148 | $this->addWhereRange( 'cl_sortkey', $dir, null, null ); |
149 | 149 | $this->addWhereRange( 'cl_from', $dir, null, null ); |
150 | 150 | } else { |
| 151 | + $startsortkey = $params['startsortkeyprefix'] !== null ? |
| 152 | + Collation::singleton()->getSortkey( $params['startsortkeyprefix'] ) : |
| 153 | + $params['startsortkey']; |
| 154 | + $endsortkey = $params['endsortkeyprefix'] !== null ? |
| 155 | + Collation::singleton()->getSortkey( $params['endsortkeyprefix'] ) : |
| 156 | + $params['endsortkey']; |
| 157 | + |
151 | 158 | // The below produces ORDER BY cl_sortkey, cl_from, possibly with DESC added to each of them |
152 | 159 | $this->addWhereRange( 'cl_sortkey', |
153 | 160 | $dir, |
154 | | - $params['startsortkey'], |
155 | | - $params['endsortkey'] ); |
| 161 | + $startsortkey, |
| 162 | + $endsortkey ); |
156 | 163 | $this->addWhereRange( 'cl_from', $dir, null, null ); |
157 | 164 | } |
158 | 165 | $this->addOption( 'USE INDEX', 'cl_sortkey' ); |
— | — | @@ -325,6 +332,8 @@ |
326 | 333 | ), |
327 | 334 | 'startsortkey' => null, |
328 | 335 | 'endsortkey' => null, |
| 336 | + 'startsortkeyprefix' => null, |
| 337 | + 'endsortkeyprefix' => null, |
329 | 338 | ); |
330 | 339 | } |
331 | 340 | |
— | — | @@ -351,6 +360,8 @@ |
352 | 361 | 'end' => "Timestamp to end listing at. Can only be used with {$p}sort=timestamp", |
353 | 362 | 'startsortkey' => "Sortkey to start listing from. Must be given in binary format. Can only be used with {$p}sort=sortkey", |
354 | 363 | 'endsortkey' => "Sortkey to end listing at. Must be given in binary format. Can only be used with {$p}sort=sortkey", |
| 364 | + 'startsortkeyprefix' => "Sortkey prefix to start listing from. Can only be used with {$p}sort=sortkey. Overrides {$p}startsortkey", |
| 365 | + 'endsortkeyprefix' => "Sortkey prefix to end listing BEFORE (not at, if this value occurs it will not be included!). Can only be used with {$p}sort=sortkey. Overrides {$p}endsortkey", |
355 | 366 | 'continue' => 'For large categories, give the value retured from previous query', |
356 | 367 | 'limit' => 'The maximum number of pages to return.', |
357 | 368 | ); |
Property changes on: branches/wmf/1.18wmf1/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
358 | 369 | Merged /trunk/phase3/includes/api:r101306 |
Property changes on: branches/wmf/1.18wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
359 | 370 | Merged /trunk/phase3/includes:r101306 |
Property changes on: branches/wmf/1.18wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
360 | 371 | Merged /trunk/phase3:r101306 |