aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/DB/Oracle.pm8
-rw-r--r--Bugzilla/User/Setting.pm5
2 files changed, 9 insertions, 4 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 008f4be70..509dedaa1 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -421,8 +421,14 @@ sub bz_setup_database {
$self->do("CREATE OR REPLACE FUNCTION NOW "
. " RETURN DATE IS BEGIN RETURN SYSDATE; END;");
# Create a WORLD_LEXER named BZ_LEX for multilingual fulltext search
- $self->do("BEGIN CTX_DDL.CREATE_PREFERENCE
+ my $lexer = $self->selectcol_arrayref(
+ "SELECT pre_name FROM CTXSYS.CTX_PREFERENCES WHERE pre_name = ? AND
+ pre_owner = ?",
+ undef,'BZ_LEX',uc(Bugzilla->localconfig->{db_user}));
+ if(!@$lexer) {
+ $self->do("BEGIN CTX_DDL.CREATE_PREFERENCE
('BZ_LEX', 'WORLD_LEXER'); END;");
+ }
$self->SUPER::bz_setup_database(@_);
}
diff --git a/Bugzilla/User/Setting.pm b/Bugzilla/User/Setting.pm
index 6387883c6..f13bfe972 100644
--- a/Bugzilla/User/Setting.pm
+++ b/Bugzilla/User/Setting.pm
@@ -233,9 +233,8 @@ sub set_default {
sub _setting_exists {
my ($setting_name) = @_;
my $dbh = Bugzilla->dbh;
- my $sth = $dbh->prepare("SELECT name FROM setting WHERE name = ?");
- $sth->execute($setting_name);
- return ($sth->rows) ? 1 : 0;
+ return $dbh->selectrow_arrayref(
+ "SELECT 1 FROM setting WHERE name = ?", undef, $setting_name) || 0;
}