summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-26 04:46:38 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-26 04:46:38 +0000
commitc1ce884e4bb1b7cdc7b6ca26a2ad3e8366b6d167 (patch)
tree2669ca2ef63e9bd1ac5994188e11e7a5b499c776 /includes
parent7536a354141c48c19109e511acf628c799e168b5 (diff)
downloadbrdo-c1ce884e4bb1b7cdc7b6ca26a2ad3e8366b6d167.tar.gz
brdo-c1ce884e4bb1b7cdc7b6ca26a2ad3e8366b6d167.tar.bz2
#612392 by chx and Crell: Allow lowercase comparison operators in DBTNG.
Diffstat (limited to 'includes')
-rw-r--r--includes/database/query.inc18
1 files changed, 16 insertions, 2 deletions
diff --git a/includes/database/query.inc b/includes/database/query.inc
index 98723496d..993275749 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -1321,12 +1321,26 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
'BETWEEN' => array('delimiter' => ' AND '),
'IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),
'NOT IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'),
- 'LIKE' => array('operator' => 'LIKE'),
'IS NULL' => array('use_value' => FALSE),
'IS NOT NULL' => array('use_value' => FALSE),
+ // These ones are here for performance reasons.
+ '=' => array(),
+ '<' => array(),
+ '>' => array(),
+ '>=' => array(),
+ '<=' => array(),
+ 'LIKE' => array(),
);
+ if (isset($specials[$operator])) {
+ $return = $specials[$operator];
+ }
+ else {
+ // We need to upper case because PHP index matches are case sensitive but
+ // do not need the more expensive drupal_strtoupper because SQL statements are ASCII.
+ $operator = strtoupper($operator);
+ $return = isset($specials[$operator]) ? $specials[$operator] : array();
+ }
- $return = isset($specials[$operator]) ? $specials[$operator] : array();
$return += array('operator' => $operator);
return $return;