From 29e5141280de01f4eb46e62fb1a2122c61ed417f Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Tue, 16 Mar 2010 16:32:30 +0000 Subject: [PATCH] [2.0] Reverted r7392 which generates broken SQL query. --- lib/Doctrine/ORM/Query/Parser.php | 4 ++-- lib/Doctrine/ORM/Query/SqlWalker.php | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 51e16a765..2d626e0d4 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -2129,7 +2129,7 @@ class Parser /** * ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")" * | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings - * | FunctionsReturningDatetime | ResultVariable + * | FunctionsReturningDatetime | IdentificationVariable */ public function ArithmeticPrimary() { @@ -2154,7 +2154,7 @@ class Parser return $this->SingleValuedPathExpression(); } - return $this->ResultVariable(); + return $this->IdentificationVariable(); case Lexer::T_INPUT_PARAMETER: return $this->InputParameter(); diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index f1a561464..8dd1c856b 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -1640,9 +1640,7 @@ class SqlWalker implements TreeWalker } else if ($primary instanceof AST\Node) { $sql .= $primary->dispatch($this); } else if (is_string($primary)) { - $columnName = $this->_queryComponents[$primary]['token']['value']; - - $sql .= $this->_scalarResultAliasMap[$columnName]; + // We need to deal with IdentificationVariable here } return $sql;