From: Jakub Vrana Date: Sat, 16 Oct 2010 14:31:01 +0000 (+0200) Subject: Use LIKE for text comparison in MS SQL (bug #3088222) X-Git-Tag: v3.0.1~24 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=1a8d7f1733e39bf39dd7d8d909f577ad9243a4ef;p=adminer.git Use LIKE for text comparison in MS SQL (bug #3088222) --- diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 34feeb32..ea81a1c9 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -237,10 +237,11 @@ function unique_array($row, $indexes) { * @return string */ function where($where) { + global $jush; $return = array(); foreach ((array) $where["where"] as $key => $val) { $return[] = idf_escape(bracket_escape($key, 1)) // 1 - back - . (ereg('\\.', $val) ? " LIKE " . exact_value(addcslashes($val, "%_")) : " = " . exact_value($val)) // LIKE because of floats, but slow with ints + . (ereg('\\.', $val) || $jush == "mssql" ? " LIKE " . exact_value(addcslashes($val, "%_")) : " = " . exact_value($val)) // LIKE because of floats, but slow with ints, in MS SQL because of text ; //! enum and set } foreach ((array) $where["null"] as $key) {