From: Max Kanat-Alexander Date: Tue, 2 Nov 2010 23:39:57 +0000 (-0700) Subject: The changes to bz_create_database done by the SQLite patch broke the X-Git-Tag: bugzilla-4.1.1~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fbfafbbec8ada22dde6903d0e02f9d3876fa1c1;p=thirdparty%2Fbugzilla.git The changes to bz_create_database done by the SQLite patch broke the 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 --- diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index ae9fffd3a6..0a3123ee9d 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 = $dbh = connect_main(); + my $conn_success = eval { $dbh = connect_main() }; my $db_name = Bugzilla->localconfig->{db_name}; if (!$conn_success) { diff --git a/Bugzilla/DB/Schema/Sqlite.pm b/Bugzilla/DB/Schema/Sqlite.pm index 8f8af3803d..171f6217c8 100644 --- a/Bugzilla/DB/Schema/Sqlite.pm +++ b/Bugzilla/DB/Schema/Sqlite.pm @@ -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]);