DDC-1978: SQLParserUtils array_fill tries to create array with zero elements when empty parameter is bound #2496

Closed
opened 2026-01-22 13:55:12 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 10, 2012).

Jira issue originally created by user matt-button:

When binding an empty array as a parameter (and specifying a parameter type to work around DDC-1977) SQLParserUtils::expandListParameters tries to use array_fill to generate an empty array.

https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/SQLParserUtils.php#L127

Pseudo-code that generated the bug:

$this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();
Originally created by @doctrinebot on GitHub (Aug 10, 2012). Jira issue originally created by user matt-button: When binding an empty array as a parameter (and specifying a parameter type to work around [DDC-1977](http://www.doctrine-project.org/jira/browse/DDC-1977)) SQLParserUtils::expandListParameters tries to use array_fill to generate an empty array. https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/SQLParserUtils.php#L127 Pseudo-code that generated the bug: ``` $this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult(); ```
admin added the Bug label 2026-01-22 13:55:12 +01:00
admin closed this issue 2026-01-22 13:55:12 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 15, 2012):

Comment created by @beberlei:

A related Github Pull-Request [GH-425] was opened
https://github.com/doctrine/doctrine2/pull/425

@doctrinebot commented on GitHub (Aug 15, 2012): Comment created by @beberlei: A related Github Pull-Request [GH-425] was opened https://github.com/doctrine/doctrine2/pull/425
Author
Owner

@doctrinebot commented on GitHub (Aug 15, 2012):

Comment created by @beberlei:

A related Github Pull-Request [GH-425] was closed
https://github.com/doctrine/doctrine2/pull/425

@doctrinebot commented on GitHub (Aug 15, 2012): Comment created by @beberlei: A related Github Pull-Request [GH-425] was closed https://github.com/doctrine/doctrine2/pull/425
Author
Owner

@doctrinebot commented on GitHub (Aug 29, 2012):

Comment created by @FabioBatSilva:

Fixed by : 24ec1947a8

@doctrinebot commented on GitHub (Aug 29, 2012): Comment created by @FabioBatSilva: Fixed by : https://github.com/doctrine/dbal/commit/24ec1947a83b82101845889ba4fc7f3cbd0e5a90
Author
Owner

@doctrinebot commented on GitHub (Aug 29, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Aug 29, 2012): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 18, 2013):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-425] was closed:
https://github.com/doctrine/dbal/pull/425

@doctrinebot commented on GitHub (Dec 18, 2013): Comment created by @doctrinebot: A related Github Pull-Request [GH-425] was closed: https://github.com/doctrine/dbal/pull/425
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2496