Skip to content

Commit 29961c7

Browse files
alquercithePanz
authored andcommitted
Revert "Added fields with alias to pendingFields array, fixed DC-585"
This reverts commit e3ae69c.
1 parent 2373ce3 commit 29961c7

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

lib/Doctrine/Query.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public function processPendingFields($componentAlias)
480480
}
481481

482482
$sql = array();
483-
foreach ($fields as $fieldAlias => $fieldName) {
483+
foreach ($fields as $fieldName) {
484484
$columnName = $table->getColumnName($fieldName);
485485
if (($owner = $table->getColumnOwner($columnName)) !== null &&
486486
$owner !== $table->getComponentName()) {
@@ -492,17 +492,10 @@ public function processPendingFields($componentAlias)
492492
. ' AS '
493493
. $this->_conn->quoteIdentifier($tableAlias . '__' . $columnName);
494494
} else {
495-
// Fix for http://www.doctrine-project.org/jira/browse/DC-585
496-
// Take the field alias if available
497-
if (isset($this->_aggregateAliasMap[$fieldAlias])) {
498-
$aliasSql = $this->_aggregateAliasMap[$fieldAlias];
499-
} else {
500-
$columnName = $table->getColumnName($fieldName);
501-
$aliasSql = $this->_conn->quoteIdentifier($tableAlias . '__' . $columnName);
502-
}
495+
$columnName = $table->getColumnName($fieldName);
503496
$sql[] = $this->_conn->quoteIdentifier($tableAlias) . '.' . $this->_conn->quoteIdentifier($columnName)
504497
. ' AS '
505-
. $aliasSql;
498+
. $this->_conn->quoteIdentifier($tableAlias . '__' . $columnName);
506499
}
507500
}
508501

@@ -656,13 +649,6 @@ public function parseSelect($dql)
656649
$this->_queryComponents[$componentAlias]['agg'][$index] = $alias;
657650

658651
$this->_neededTables[] = $tableAlias;
659-
660-
// Fix for http://www.doctrine-project.org/jira/browse/DC-585
661-
// Add selected columns to pending fields
662-
if (preg_match('/^([^\(]+)\.(\'?)(.*?)(\'?)$/', $expression, $field)) {
663-
$this->_pendingFields[$componentAlias][$alias] = $field[3];
664-
}
665-
666652
} else {
667653
$e = explode('.', $terms[0]);
668654

0 commit comments

Comments
 (0)