Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13236165
D12351.id29752.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12351.id29752.diff
View Options
diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php
--- a/src/applications/repository/query/PhabricatorRepositoryQuery.php
+++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php
@@ -304,24 +304,28 @@
break;
case self::ORDER_COMMITTED:
$parts[] = array(
- 'name' => 's.epoch',
+ 'table' => 's',
+ 'column' => 'epoch',
);
break;
case self::ORDER_CALLSIGN:
$parts[] = array(
- 'name' => 'r.callsign',
+ 'table' => 'r',
+ 'column' => 'callsign',
'reverse' => true,
);
break;
case self::ORDER_NAME:
$parts[] = array(
- 'name' => 'r.name',
+ 'table' => 'r',
+ 'column' => 'name',
'reverse' => true,
);
break;
case self::ORDER_SIZE:
$parts[] = array(
- 'name' => 's.size',
+ 'table' => 's',
+ 'column' => 'size',
);
break;
default:
@@ -329,7 +333,8 @@
}
$parts[] = array(
- 'name' => 'r.id',
+ 'table' => 'r',
+ 'column' => 'id',
);
return $this->formatOrderClause($conn, $parts);
diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
--- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
+++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
@@ -310,12 +310,21 @@
$descending = !$descending;
}
- $name = $part['name'];
+ $table = idx($part, 'table');
+ $column = $part['column'];
if ($descending) {
- $sql[] = qsprintf($conn, '%Q DESC', $name);
+ if ($table !== null) {
+ $sql[] = qsprintf($conn, '%T.%T DESC', $table, $column);
+ } else {
+ $sql[] = qsprintf($conn, '%T DESC', $column);
+ }
} else {
- $sql[] = qsprintf($conn, '%Q ASC', $name);
+ if ($table !== null) {
+ $sql[] = qsprintf($conn, '%T.%T ASC', $table, $column);
+ } else {
+ $sql[] = qsprintf($conn, '%T ASC', $column);
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 22, 8:32 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6287970
Default Alt Text
D12351.id29752.diff (2 KB)
Attached To
Mode
D12351: Make formatOrderClause() safer
Attached
Detach File
Event Timeline
Log In to Comment