summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-27 09:56:15 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-27 09:56:15 +0200
commitdf0f3430e1592503dd0ca6a8dd4f2da1da67eb5c (patch)
tree630556e022313ab770aa883db7fef9fd5ff2d3ec /Bugzilla/DB.pm
parent3cefbefe84dca3ae78449aefc80c1b90eaf22395 (diff)
downloadbugzilla-df0f3430e1592503dd0ca6a8dd4f2da1da67eb5c.tar.gz
bugzilla-df0f3430e1592503dd0ca6a8dd4f2da1da67eb5c.tar.xz
Bug 337776: Basic SQLite Support for Bugzilla
r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 97099b54c..ae9fffd3a 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -232,7 +232,7 @@ EOT
sub bz_create_database {
my $dbh;
# See if we can connect to the actual Bugzilla database.
- my $conn_success = eval { $dbh = connect_main(); };
+ my $conn_success = $dbh = connect_main();
my $db_name = Bugzilla->localconfig->{db_name};
if (!$conn_success) {
@@ -767,10 +767,11 @@ sub bz_add_table {
# initial table creation, because column names have changed
# over history and it's impossible to keep track of that info
# in ABSTRACT_SCHEMA.
- if (exists $fields{$col}->{REFERENCES}) {
- $fields{$col}->{REFERENCES}->{created} = 0;
- }
+ next unless exists $fields{$col}->{REFERENCES};
+ $fields{$col}->{REFERENCES}->{created} =
+ $self->_bz_real_schema->FK_ON_CREATE;
}
+
$self->_bz_real_schema->add_table($name, $table_def);
$self->_bz_store_real_schema;
}
@@ -1179,7 +1180,10 @@ sub bz_start_transaction {
# what we need in Bugzilla to be safe, for what we do.
# Different DBs have different defaults for their isolation
# level, so we just set it here manually.
- $self->do('SET TRANSACTION ISOLATION LEVEL ' . $self->ISOLATION_LEVEL);
+ if ($self->ISOLATION_LEVEL) {
+ $self->do('SET TRANSACTION ISOLATION LEVEL '
+ . $self->ISOLATION_LEVEL);
+ }
$self->{private_bz_transaction_count} = 1;
}
}