summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-06-30 04:23:10 +0200
committermkanat%bugzilla.org <>2008-06-30 04:23:10 +0200
commit0a566f92417aa741828413b00585f48f72b5c639 (patch)
tree3bcb312d5c86eb695ecc9e6c3a4a6106fd3cc8a9 /Bugzilla/DB.pm
parentba0b55cebea4cf2dd2085547e38e8f540f10c03b (diff)
downloadbugzilla-0a566f92417aa741828413b00585f48f72b5c639.tar.gz
bugzilla-0a566f92417aa741828413b00585f48f72b5c639.tar.xz
Bug 327344: Create sql_iposition and use it in Search.pm to fix the fact that searching for Turkish characters didn't do case-insensitivity properly.
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 9d4f41546..07b2c5fe9 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -313,6 +313,13 @@ sub sql_istring {
return "LOWER($string)";
}
+sub sql_iposition {
+ my ($self, $fragment, $text) = @_;
+ $fragment = $self->sql_istring($fragment);
+ $text = $self->sql_istring($text);
+ return $self->sql_position($fragment, $text);
+}
+
sub sql_position {
my ($self, $fragment, $text) = @_;
@@ -1699,10 +1706,13 @@ Formatted SQL for interval function (scalar)
=item B<Description>
-Outputs proper SQL syntax determinig position of a substring
+Outputs proper SQL syntax determining position of a substring
(fragment) withing a string (text). Note: if the substring or
text are string constants, they must be properly quoted (e.g. "'pattern'").
+It searches for the string in a case-sensitive manner. If you want to do
+a case-insensitive search, use L</sql_iposition>.
+
=item B<Params>
=over
@@ -1719,6 +1729,10 @@ Formatted SQL for substring search (scalar)
=back
+=item C<sql_iposition>
+
+Just like L</sql_position>, but case-insensitive.
+
=item C<sql_group_by>
=over