From 897817eb0c431a4ea6585dea470c8bc43e08b824 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 28 Feb 2010 20:10:34 +0000 Subject: - Patch #279851 by catch, David Strauss, Damien Tournoud, asimmonds, c960657, JohnAlbin, drawk, pwolanin, robertDouglass, coltrane: replace LOWER() with db_select() and LIKE() where possible. --- includes/database/pgsql/database.inc | 1 + includes/database/query.inc | 1 + includes/database/sqlite/database.inc | 1 + 3 files changed, 3 insertions(+) (limited to 'includes') diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc index 841be2296..f76fd95ee 100644 --- a/includes/database/pgsql/database.inc +++ b/includes/database/pgsql/database.inc @@ -128,6 +128,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection { // statements, we need to use ILIKE instead. Use backslash for escaping // wildcard characters. 'LIKE' => array('operator' => 'ILIKE', 'postfix' => " ESCAPE '\\\\'"), + 'NOT LIKE' => array('operator' => 'NOT ILIKE', 'postfix' => " ESCAPE '\\\\'"), ); return isset($specials[$operator]) ? $specials[$operator] : NULL; diff --git a/includes/database/query.inc b/includes/database/query.inc index 0b03783f5..ff591f04c 100644 --- a/includes/database/query.inc +++ b/includes/database/query.inc @@ -1332,6 +1332,7 @@ class DatabaseCondition implements QueryConditionInterface, Countable { 'IS NOT NULL' => array('use_value' => FALSE), // Use backslash for escaping wildcard characters. 'LIKE' => array('postfix' => " ESCAPE '\\\\'"), + 'NOT LIKE' => array('postfix' => " ESCAPE '\\\\'"), // These ones are here for performance reasons. '=' => array(), '<' => array(), diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc index af20b10be..5889fafe7 100644 --- a/includes/database/sqlite/database.inc +++ b/includes/database/sqlite/database.inc @@ -157,6 +157,7 @@ class DatabaseConnection_sqlite extends DatabaseConnection { // We don't want to override any of the defaults. static $specials = array( 'LIKE' => array('postfix' => " ESCAPE '\\'"), + 'NOT LIKE' => array('postfix' => " ESCAPE '\\'"), ); return isset($specials[$operator]) ? $specials[$operator] : NULL; } -- cgit v1.2.3