ZF-3152: Problem with joinUsing and Oracle

Description

In the function _joinUsing of Zend_Db_Select:


public function _joinUsing($type, $name, $cond, $cols = '*', $schema = null)
{
    if (empty($this->_parts[self::FROM])) {
        require_once 'Zend/Db/Select/Exception.php';
        throw new Zend_Db_Select_Exception("You can only perform a joinUsing after specifying a FROM table");
    }

    $join  = $this->_adapter->quoteIdentifier(key($this->_parts[self::FROM]));
    $from  = $this->_adapter->quoteIdentifier($this->_uniqueCorrelation($name));

    $cond1 = $from . '.' . $cond;
    $cond2 = $join . '.' . $cond;
    $cond  = $cond1 . ' = ' . $cond2;

    return $this->_join($type, $name, $cond, $cols, $schema);
}

There is a call to quoteIdentifier, to function with Oracle, we must call with second parameter:


$join  = $this->_adapter->quoteIdentifier(key($this->_parts[self::FROM]), true);
$from  = $this->_adapter->quoteIdentifier($this->_uniqueCorrelation($name), true);

Comments

Patch

Please evaluate and fix/categorize as necessary.

Fixed in SVN11572