Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
bb94f6ea
Commit
bb94f6ea
authored
Mar 16, 2010
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Fixed support to ResultVariable usage in ArithmeticExpression.
parent
0fde94dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
Parser.php
lib/Doctrine/ORM/Query/Parser.php
+2
-2
SqlWalker.php
lib/Doctrine/ORM/Query/SqlWalker.php
+4
-0
SelectSqlGenerationTest.php
tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php
+8
-0
No files found.
lib/Doctrine/ORM/Query/Parser.php
View file @
bb94f6ea
...
...
@@ -2129,7 +2129,7 @@ class Parser
/**
* ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")"
* | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings
* | FunctionsReturningDatetime |
Identification
Variable
* | FunctionsReturningDatetime |
Result
Variable
*/
public
function
ArithmeticPrimary
()
{
...
...
@@ -2154,7 +2154,7 @@ class Parser
return
$this
->
SingleValuedPathExpression
();
}
return
$this
->
Identification
Variable
();
return
$this
->
Result
Variable
();
case
Lexer
::
T_INPUT_PARAMETER
:
return
$this
->
InputParameter
();
...
...
lib/Doctrine/ORM/Query/SqlWalker.php
View file @
bb94f6ea
...
...
@@ -1639,6 +1639,10 @@ class SqlWalker implements TreeWalker
$sql
.=
'('
.
$this
->
walkSimpleArithmeticExpression
(
$primary
)
.
')'
;
}
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
];
}
return
$sql
;
...
...
tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php
View file @
bb94f6ea
...
...
@@ -527,6 +527,14 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
);
}
public
function
testSupportResultVariableInWherePart
()
{
$this
->
assertSqlGeneration
(
"SELECT p.phonenumber, COUNT(p.user) AS total FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE total > 0 GROUP BY p.user"
,
"SELECT c0_.phonenumber AS phonenumber0, COUNT(c0_.user_id) AS sclr1 FROM cms_phonenumbers c0_ WHERE sclr1 > 0 GROUP BY c0_.user_id"
);
}
public
function
testSingleValuedAssociationNullCheckOnOwningSide
()
{
$this
->
assertSqlGeneration
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment