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
Posted by Mickael Perraud (mikaelkael) on 2008-04-25T12:46:53.000+0000
Patch
Posted by Wil Sinclair (wil) on 2008-06-09T12:37:14.000+0000
Please evaluate and fix/categorize as necessary.
Posted by Mickael Perraud (mikaelkael) on 2008-10-01T14:45:08.000+0000
Fixed in SVN11572