summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
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.