Index: lib/Doctrine/Query/Abstract.php =================================================================== --- lib/Doctrine/Query/Abstract.php (revision 7676) +++ lib/Doctrine/Query/Abstract.php (working copy) @@ -1359,9 +1359,11 @@ */ public function andWhereIn($expr, $params = array(), $not = false) { - // if there's no params, return (else we'll get a WHERE IN (), invalid SQL) - if (isset($params) and (count($params) == 0)) { - return $this; + $params = (array) $params; + + // if there's no params, throw exception (else we'll get a WHERE IN (), invalid SQL) + if (count($params) == 0) { + throw new Doctrine_Query_Exception('You must pass at least one parameter when using an IN() condition.'); } if ($this->_hasDqlQueryPart('where')) { @@ -1386,9 +1388,11 @@ */ public function orWhereIn($expr, $params = array(), $not = false) { - // if there's no params, return (else we'll get a WHERE IN (), invalid SQL) - if (isset($params) and (count($params) == 0)) { - return $this; + $params = (array) $params; + + // if there's no params, throw exception (else we'll get a WHERE IN (), invalid SQL) + if (count($params) == 0) { + throw new Doctrine_Query_Exception('You must pass at least one parameter when using an IN() condition.'); } if ($this->_hasDqlQueryPart('where')) { @@ -1405,7 +1409,7 @@ { $params = (array) $params; - // if there's no params, return (else we'll get a WHERE IN (), invalid SQL) + // if there's no params, throw exception (else we'll get a WHERE IN (), invalid SQL) if (count($params) == 0) { throw new Doctrine_Query_Exception('You must pass at least one parameter when using an IN() condition.'); }