-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated parser to support aggegrate functions in null comparisons #864
Conversation
Parser didn't support syntax like "SELECT i FROM entity i JOIN i.second s GROUP BY i HAVING max(s.something) IS NULL" which should be perfectly valid. Changed isAggregateFunction to support parameterless call which makes it consistent with isFunction.
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-2827 We use Jira to track the state of pull requests and the versions they got |
{ | ||
if(!isset($tokenType)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use null ===
instead of !isset
, and please add the curly braces
Please add some tests covering this case |
@guilhermeblanco Is this valid? @curry684 please update the DQL documentation to acommendate the new syntax, if guilherme accepts this change. |
@curry684 This needs tests as well, please add them. |
I needed to fix the bug badly, so I fixed it in our local code and have been running production with it ever since. Whether the fix is entirely valid - no clue, and I honestly don't have time to dive into the project deep enough to go writing docs or tests, I just considered it good courtesy to submit the fix instead of just report a bug when I have fixed it anyway. It really needs someone to review it for coding guidelines anyway. |
@curry684 This is not a bug, its a new feature. If you take a look at the documentation DQL EBNF, then you see this is not supported by DQL. |
@beberlei support request is valid, but patch doesn't seem entirely correct. |
As of 841bdd5 this is now implemented. Null comparisons with aggregates is part of SQL-92, so all drivers are supported. |
Thank you :) |
Parser didn't support syntax like "SELECT i FROM entity i JOIN i.second s GROUP BY i HAVING max(s.something) IS NULL" which should be perfectly valid. Changed isAggregateFunction to support parameterless call which makes it consistent with isFunction.