Skip to content
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

DDC-749: positional query parameters throwing a QueryException #5262

Closed
doctrinebot opened this issue Aug 17, 2010 · 7 comments
Closed

DDC-749: positional query parameters throwing a QueryException #5262

doctrinebot opened this issue Aug 17, 2010 · 7 comments
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user goriol:

I get the following exception:
"Invalid parameter number: number of bound variables does not match number of tokens"
when executing the following Doctrine query:

$em = $this->_getEntityManager();
$query = $em->createQuery('select e from Domain*Entity*Country e where e.alpha2Code like ?1');
$query->setParameters(array(1 => 'A%')); 
@doctrinebot
Copy link
Author

Comment created by @beberlei:

I cannot reproduce this sorry, can you retry with Beta4?

@doctrinebot
Copy link
Author

Comment created by goriol:

Hi Benjamin,

I made a new test and got the same error with BETA4.

Here is the stack trace:
Invalid parameter number: number of bound variables does not match number of tokens
#0 /Users/goriol/src/Doctrine/doctrine-orm-2.0.0BETA4/Doctrine/ORM/Query.php(229): Doctrine\ORM\Query\QueryException::invalidParameterNumber()
#1 /Users/goriol/src/Doctrine/doctrine-orm-2.0.0BETA4/Doctrine/ORM/AbstractQuery.php(528): Doctrine\ORM\Query->_doExecute()
#2 /Users/goriol/src/Doctrine/doctrine-orm-2.0.0BETA4/Doctrine/ORM/AbstractQuery.php(408): Doctrine\ORM\AbstractQuery->execute(Array, 4)
#3 /Users/goriol/src/Doctrine/doctrine-orm-2.0.0BETA4/Doctrine/ORM/AbstractQuery.php(434): Doctrine\ORM\AbstractQuery->getSingleResult(4)
#4 /Users/goriol/src/DoctrineExtensions/lib/DoctrineExtensions/Paginate/PaginationAdapter.php(82): Doctrine\ORM\AbstractQuery->getSingleScalarResult()
#5 /Users/goriol/src/DoctrineExtensions/lib/DoctrineExtensions/Paginate/PaginationAdapter.php(134): DoctrineExtensions\Paginate\PaginationAdapter->setRowCount(Object(Doctrine\ORM\Query))
#6 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Paginator.php(1028): DoctrineExtensions\Paginate\PaginationAdapter->count()
#7 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Paginator.php(712): Zend_Paginator->_calculatePageCount()
#8 /Users/goriol/src/Technema/Service/Doctrine.php(285): Zend_Paginator->setItemCountPerPage(30)
#9 /Users/goriol/src/Technema/Controller/Rest.php(85): Technema_Service_Doctrine->fetchPage(Array)
#10 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Controller/Action.php(513): Technema_Controller_Rest->indexAction()
#11 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('indexAction')
#12 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#13 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#14 /Users/goriol/src/Zend/ZendFramework-1.10.5/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#15 /private/var/www/erp.alterimago.com/public/index.php(24): Zend_Application->run()
#16 {main}

@doctrinebot
Copy link
Author

Comment created by @beberlei:

That stack trace puts the report in a new light, your code example is not really the source of the error but the pagination adapter is.

@doctrinebot
Copy link
Author

Comment created by @beberlei:

This is a Doctrine Extensions paginator bug, closing the issue here, its known in the extension already.

@doctrinebot
Copy link
Author

Issue was closed with resolution "Invalid"

@doctrinebot
Copy link
Author

Comment created by goriol:

Are you talking about this issue?
http://github.com/beberlei/DoctrineExtensions/issues#issue/10

@doctrinebot
Copy link
Author

Comment created by @beberlei:

yes thats the one

@doctrinebot doctrinebot added this to the 2.0-RC1 milestone Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant