]> git.joonet.de Git - adminer.git/commitdiff
Use IN for search in numeric fields (Editor)
authorJakub Vrana <jakub@vrana.cz>
Thu, 6 Jan 2011 08:41:27 +0000 (09:41 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 6 Jan 2011 08:45:45 +0000 (09:45 +0100)
changes.txt
editor/include/adminer.inc.php

index 98574d636c520ed781e2571b16cf9a61ac5278fc..2d1676e6c16c04924cd0ab83073d3c841bdc55b1 100644 (file)
@@ -8,6 +8,7 @@ MS SQL: auto primary and foreign key
 SQLite: display 0
 Create table default data type: int
 Homepage customization
+Use IN for search in numeric fields (Editor)
 Work without session.use_cookies (bug #3138640)
 Portuguese translation
 
index 1f5fe4f12e0570e0650c50e1fa5ae2f84ea1ee01..4f50170552f2fab8338587afbf27f125cf413413 100644 (file)
@@ -302,7 +302,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
                                                } else {
                                                        $text_type = ereg('char|text|enum|set', $field["type"]);
                                                        $value = $this->processInput($field, ($text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val));
-                                                       $conds[] = idf_escape($name) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") : (in_array($op, $this->operators) ? " $op" : ($op != "=" && $text_type ? " LIKE" : " ="))) . " $value"; //! can issue "Illegal mix of collations" for columns in other character sets - solve by CONVERT($name using utf8)
+                                                       $conds[] = idf_escape($name) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") . " $value"
+                                                               : (in_array($op, $this->operators) || $op == "=" ? " $op $value"
+                                                               : ($text_type ? " LIKE $value"
+                                                               : " IN (" . str_replace(",", "', '", $value) . ")"
+                                                       ))); //! can issue "Illegal mix of collations" for columns in other character sets - solve by CONVERT($name using utf8)
                                                }
                                        }
                                }