[PR #7328] Handle removed parameters by tree walker in Paginator #10428

Open
opened 2026-01-22 16:07:30 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/7328

State: closed
Merged: Yes


There is a bug introduced in #6820 (my bad)
Given this code :

$query = $em->createQuery('SELECT a.id, (SELECT b.id FROM EntityB b WHERE b.id = :paramB) AS foo FROM EntityA a ORDER BY a.id');

$query->setParameter('paramB', 123);
$paginator = new Paginator($query);
$paginator->setUseOutputWalkers(false);
$paginator->getIterator();

The resulting subquery in the Paginator will look like this :

SELECT DISTINCT a.id FROM EntityA a ORDER BY a.id

The query is OK but the parameter 'paramB' is still binded to the query, causing a "tooManyParameters" exception.

Edit: I don't really know how to test this behaviour ...

**Original Pull Request:** https://github.com/doctrine/orm/pull/7328 **State:** closed **Merged:** Yes --- There is a bug introduced in #6820 (my bad) Given this code : ``` $query = $em->createQuery('SELECT a.id, (SELECT b.id FROM EntityB b WHERE b.id = :paramB) AS foo FROM EntityA a ORDER BY a.id'); $query->setParameter('paramB', 123); $paginator = new Paginator($query); $paginator->setUseOutputWalkers(false); $paginator->getIterator(); ``` The resulting subquery in the Paginator will look like this : ``` SELECT DISTINCT a.id FROM EntityA a ORDER BY a.id ``` The query is OK but the parameter 'paramB' is still binded to the query, causing a "tooManyParameters" exception. Edit: I don't really know how to test this behaviour ...
admin added the pull-request label 2026-01-22 16:07:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#10428