DDC-1848: "QueryException: Invalid parameter number: number of bound variables does not match number of tokens" with "dev-master" of Doctrine\ORM + Pagerfanta. #2328

Closed
opened 2026-01-22 13:48:38 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (May 30, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user pjedrzejewski:

Using Symfony2 master with Doctrine\ORM master & Pagerfanta paginator (which uses Doctrine paginator internally) causes this exception.

"QueryException: Invalid parameter number: number of bound variables does not match number of tokens". Works fine with the master of Symfony & same version of Pagerfanta, but with 2.2 of Doctrine ORM.

Full app to see it is available here: http://github.com/Sylius/Sylius-Sandbox.

Full trace (without twig and Symfony part)

[1/2] QueryException: Invalid parameter number: number of bound variables does not match number of tokens
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php at line 72
at QueryException ::invalidParameterNumber ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php at line 255
at Query ->_doExecute ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 737
at AbstractQuery ->execute (null, '3')
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 562
at AbstractQuery ->getScalarResult ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php at line 144
at Paginator ->count ()
at count (object(Paginator))
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineORMAdapter.php at line 75
at DoctrineORMAdapter ->getNbResults ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 167
at Pagerfanta ->getNbResults ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 190
at Pagerfanta ->haveToPaginate ()

Originally created by @doctrinebot on GitHub (May 30, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user pjedrzejewski: Using Symfony2 master with Doctrine\ORM master & Pagerfanta paginator (which uses Doctrine paginator internally) causes this exception. "QueryException: Invalid parameter number: number of bound variables does not match number of tokens". Works fine with the master of Symfony & same version of Pagerfanta, but with 2.2 of Doctrine ORM. Full app to see it is available here: http://github.com/Sylius/Sylius-Sandbox. Full trace (without twig and Symfony part) [1/2] QueryException: Invalid parameter number: number of bound variables does not match number of tokens in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php at line 72 at QueryException ::invalidParameterNumber () in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php at line 255 at Query ->_doExecute () in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 737 at AbstractQuery ->execute (null, '3') in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 562 at AbstractQuery ->getScalarResult () in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php at line 144 at Paginator ->count () at count (object(Paginator)) in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineORMAdapter.php at line 75 at DoctrineORMAdapter ->getNbResults () in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 167 at Pagerfanta ->getNbResults () in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 190 at Pagerfanta ->haveToPaginate ()
admin added the Bug label 2026-01-22 13:48:38 +01:00
admin closed this issue 2026-01-22 13:48:39 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 31, 2012):

Comment created by umpirsky:

I tested Sylius against this issue with each commit from doctrine master branch, and I find out that bug appeared in this 1635e0af4b commit.

@doctrinebot commented on GitHub (May 31, 2012): Comment created by umpirsky: I tested Sylius against this issue with each commit from doctrine master branch, and I find out that bug appeared in this https://github.com/doctrine/doctrine2/commit/1635e0af4b06ef3015205563b59b505ae3fac69d commit.
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Comment created by @ocramius:

Could you check if this isn't the same problem reported at DDC-1803?

@doctrinebot commented on GitHub (Jul 8, 2012): Comment created by @ocramius: Could you check if this isn't the same problem reported at [DDC-1803](http://www.doctrine-project.org/jira/browse/DDC-1803)?
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jul 8, 2012): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 8, 2012): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2328