[DDC-1995] "Query Exception: Invalid parameter number: number of bound variables does not match number of tokens" when using an "Instance Of" expression Created: 22/Aug/12  Updated: 29/Aug/12

Status: Open
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: Git Master
Fix Version/s: Git Master
Security Level: All

Type: Bug Priority: Major
Reporter: Craig Marvelley Assignee: Guilherme Blanco
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Similar to this issue I think, but triggered when performing a query on entities modelled with Class Table Inheritance, e.g.

$qb = $repository->createQueryBuilder('entity');
$metadata = $em->getClassMetadata($class);
$qb->where('entity INSTANCE OF :type')->setParameter('type', $metadata);
$qb->getQuery()->execute();

Seems that there isn't a corresponding entry in the parameter mapping array for this clause, which triggers the exception at line 254 of Doctrine\ORM\Query:

if (count($paramMappings) != count($this->parameters))

{ throw QueryException::invalidParameterNumber(); }

 Comments   
Comment by Craig Marvelley [ 22/Aug/12 ]

Pull request with a potential fix: https://github.com/doctrine/doctrine2/pull/429

Comment by Benjamin Eberlei [ 29/Aug/12 ]

Assigned to Guilherme

Generated at Fri May 24 14:44:25 UTC 2013 using JIRA 5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5.