summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_dbi.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 3620018..39f50a7 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -401,7 +401,7 @@ function _where($params)
foreach ((array)$value as $val)
$parts[] = "CONCAT(',',$field,',') LIKE " . $this->escape_string("%,$val,%");
- $query .= $sep . "(" . join(" OR ", $parts) . ")";
+ $query .= $sep . "$field IS NOT NULL AND (" . join(" OR ", $parts) . ")"; # Check for IS NOT NULL to take advantage of index
}
else
$query .= $sep . "1";