1
0
mirror of synced 2025-01-20 07:21:40 +03:00

Fix Oracle subquery ordering lost bug

See http://www.doctrine-project.org/jira/browse/DDC-1800 for a full description.
This commit is contained in:
Raymond Kolbe 2013-04-09 17:00:06 -03:00
parent 142c20aad1
commit b8b7afe576

View File

@ -137,9 +137,16 @@ class LimitSubqueryOutputWalker extends SqlWalker
));
}
// Build the counter query.
$sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result',
implode(', ', $sqlIdentifier), $innerSql);
// Build the counter query
if ($this->platform instanceof OraclePlatform) {
// Ordering is lost in Oracle with subqueries
// http://www.doctrine-project.org/jira/browse/DDC-1800
$sql = sprintf('SELECT DISTINCT %s, ROWNUM FROM (%s) dctrn_result ORDER BY ROWNUM ASC',
implode(', ', $sqlIdentifier), $innerSql);
} else {
$sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result',
implode(', ', $sqlIdentifier), $innerSql);
}
if ($this->platform instanceof PostgreSqlPlatform) {
//http://www.doctrine-project.org/jira/browse/DDC-1958