]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 264003: Include the DBI error in the error message if 'createdb' fails...
authorjocuri%softhome.net <>
Wed, 20 Oct 2004 03:33:58 +0000 (03:33 +0000)
committerjocuri%softhome.net <>
Wed, 20 Oct 2004 03:33:58 +0000 (03:33 +0000)
checksetup.pl

index 30167f1975f165d8ecc847297c3c09583d7c945e..28140058f4b43a878b4734179a4afc8db0bd860d 100755 (executable)
@@ -1451,10 +1451,15 @@ if ($my_db_check) {
     my @databases = $dbh->func('_ListDBs');
     unless (grep /^$my_db_name$/, @databases) {
        print "Creating database $my_db_name ...\n";
-       $dbh->func('createdb', $my_db_name, 'admin')
-            or die <<"EOF"
+       if (!$dbh->func('createdb', $my_db_name, 'admin')) {
+            my $error = $dbh->errstr;
+            die <<"EOF"
 
-The '$my_db_name' database is not accessible. This might have several reasons:
+The '$my_db_name' database could not be created.  The error returned was:
+
+$error
+
+This might have several reasons:
 
 * MySQL is not running.
 * MySQL is running, but the rights are not set correct. Go and read the
@@ -1464,6 +1469,7 @@ The '$my_db_name' database is not accessible. This might have several reasons:
   sure all settings in '$localconfig' are correct. If all else fails, set
   '\$db_check' to zero.\n
 EOF
+        }
     }
     $dbh->disconnect if $dbh;
 }