From 3c5c08e79310076dee6efe79f6bd32888791b848 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 22 Dec 2011 00:32:42 -0800 Subject: [PATCH] Don't use LIKE for numbers in SQLite (bug #3420408) --- adminer/include/functions.inc.php | 2 +- changes.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 78745f36..e49b2501 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -337,7 +337,7 @@ function where($where) { $return = array(); foreach ((array) $where["where"] as $key => $val) { $return[] = idf_escape(bracket_escape($key, 1)) // 1 - back - . ((ereg('\\.', $val) || $jush == "mssql") && $jush != "pgsql" ? " LIKE " . exact_value(addcslashes($val, "%_\\")) : " = " . exact_value($val)) // LIKE because of floats, but slow with ints, in MS SQL because of text + . (($jush == "sql" && 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) { diff --git a/changes.txt b/changes.txt index ee578957..aa22ba9f 100644 --- a/changes.txt +++ b/changes.txt @@ -9,7 +9,7 @@ Esc to cancel AJAX request Ability to disable export (customization) MySQL: set autocommit after connect PostgreSQL: fix alter foreign key -PostgreSQL: don't use LIKE for numbers +PostgreSQL, SQLite: don't use LIKE for numbers (bug #3420408) PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619) Boolean search (Editor) Persian translation