From f7d691a0aaac47da7924454f230160f739aac771 Mon Sep 17 00:00:00 2001 From: pookey Date: Sat, 26 Jan 2008 21:20:24 +0000 Subject: [PATCH] fix to whereIn to prevent invalid SQL being generated when no params are passed --- lib/Doctrine/Query/Abstract.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Doctrine/Query/Abstract.php b/lib/Doctrine/Query/Abstract.php index 1454ffa91..011146397 100644 --- a/lib/Doctrine/Query/Abstract.php +++ b/lib/Doctrine/Query/Abstract.php @@ -1136,6 +1136,11 @@ abstract class Doctrine_Query_Abstract public function whereIn($expr, $params = array(), $not = false) { $params = (array) $params; + + // if there's no params, return (else we'll get a WHERE IN (), invalid SQL) + if (!count($params)) + return; + $a = array(); foreach ($params as $k => $value) { if ($value instanceof Doctrine_Expression) {