diff options
author | mkanat%kerio.com <> | 2005-04-20 06:44:03 +0000 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-04-20 06:44:03 +0000 |
commit | 993f0b3529d4c708fcbaa3fc8efcdeee9e1775d5 (patch) | |
tree | b05db095d5f2997818dab6db84b32d80890876ba /Bugzilla | |
parent | 57394ff026769d28ef6b5d077cb4655adf032936 (diff) | |
download | bugs-993f0b3529d4c708fcbaa3fc8efcdeee9e1775d5.tar bugs-993f0b3529d4c708fcbaa3fc8efcdeee9e1775d5.tar.gz bugs-993f0b3529d4c708fcbaa3fc8efcdeee9e1775d5.tar.bz2 bugs-993f0b3529d4c708fcbaa3fc8efcdeee9e1775d5.tar.xz bugs-993f0b3529d4c708fcbaa3fc8efcdeee9e1775d5.zip |
Bug 284599: Use of REGEXP search is not consistent wrt case sensitivity
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/DB.pm | 6 | ||||
-rw-r--r-- | Bugzilla/DB/Pg.pm | 4 | ||||
-rw-r--r-- | Bugzilla/Search.pm | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 7e45e56e4..f1747b39d 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -1199,7 +1199,8 @@ formatted SQL command have prefix C<sql_>. All other methods have prefix C<bz_>. =item C<sql_regexp> Description: Outputs SQL regular expression operator for POSIX regex - searches in format suitable for a given database. + searches (case insensitive) in format suitable for a given + database. Abstract method, should be overriden by database specific code. Params: none Returns: formatted SQL for regular expression search (e.g. REGEXP) @@ -1208,7 +1209,8 @@ formatted SQL command have prefix C<sql_>. All other methods have prefix C<bz_>. =item C<sql_not_regexp> Description: Outputs SQL regular expression operator for negative POSIX - regex searches in format suitable for a given database. + regex searches (case insensitive) in format suitable for a given + database. Abstract method, should be overriden by database specific code. Params: none Returns: formatted SQL for negative regular expression search diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index e635096f2..4fe8d2244 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -87,11 +87,11 @@ sub bz_last_key { } sub sql_regexp { - return "~"; + return "~*"; } sub sql_not_regexp { - return "!~" + return "!~*" } sub sql_limit { diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index bebbfd94a..b12d714f9 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -1000,10 +1000,10 @@ sub init { $term = $dbh->sql_position(lc($q), "LOWER($ff)") . " = 0"; }, ",regexp" => sub { - $term = "LOWER($ff) " . $dbh->sql_regexp() . " $q"; + $term = "$ff " . $dbh->sql_regexp() . " $q"; }, ",notregexp" => sub { - $term = "LOWER($ff) " . $dbh->sql_not_regexp() . " $q"; + $term = "$ff " . $dbh->sql_not_regexp() . " $q"; }, ",lessthan" => sub { $term = "$ff < $q"; @@ -1506,7 +1506,7 @@ sub GetByWordList { $word =~ s/^'//; $word =~ s/'$//; $word = '(^|[^a-z0-9])' . $word . '($|[^a-z0-9])'; - push(@list, "lower($field) " . $dbh->sql_regexp() . " '$word'"); + push(@list, "$field " . $dbh->sql_regexp() . " '$word'"); } } |