mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1298: SqlWalker->walkSelectClause imploding empty strings results in invalid query #1631
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jul 27, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user tbo:
Given the following MySQL structure
the following models:
and using the following DQL:
will result in the following sql query:
there are 2 comma's between "f0_.fooReference AS fooReference1" and "b1_.barID AS barID2" resulting in an invalid query.
The first line of the walkSelectClause function in Doctrine/ORM/Query/SqlWalker.php will implode the result of the array_map.
But you receive an empty result from processing the data for the selectExpression "fb" explaining why you got the extra comma.
This worked in a previous version when 2.1 was still in development.
@doctrinebot commented on GitHub (Jul 27, 2011):
Comment created by tbo:
I have fixed it and made a pull request: https://github.com/doctrine/doctrine2/pull/96
@doctrinebot commented on GitHub (Jul 28, 2011):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Jul 28, 2011):
Issue was closed with resolution "Fixed"