Skip to content

Commit 476a032

Browse files
Make partial text match filters case-insensitive (#2893)
Some users previously used MySQL's case-insensitivity to deliberately create case-insensitive filters for build and test names. While it's not practical to implement case-insensitivity for very selective filters while retaining their current performance, there is no real difference in performance for filters which are not selective enough to make use of indexes. This PR changes all of the "LIKE"-based filters to use "ILIKE" instead. Note that this will make the "starts with" filter less performant, in exchange for maintaining consistency with the other LIKE-based filters.
1 parent 855a0ed commit 476a032

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/cdash/include/filterdataFunctions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -886,28 +886,28 @@ function get_sql_compare_and_value($compare, $value)
886886

887887
case 63:
888888
// string contains
889-
$sql_compare = 'LIKE';
889+
$sql_compare = 'ILIKE';
890890
$sql_value = "'%$value%'";
891891

892892
break;
893893

894894
case 64:
895895
// string does not contain
896-
$sql_compare = 'NOT LIKE';
896+
$sql_compare = 'NOT ILIKE';
897897
$sql_value = "'%$value%'";
898898

899899
break;
900900

901901
case 65:
902902
// string starts with
903-
$sql_compare = 'LIKE';
903+
$sql_compare = 'ILIKE';
904904
$sql_value = "'$value%'";
905905

906906
break;
907907

908908
case 66:
909909
// string ends with
910-
$sql_compare = 'LIKE';
910+
$sql_compare = 'ILIKE';
911911
$sql_value = "'%$value'";
912912

913913
break;

0 commit comments

Comments
 (0)