-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Do not generate FROM clause in QueryBuilder if no tables specified #2292
Conversation
But doesn't this count as improvement? |
@Ocramius not sure. I'm fine having it as improvement. Guess it depends on what was to expect before, whether the |
@deeky666 ok, then I'll take it as bugfix. Restoring milestone |
@Ocramius fine. You can merge then as soon as you want. |
|
||
$query .= implode(', ', $this->getFromClauses()) | ||
$query .= ($this->sqlParts['from'] ? ' FROM ' . implode(', ', $this->getFromClauses()) : '') |
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.
Consider that on Oracle you can't select without FROM. Needs select from dual in that case.
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.
Yeah it is neither meant to be platform aware nor is it meant to be able to validate SQL..
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.
Good call
@Ocramius poke |
Backported to |
fixes #2291
SELECT
statements withoutFROM
clause can be valid and legit in some scenarios. See issue.