Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5392'
Browse files Browse the repository at this point in the history
Close #5392
  • Loading branch information
weierophinney committed Apr 11, 2014
2 parents a50c36c + 4cdb133 commit 8e42e86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion library/Zend/Db/Sql/AbstractSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Zend\Db\Adapter\ParameterContainer;
use Zend\Db\Adapter\Platform\PlatformInterface;
use Zend\Db\Adapter\StatementContainer;
use Zend\Db\Sql\Platform\PlatformDecoratorInterface;

abstract class AbstractSql
{
Expand Down Expand Up @@ -173,7 +174,14 @@ protected function processSubSelect(Select $subselect, PlatformInterface $platfo
$subselect->processInfo['paramPrefix'] = 'subselect' . $subselect->processInfo['subselectCount'];

// call subselect
$subselect->prepareStatement(new \Zend\Db\Adapter\Adapter($driver, $platform), $stmtContainer);
if ($this instanceof PlatformDecoratorInterface) {
/** @var Select|PlatformDecoratorInterface $subselectDecorator */
$subselectDecorator = clone $this;
$subselectDecorator->setSubject($subselect);
$subselectDecorator->prepareStatement(new \Zend\Db\Adapter\Adapter($driver, $platform), $stmtContainer);
} else {
$subselect->prepareStatement(new \Zend\Db\Adapter\Adapter($driver, $platform), $stmtContainer);
}

// copy count
$this->processInfo['subselectCount'] = $subselect->processInfo['subselectCount'];
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Sql/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ protected function processJoins(PlatformInterface $platform, DriverInterface $dr
$joinName = ($joinName[1] ? $platform->quoteIdentifier($joinName[1]) . $platform->getIdentifierSeparator() : '') . $platform->quoteIdentifier($joinName[0]);
} else {
if ($joinName instanceof Select) {
$joinName = '(' . $joinName->processSubSelect($joinName, $platform, $driver, $parameterContainer) . ')';
$joinName = '(' . $this->processSubSelect($joinName, $platform, $driver, $parameterContainer) . ')';
} else {
$joinName = $platform->quoteIdentifier($joinName);
}
Expand Down

0 comments on commit 8e42e86

Please sign in to comment.