mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[Parser] Combination of discriminator, WhereInWalker, cloneQuery and apostrophe in like query causes parameters to not be bound #7404
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 @fliespl on GitHub (Aug 8, 2024).
Bug Report
Summary
My summary is not gonna be precise, that's why I have prepared a repro in github.
Basically using combination of mentioned above items, we can get into situation where parser mistakenly thinks it must not fill parameters (or skips some of them).
I have narrowed it down to regexp which searches query for parameters that it misses one of them in such conditions.
Current behaviour
Some parameters are not added due to parser missing resolution of one of the parameters due to apostrophe.
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
How to reproduce
Created symfony app (https://github.com/fliespl/doctrine-error) with minimal repo. Consists of two commands:
Expected behaviour
I would expect parser to correctly handled escaped literal strings with apostrophe.
@greg0ire commented on GitHub (Aug 10, 2024):
The reproducer does not work for me:
@fliespl commented on GitHub (Aug 10, 2024):
@greg0ire sorry about that - 3 files were left uncommited. Fixed in repo