Zend Framework

Problem with joinUsing and Oracle

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.1
  • Fix Version/s: 1.6.2
  • Component/s: Zend_Db_Select
  • Labels:
    None
  • Fix Version Priority:
    Should Have

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);

Issue Links

Activity

Hide
Mickael Perraud added a comment -

Patch

Show
Mickael Perraud added a comment - Patch
Hide
Wil Sinclair added a comment -

Please evaluate and fix/categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and fix/categorize as necessary.
Hide
Mickael Perraud added a comment -

Fixed in SVN11572

Show
Mickael Perraud added a comment - Fixed in SVN11572

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: