]> git.joonet.de Git - adminer.git/commitdiff
Translate empty IN to NULL
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 22 Jun 2009 00:15:00 +0000 (00:15 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 22 Jun 2009 00:15:00 +0000 (00:15 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@744 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/select.inc.php

index 0ae1d4369820e96014e3e58d1e209f8014137a55..8b99915ce0e4788bafec3afb122a6e0821226048 100644 (file)
@@ -41,10 +41,9 @@ foreach ((array) $_GET["where"] as $val) {
        if (strlen("$val[col]$val[val]") && in_array($val["op"], $operators)) {
                if ($val["op"] == "AGAINST") {
                        $where[] = "MATCH (" . idf_escape($val["col"]) . ") AGAINST ('" . $dbh->escape_string($val["val"]) . "' IN BOOLEAN MODE)";
-               } elseif (ereg('IN$', $val["op"]) && !strlen($in = process_length($val["val"]))) {
-                       $where[] = "0";
                } else {
-                       $cond = " $val[op]" . (ereg('NULL$', $val["op"]) ? "" : (ereg('IN$', $val["op"]) ? " ($in)" : " '" . $dbh->escape_string($val["val"]) . "'")); //! this searches in numeric values too
+                       $in = process_length($val["val"]);
+                       $cond = " $val[op]" . (ereg('NULL$', $val["op"]) ? "" : (ereg('IN$', $val["op"]) ? " (" . (strlen($in) ? $in : "NULL") . ")" : " '" . $dbh->escape_string($val["val"]) . "'")); //! this searches in numeric values too
                        if (strlen($val["col"])) {
                                $where[] = idf_escape($val["col"]) . $cond;
                        } else {