Skip to content
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

QueryBuilder produces invalid SQL from an empty CompositeExpression #3845

Closed
morozov opened this issue Jan 23, 2020 · 4 comments · Fixed by #3868
Closed

QueryBuilder produces invalid SQL from an empty CompositeExpression #3845

morozov opened this issue Jan 23, 2020 · 4 comments · Fixed by #3868
Assignees
Milestone

Comments

@morozov
Copy link
Member

morozov commented Jan 23, 2020

Q A
BC Break no
Version 2.10.1
$qb = $conn->createQueryBuilder();
$qb->select('*')
    ->where($qb->expr()->andX());
echo $qb;
// SELECT * WHERE ()
@SenseException
Copy link
Member

What's the expected behaviour for this?

@morozov
Copy link
Member Author

morozov commented Jan 23, 2020

Either a QueryException or no WHERE clause. I mostly filed it for documentation purposes. In master, I want to make the composite expression to always have at least one (or even better, two) parts. It shouldn't be possible to instantiate an empty object in the first place.

@morozov
Copy link
Member Author

morozov commented Mar 17, 2020

Fixed by #3868.

@morozov morozov closed this as completed Mar 17, 2020
@morozov morozov linked a pull request Mar 18, 2020 that will close this issue
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants