Doctrine 1
  1. Doctrine 1
  2. DC-256

Identifier Quoting not made in generated subquery

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.12, 1.1.4, 1.1.5
    • Fix Version/s: 1.2.0-RC1
    • Component/s: Query
    • Labels:
      None
    • Environment:
      Linux, Oracle 10g

      Description

      If identifier quoting is enabled doctrine does not perform quoting in some subqueries.

      $this->_conn->quoteIdentifier has to be added twice as below in query.php line 1426:

      $subquery = 'SELECT doctrine_subquery_alias.' . $this->_conn->quoteIdentifier($table->getColumnName($table->getIdentifier()))
      
          . ' FROM (' . $subquery . ') doctrine_subquery_alias'
          . ' GROUP BY doctrine_subquery_alias.' . $this->_conn->quoteIdentifier($table->getColumnName($table->getIdentifier()))
          . ' ORDER BY MIN(ROWNUM)'; 
      

        Activity

        Hide
        Thomas Wahle added a comment - - edited

        In 1.2 Beta 3 the quoting is not fixed

        Identifier Quoting need to be done in Doctrine_Query line 1462 and line 1464 to $table->getColumnName($table->getIdentifier

        $subquery = 'SELECT doctrine_subquery_alias.' . $table->getColumnName($table->getIdentifier())
        . ' FROM (' . $subquery . ') doctrine_subquery_alias'
        . ' GROUP BY doctrine_subquery_alias.' . $table->getColumnName($table->getIdentifier())
        . ' ORDER BY MIN(ROWNUM)';

        The above code creates incorrect statements if identifier quoting is enabled

        Show
        Thomas Wahle added a comment - - edited In 1.2 Beta 3 the quoting is not fixed Identifier Quoting need to be done in Doctrine_Query line 1462 and line 1464 to $table->getColumnName($table->getIdentifier $subquery = 'SELECT doctrine_subquery_alias.' . $table->getColumnName($table->getIdentifier()) . ' FROM (' . $subquery . ') doctrine_subquery_alias' . ' GROUP BY doctrine_subquery_alias.' . $table->getColumnName($table->getIdentifier()) . ' ORDER BY MIN(ROWNUM)'; The above code creates incorrect statements if identifier quoting is enabled
        Hide
        Jonathan H. Wage added a comment -

        This is fixed in SVN and will be in 1.2.0-RC1

        Show
        Jonathan H. Wage added a comment - This is fixed in SVN and will be in 1.2.0-RC1

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Thomas Wahle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: