mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
InExpression will give Syntax error if using non-named empty array #5142
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mickadoo on GitHub (Jun 6, 2016).
I would expect the following to produce the same result whether
$hitsis empty or not:However the second version produces
[Syntax Error] line 0, col 70: Error: Expected Literal, got ')'while the first version correctly returns an empty result set.I believe the problem is in
ORM/Query/Parser.phpin theInExpressionfunction. I thought I could create a pull request suggesting to change it to something like:But when I did that I got another error because an extra closing parentheses is added to the query resulting in
WHERE s0_.id IN ())@eigan commented on GitHub (Dec 2, 2020):
@Ocramius Open for PR on this change as proposed by @mickadoo? It should result in a query like
IN(NULL).