From a094f0ebf0294b8f964fc3d93e4d60044af8353e Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Wed, 31 Aug 2005 15:00:23 +0000 Subject: Bug 305976: Allow Bugzilla::DB sql_regexp/sql_not_regexp methods to accept string and pattern as arguments Patch By Lance Larsh r=joel, a=justdave --- Bugzilla/DB/Mysql.pm | 9 +++++++-- Bugzilla/DB/Pg.pm | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'Bugzilla/DB') diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 0951cdc5f..c3824ab9a 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -23,6 +23,7 @@ # Dave Lawrence # Tomas Kopal # Max Kanat-Alexander +# Lance Larsh =head1 NAME @@ -83,11 +84,15 @@ sub bz_last_key { } sub sql_regexp { - return "REGEXP"; + my ($self, $expr, $pattern) = @_; + + return "$expr REGEXP $pattern"; } sub sql_not_regexp { - return "NOT REGEXP"; + my ($self, $expr, $pattern) = @_; + + return "$expr NOT REGEXP $pattern"; } sub sql_limit { diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index c8ff4221b..f0c18b728 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -23,6 +23,7 @@ # Dave Lawrence # Tomas Kopal # Max Kanat-Alexander +# Lance Larsh =head1 NAME @@ -89,11 +90,15 @@ sub bz_last_key { } sub sql_regexp { - return "~*"; + my ($self, $expr, $pattern) = @_; + + return "$expr ~* $pattern"; } sub sql_not_regexp { - return "!~*" + my ($self, $expr, $pattern) = @_; + + return "$expr !~* $pattern" } sub sql_limit { -- cgit v1.2.3-24-g4f1b