From b0f72207f383ec55a6d11d7193dc930deecc3639 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 24 Oct 2018 12:58:21 +1300 Subject: [PATCH] Remove use of LOWER from mailing_name searches This is already covered by the tess in CRM_Mailing_BAO_QueryTest::testSearch The main risk with these things is removing php strtolower & not mysql LOWER (the reverse still works). Here they are close together --- CRM/Mailing/BAO/Query.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index d556dd9fd1..5adc1376e9 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -237,9 +237,6 @@ class CRM_Mailing_BAO_Query { public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; - $fields = array(); - $fields = self::getFields(); - switch ($name) { case 'mailing_id': $selectedMailings = array_flip($value); @@ -259,14 +256,13 @@ class CRM_Mailing_BAO_Query { return; case 'mailing_name': - $value = strtolower(addslashes($value)); + $value = addslashes($value); if ($wildcard) { $value = "%$value%"; $op = 'LIKE'; } - // LOWER in query below roughly translates to 'hurt my database without deriving any benefit' See CRM-19811. - $query->_where[$grouping][] = "LOWER(civicrm_mailing.name) $op '$value'"; + $query->_where[$grouping][] = "civicrm_mailing.name $op '$value'"; $query->_qill[$grouping][] = "Mailing Namename $op \"$value\""; $query->_tables['civicrm_mailing'] = $query->_whereTables['civicrm_mailing'] = 1; $query->_tables['civicrm_mailing_recipients'] = $query->_whereTables['civicrm_mailing_recipients'] = 1; -- 2.25.1