summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-05 16:36:07 +0100
committermkanat%kerio.com <>2005-03-05 16:36:07 +0100
commit0c1b77e123dbafb96168fe6affd6373b9aa081fe (patch)
tree9f4bf1de4a3b85d423238ed47a56746d70181e24 /Bugzilla/DB.pm
parent8b47184604eb5868736e0a2a8ae894f6feceaa95 (diff)
downloadbugzilla-0c1b77e123dbafb96168fe6affd6373b9aa081fe.tar.gz
bugzilla-0c1b77e123dbafb96168fe6affd6373b9aa081fe.tar.xz
Bug 284598: INSTR function is not supported by postgres
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index db6c0b405..2634a7994 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -201,6 +201,12 @@ sub import {
$Exporter::ExportLevel-- if $is_exporter;
}
+sub sql_position {
+ my ($self, $fragment, $text) = @_;
+
+ return "POSITION($fragment IN $text)";
+}
+
# XXX - Needs to be documented.
sub bz_server_version {
my ($self) = @_;
@@ -674,6 +680,16 @@ formatted SQL command have prefix C<sql_>. All other methods have prefix C<bz_>.
(scalar)
Returns: formatted SQL for interval function (scalar)
+=item C<sql_position>
+
+ Description: Outputs proper SQL syntax determinig 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'").
+ Params: $fragment = the string fragment we are searching for (scalar)
+ $text = the text to search (scalar)
+ Returns: formatted SQL for substring search (scalar)
+
=item C<bz_lock_tables>
Description: Performs a table lock operation on specified tables.