diff options
author | bugreport%peshkin.net <> | 2004-05-27 11:40:17 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-05-27 11:40:17 +0200 |
commit | 3a5de3cbf019668cc3963caa566feb1ee15b6e19 (patch) | |
tree | 822d974afbbc3e1092cb690faaa2a3a4cbfaec23 /Bugzilla/Search.pm | |
parent | c5718f3890535bb27a2db35c1f08b22b05e89ac4 (diff) | |
download | bugzilla-3a5de3cbf019668cc3963caa566feb1ee15b6e19.tar.gz bugzilla-3a5de3cbf019668cc3963caa566feb1ee15b6e19.tar.xz |
Bug 243351: Fix mysql version sensitivity in case-sensitive search
r=jouni
a=justdave
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r-- | Bugzilla/Search.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 241439cf5..5f0e625aa 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -711,7 +711,15 @@ sub init { $term = "$ff != $q"; }, ",casesubstring" => sub { - $term = "INSTR(CAST($ff AS BINARY), CAST($q AS BINARY))"; + # mysql 4.0.1 and lower do not support CAST + # mysql 3.*.* had a case-sensitive INSTR + # (checksetup has a check for unsupported versions) + my $server_version = Bugzilla::DB->server_version; + if ($server_version =~ /^3\./) { + $term = "INSTR($ff ,$q)"; + } else { + $term = "INSTR(CAST($ff AS BINARY), CAST($q AS BINARY))"; + } }, ",substring" => sub { $term = "INSTR(LOWER($ff), " . lc($q) . ")"; |