Changeset 5307

Show
Ignore:
Timestamp:
12/18/08 00:15:10 (7 months ago)
Author:
jwage
Message:

[1.0, 1.1] Fixes issue with identifier quoting and limit subquery (closes #1762)

Location:
branches
Files:
2 added
4 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Query.php

    r5303 r5307  
    12261226        if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci') { 
    12271227            foreach ($this->_sqlParts['orderby'] as $part) { 
    1228                 $part = trim($part); 
     1228                // Remove identifier quoting if it exists 
     1229                $callback = create_function('$e', 'return trim($e, \'[]`"\');'); 
     1230                $part = trim(implode('.', array_map($callback, explode('.', $part)))); 
    12291231                $e = $this->_tokenizer->bracketExplode($part, ' '); 
    12301232                $part = trim($e[0]); 
  • branches/1.0/lib/Doctrine/Query/Abstract.php

    r5303 r5307  
    539539    public function getParams($params = array()) 
    540540    { 
    541         return array_merge($params, $this->_params['join'], $this->_params['set'], $this->_params['where'], $this->_params['having']); 
     541        return array_merge((array) $params, $this->_params['join'], $this->_params['set'], $this->_params['where'], $this->_params['having']); 
    542542    } 
    543543 
  • branches/1.1/lib/Doctrine/Query.php

    r5303 r5307  
    13071307        if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci') { 
    13081308            foreach ($this->_sqlParts['orderby'] as $part) { 
    1309                 $part = trim($part); 
     1309                // Remove identifier quoting if it exists 
     1310                $callback = create_function('$e', 'return trim($e, \'[]`"\');'); 
     1311                $part = trim(implode('.', array_map($callback, explode('.', $part)))); 
    13101312                $e = $this->_tokenizer->bracketExplode($part, ' '); 
    13111313                $part = trim($e[0]); 
  • branches/1.1/lib/Doctrine/Query/Abstract.php

    r5303 r5307  
    558558    { 
    559559        return array_merge( 
    560             $params, $this->_params['exec'],  
     560            (array) $params, (array) $this->_params['exec'],  
    561561            $this->_params['join'], $this->_params['set'], 
    562562            $this->_params['where'], $this->_params['having'] 
     
    10651065        if ($this->isLimitSubqueryUsed() && 
    10661066                $this->_conn->getAttribute(Doctrine::ATTR_DRIVER_NAME) !== 'mysql') { 
    1067             $params = array_merge($params, $params); 
     1067            $params = array_merge((array) $params, (array) $params); 
    10681068        } 
    10691069