Translate empty IN to NULL
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@744 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
4c736a0ac9
commit
68c46b44ec
|
@ -41,10 +41,9 @@ foreach ((array) $_GET["where"] as $val) {
|
||||||
if (strlen("$val[col]$val[val]") && in_array($val["op"], $operators)) {
|
if (strlen("$val[col]$val[val]") && in_array($val["op"], $operators)) {
|
||||||
if ($val["op"] == "AGAINST") {
|
if ($val["op"] == "AGAINST") {
|
||||||
$where[] = "MATCH (" . idf_escape($val["col"]) . ") AGAINST ('" . $dbh->escape_string($val["val"]) . "' IN BOOLEAN MODE)";
|
$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 {
|
} 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"])) {
|
if (strlen($val["col"])) {
|
||||||
$where[] = idf_escape($val["col"]) . $cond;
|
$where[] = idf_escape($val["col"]) . $cond;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue