Doctrine 1
  1. Doctrine 1
  2. DC-703

[PATCH] Doctrine_Connection_Oracle unquoted query aliases in _createLimitSubquery

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-RC1, 1.2.0, 1.2.1, 1.2.2
    • Fix Version/s: 1.2.3
    • Component/s: Connection
    • Labels:
      None

      Description

      When using identifier quoting with oracle driver, the _createLimitSubquery is giving into the select statement unquoted subquery aliases. That leads to Oracle errors.

      Simple patch:
      {{
      diff --git a/lib/Doctrine/Connection/Oracle.php b/lib/Doctrine/Connection/Oracle.php
      index db538fb..6e5f629 100644
      — a/lib/Doctrine/Connection/Oracle.php
      +++ b/lib/Doctrine/Connection/Oracle.php
      @@ -108,8 +108,8 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection_Common
      $column = $column === null ? '*' : $this->quoteIdentifier($column);
      if ($offset > 0)

      { $min = $offset + 1; - $query = 'SELECT b.'.$column.' FROM ( '. - 'SELECT a.*, ROWNUM AS doctrine_rownum FROM ( ' + $query = 'SELECT '.$this->quoteIdentifier('b').'.'.$column.' FROM ( '. + 'SELECT '.$this->quoteIdentifier('a').'.*, ROWNUM AS doctrine_rownum FROM ( ' . $query . ' ) ' . $this->quoteIdentifier('a') . ' '. ' ) ' . $this->quoteIdentifier('b') . ' '. 'WHERE doctrine_rownum BETWEEN ' . $min . ' AND ' . $max; }

      }

        Activity

        Show
        Miloslav "adrive" Kmet added a comment - Fixed in http://github.com/milokmet/doctrine1/tree/DC-703

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Miloslav "adrive" Kmet
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: