]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Allow editing rows identified by negative floats (bug #695)
authorJakub Vrana <jakub@vrana.cz>
Tue, 20 Aug 2019 15:58:54 +0000 (17:58 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 20 Aug 2019 15:58:54 +0000 (17:58 +0200)
adminer/include/functions.inc.php
changes.txt

index d208e0b2a69ef3299c414b046e3fc80bafe2a305..afefa93f292109f96f46a3bc2b05c3ecb9fb01cb 100644 (file)
@@ -479,10 +479,10 @@ function where($where, $fields = array()) {
                $key = bracket_escape($key, 1); // 1 - back
                $column = escape_key($key);
                $return[] = $column
-                       . ($jush == "sql" && preg_match('~^[0-9]*\.[0-9]*$~', $val) ? " LIKE " . q(addcslashes($val, "%_\\"))
-                               : ($jush == "mssql" ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val))
+                       . ($jush == "sql" && is_numeric($val) && preg_match('~\.~', $val) ? " LIKE " . q($val) // LIKE because of floats but slow with ints
+                               : ($jush == "mssql" ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val)) // LIKE because of text
                                : " = " . unconvert_field($fields[$key], q($val))
-                       )) // LIKE because of floats but slow with ints, in MS SQL because of text
+                       ))
                ; //! enum and set
                if ($jush == "sql" && preg_match('~char|text~', $fields[$key]["type"]) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters
                        $return[] = "$column = " . q($val) . " COLLATE " . charset($connection) . "_bin";
index 933d42fd1651c03f662bbd6bd50eeebfbfcb1338..f016e81df2a399ccd376dc4e8af25a4f744887a0 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 4.7.3-dev:
 MySQL: Speed up displaying tables in large databases (bug #700)
+MySQL: Allow editing rows identified by negative floats (bug #695)
 MySQL: Skip editing generated columns
 SQLite: Quote strings stored in integer columns in export (bug #696)