]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
The changes to bz_create_database done by the SQLite patch broke the
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 2 Nov 2010 23:39:57 +0000 (16:39 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 2 Nov 2010 23:39:57 +0000 (16:39 -0700)
creation of databases on other systems. This restores the original
behavior while still retaining the correct error-throwing behavior
for systems that can't create a SQLite database.

https://bugzilla.mozilla.org/show_bug.cgi?id=337776

Bugzilla/DB.pm
Bugzilla/DB/Schema/Sqlite.pm

index ae9fffd3a6df7b09bd4bb2f371b3690c72ff429e..0a3123ee9d2703c4da527f0de79df54315adcbff 100644 (file)
@@ -232,7 +232,7 @@ EOT
 sub bz_create_database {
     my $dbh;
     # See if we can connect to the actual Bugzilla database.
-    my $conn_success = $dbh = connect_main();
+    my $conn_success = eval { $dbh = connect_main() };
     my $db_name = Bugzilla->localconfig->{db_name};
 
     if (!$conn_success) {
index 8f8af3803dc3eae847d6a2ee7543f1efbba96417..171f6217c88fb6a976f2314f3c6ed07a88ded51a 100644 (file)
@@ -64,6 +64,15 @@ sub _initialize {
 
 }
 
+sub get_create_database_sql {
+    # If we get here, it means there was some error creating the
+    # database file during bz_create_database in Bugzilla::DB,
+    # and we just want to display that error instead of doing
+    # anything else.
+    Bugzilla->dbh;
+    die "Reached an unreachable point";
+}
+
 sub get_type_ddl {
     my $self = shift;
     my $def = dclone($_[0]);