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
Paginator with fetch collection and dbal 3 => empty query #9134
Comments
I have the same issue. When I downgrade "doctrine/dbal" to v2.x working properly. |
Would any of you able to trace down the issue and work on a fix? |
It happens when an SQL query is very long, e.g.:
The result is:
and the culprit is
in It looks like the regex patterns defined in the Parser class don't work with very long strings for some reason. |
Submitted an issue to DBAL repo as it's not a bug in the ORM. |
Thanks! |
Can we close this issue? |
The bug was fixed in DBAL 3.1.4 |
Bug Report
Summary
After upgrading to doctrine/dbal from 2 to 3, Paginator is not working anymore. When using parameter "fetch collection" to true, an exception is thrown "PDO query couldn't be empty".
How to reproduce
...$qb is a query builder... $query = $qb->getQuery(); $paginator = new Paginator($query, true); foreach($paginator as $result) { => EXCEPTION }
It seems that doctrine/dbal Connection does not resolve parameters ('?') correctly. Regular expression is "not correct" :
~\G\?\~s
.Workaround
Adding
"doctrine/dbal": "^2.13"
in composer.json to force using dbal 2 instead of 3.The text was updated successfully, but these errors were encountered: