DDC-146: Select where clause is broken with @InheritanceType("SINGLE_TABLE") #181

Closed
opened 2026-01-22 12:29:50 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 13, 2009).

Jira issue originally created by user rickdt:

The "AND" is missing before the condition on the discriminator

In SqlWalker:1110 note the "termsSql" which is not defined anywhere.

public function walkWhereClause($whereClause)
    {
        $sql = ' WHERE ';
        $condExpr = $whereClause->conditionalExpression;

        $sql .= implode(
            ' OR ', array_map(array($this, 'walkConditionalTerm'), $condExpr->conditionalTerms)
        );

        $discrSql = $this->*generateDiscriminatorColumnConditionSql($this->*currentRootAlias);

        if ($discrSql) {
            if ($termsSql) $sql .= ' AND';

            $sql .= ' ' . $discrSql;
        }

        return $sql;
    }
Originally created by @doctrinebot on GitHub (Nov 13, 2009). Jira issue originally created by user rickdt: The "AND" is missing before the condition on the discriminator In SqlWalker:1110 note the "termsSql" which is not defined anywhere. ``` public function walkWhereClause($whereClause) { $sql = ' WHERE '; $condExpr = $whereClause->conditionalExpression; $sql .= implode( ' OR ', array_map(array($this, 'walkConditionalTerm'), $condExpr->conditionalTerms) ); $discrSql = $this->*generateDiscriminatorColumnConditionSql($this->*currentRootAlias); if ($discrSql) { if ($termsSql) $sql .= ' AND'; $sql .= ' ' . $discrSql; } return $sql; } ```
admin added the Bug label 2026-01-22 12:29:51 +01:00
admin closed this issue 2026-01-22 12:29:51 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 13, 2009):

Comment created by romanb:

This has already been fixed in trunk earlier today. See DDC-141.

@doctrinebot commented on GitHub (Nov 13, 2009): Comment created by romanb: This has already been fixed in trunk earlier today. See [DDC-141](http://www.doctrine-project.org/jira/browse/DDC-141).
Author
Owner

@doctrinebot commented on GitHub (Nov 13, 2009):

Issue was closed with resolution "Duplicate"

@doctrinebot commented on GitHub (Nov 13, 2009): Issue was closed with resolution "Duplicate"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#181