1
0
mirror of synced 2025-02-01 04:51:45 +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. // Build the counter query
$sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', if ($this->platform instanceof OraclePlatform) {
implode(', ', $sqlIdentifier), $innerSql); // 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) { if ($this->platform instanceof PostgreSqlPlatform) {
//http://www.doctrine-project.org/jira/browse/DDC-1958 //http://www.doctrine-project.org/jira/browse/DDC-1958