1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

Guarantee that Maniphest paging clauses strictly progress

Ref T7548. Some of these clauses are not guaranteed to select only rows following the cursor.
This commit is contained in:
epriestley 2015-03-14 13:27:47 -07:00
parent 4c46aedde9
commit 77e0a4abba

View file

@ -1054,11 +1054,6 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
$app_columns = $this->buildApplicationSearchPagination($conn_r, $cursor); $app_columns = $this->buildApplicationSearchPagination($conn_r, $cursor);
if ($app_columns) { if ($app_columns) {
$columns = array_merge($columns, $app_columns); $columns = array_merge($columns, $app_columns);
$columns[] = array(
'name' => 'task.id',
'value' => (int)$cursor->getID(),
'type' => 'int',
);
} else { } else {
switch ($this->orderBy) { switch ($this->orderBy) {
case self::ORDER_PRIORITY: case self::ORDER_PRIORITY:
@ -1082,11 +1077,7 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
); );
break; break;
case self::ORDER_CREATED: case self::ORDER_CREATED:
$columns[] = array( // This just uses the ID column, below.
'name' => 'task.id',
'value' => (int)$cursor->getID(),
'type' => 'int',
);
break; break;
case self::ORDER_MODIFIED: case self::ORDER_MODIFIED:
$columns[] = array( $columns[] = array(
@ -1101,17 +1092,18 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
'value' => $cursor->getTitle(), 'value' => $cursor->getTitle(),
'type' => 'string', 'type' => 'string',
); );
$columns[] = array(
'name' => 'task.id',
'value' => $cursor->getID(),
'type' => 'int',
);
break; break;
default: default:
throw new Exception("Unknown order query '{$this->orderBy}'!"); throw new Exception("Unknown order query '{$this->orderBy}'!");
} }
} }
$columns[] = array(
'name' => 'task.id',
'value' => $cursor->getID(),
'type' => 'int',
);
return $this->buildPagingClauseFromMultipleColumns( return $this->buildPagingClauseFromMultipleColumns(
$conn_r, $conn_r,
$columns, $columns,