Skip to content

Commit 01fd136

Browse files
committed
fixup! only add relation identifier when at least one relation column is selected
1 parent 7b6763b commit 01fd136

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Doctrine/Query.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ public function parseSelect($dql)
615615

616616
$terms = $this->_tokenizer->sqlExplode($reference, ' ');
617617
$pos = strpos($terms[0], '(');
618+
$isColumnSelect = $pos === false;
618619

619620
if (count($terms) > 1 || $pos !== false) {
620621
$expression = array_shift($terms);
@@ -648,7 +649,7 @@ public function parseSelect($dql)
648649

649650
$this->_queryComponents[$componentAlias]['agg'][$index] = $alias;
650651
$this->_queryComponents[$componentAlias]['has_selected_column'] ??= false;
651-
$this->_queryComponents[$componentAlias]['has_selected_column'] |= $pos === false;
652+
$this->_queryComponents[$componentAlias]['has_selected_column'] |= $isColumnSelect;
652653

653654
if (preg_match('/^([^\(]+)\.(\'?)(.*?)(\'?)$/', $expression, $field)) {
654655
$this->_queryComponents[$componentAlias]['agg_field'][$index] = $field[3];

0 commit comments

Comments
 (0)