summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Oracle.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/DB/Oracle.pm')
-rw-r--r--Bugzilla/DB/Oracle.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 1387a45cb..19ebbb2c5 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -94,6 +94,16 @@ sub bz_last_key {
return $last_insert_id;
}
+sub bz_check_regexp {
+ my ($self, $pattern) = @_;
+
+ eval { $self->do("SELECT 1 FROM DUAL WHERE "
+ . $self->sql_regexp($self->quote("a"), $self->quote($pattern), 1)) };
+
+ $@ && ThrowUserError('illegal_regexp',
+ { value => $pattern, dberror => $self->errstr });
+}
+
sub sql_regexp {
my ($self, $expr, $pattern, $nocheck) = @_;