diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index d208e0b2..afefa93f 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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"; diff --git a/changes.txt b/changes.txt index 933d42fd..f016e81d 100644 --- a/changes.txt +++ b/changes.txt @@ -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)