From 5f1a4074a0954912f6acad8245538ec60a1bf833 Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 20 Nov 2006 20:28:59 +0000 Subject: [PATCH] --- lib/Doctrine/Query.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Query.php b/lib/Doctrine/Query.php index 590ecef16..3d3912109 100644 --- a/lib/Doctrine/Query.php +++ b/lib/Doctrine/Query.php @@ -530,7 +530,11 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { } $field = $this->getShortAlias($table->getTableName()) . '.' . $table->getIdentifier(); - array_unshift($this->parts['where'], $field. ' IN (' . $subquery . ')'); + + // only append the subquery if it actually contains something + if($subquery !== '') + array_unshift($this->parts['where'], $field. ' IN (' . $subquery . ')'); + $modifyLimit = false; } } @@ -594,7 +598,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable { if( ! in_array($e[3], $this->subqueryAliases) && ! in_array($e[2], $this->subqueryAliases)) continue; - + } $subquery .= ' '.$part;