1
0
mirror of synced 2025-01-09 18:47:10 +03:00

Fix applying ON/WITH conditions to first join in Class Table Inheritance

This commit is contained in:
Strate 2013-12-22 21:02:14 +04:00
parent 606ae2e03d
commit c6810861ca

View File

@ -982,6 +982,11 @@ class SqlWalker implements TreeWalker
break;
}
// FIXME: these should either be nested or all forced to be left joins (DDC-XXX)
if ($targetClass->isInheritanceTypeJoined()) {
$sql .= $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias);
}
// Handle WITH clause
if ($condExpr !== null) {
// Phase 2 AST optimization: Skip processing of ConditionalExpression
@ -989,11 +994,6 @@ class SqlWalker implements TreeWalker
$sql .= ' AND (' . $this->walkConditionalExpression($condExpr) . ')';
}
// FIXME: these should either be nested or all forced to be left joins (DDC-XXX)
if ($targetClass->isInheritanceTypeJoined()) {
$sql .= $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias);
}
// Apply the indexes
if ($indexBy) {
// For Many-To-One or One-To-One associations this obviously makes no sense, but is ignored silently.