DDC-123: PDO throws an exception when parameters are missing or mismatch, DC throws php warnings #153

Closed
opened 2026-01-22 12:28:51 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 6, 2009).

Jira issue originally created by user @beberlei:

PDO throws exceptions if you try to execute a query with a wrong parameter count or parameters named incorrect.

Doctrine\ORM\Query does nothing of such kind and only throws php warnings when wrong php array keys are accessed. Attached is a patch that corrects this behaviour to give a developer more feedback on this kind of errors.

Performance wise, on each _doExecute() 1 count check of params against set parameter mappings aswell as one additional check if each passed param really exists.

Originally created by @doctrinebot on GitHub (Nov 6, 2009). Jira issue originally created by user @beberlei: PDO throws exceptions if you try to execute a query with a wrong parameter count or parameters named incorrect. Doctrine\ORM\Query does nothing of such kind and only throws php warnings when wrong php array keys are accessed. Attached is a patch that corrects this behaviour to give a developer more feedback on this kind of errors. Performance wise, on each _doExecute() 1 count check of params against set parameter mappings aswell as one additional check if each passed param really exists.
admin added the Improvement label 2026-01-22 12:28:51 +01:00
admin closed this issue 2026-01-22 12:28:52 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 21, 2009):

Comment created by romanb:

This seems to be applied already.

@doctrinebot commented on GitHub (Nov 21, 2009): Comment created by romanb: This seems to be applied already.
Author
Owner

@doctrinebot commented on GitHub (Nov 21, 2009):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Nov 21, 2009): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Nov 21, 2009):

Comment created by @beberlei:

Oh I accidently committed this on DDC-127

@doctrinebot commented on GitHub (Nov 21, 2009): Comment created by @beberlei: Oh I accidently committed this on [DDC-127](http://www.doctrine-project.org/jira/browse/DDC-127)
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/1f5f684a80e0b9637f29

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/1f5f684a80e0b9637f29 - [10145_DDC_123.diff](https://gist.github.com/1f5f684a80e0b9637f29#file-10145_DDC_123-diff)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#153