[DDC-2452] Additional `WITH` condition in joins between JTI roots cause invalid SQL to be produced Created: 16/May/13 Updated: 27/Mar/14
|Project:||Doctrine 2 - ORM|
|Affects Version/s:||Git Master|
|Reporter:||Marco Pivetta||Assignee:||Marco Pivetta|
Given a simple Joined Table Inheritance like following:
Will produce broken SQL:
(please note the duplicate `ON` in the SQL)
That is caused because of the SQL walker producing the JTI filter with already the `ON` clause in it.
That happens because the JTI join conditions are added in https://github.com/doctrine/doctrine2/blob/2.4.0-BETA2/lib/Doctrine/ORM/Query/SqlWalker.php#L823-L825 (`walkRangeVariableDeclaration`), while the additional defined `WITH` conditions are considered in `walkJoinAssociationDeclaration` later on.
Added a test case and fix at https://github.com/doctrine/doctrine2/pull/668