mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1067: Doctrine 2 QuerryBuilder vs Handcoded DQL - different results #1333
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 (Mar 11, 2011).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user gdobrowolski:
As per Guilherme Blanco request I'm submitting this weird behaviour I have experienced:
(Original post can be found here: http://stackoverflow.com/questions/5261891/doctrine-2-querrybuilder-vs-handcoded-dql-different-results
My handcrafted query looks like this:
Now, I'm trying to reproduce it like this with QueryBuilder:
This however is producing this DQL query:
As you can see there is part of this missing comapring to handcrafted one (First line):
I'm not sure why these joins are missing as I am defining them here:
Update:
The fun part starts, when DQL gets translated into SQL - in this case MySQL:
Handcrafted one becomes:
Where generated one looks like this:
And this is invalid statement, as database returns with:
Column not found: 1054 Unknown column 'f1_.site_id' in 'on clause'