summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-12-25 22:27:25 +0100
committermkanat%kerio.com <>2005-12-25 22:27:25 +0100
commitc6016ff697d0a9cd821b4bfaaf743b98c2677f90 (patch)
treee63e98927ef940ce19f749c7fed9e074b0c98b7e
parent48500e5b81925ec89af420fa9ab5c9b2d365dda0 (diff)
downloadbugzilla-c6016ff697d0a9cd821b4bfaaf743b98c2677f90.tar.gz
bugzilla-c6016ff697d0a9cd821b4bfaaf743b98c2677f90.tar.xz
Bug 307662: checksetup.pl fails at some line (Unknown column 'grant_type' or similar error) when upgrading from 2.18 or below to 2.20
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=justdave
-rw-r--r--Bugzilla/DB/Mysql.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index c006e5fd0..e2e0e840f 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -298,6 +298,27 @@ sub bz_setup_database {
($self->bz_index_info_real('bugs', 'assigned_to') ||
$self->bz_index_info_real('flags', 'flags_bidattid_idx')) )
{
+
+ # This is a check unrelated to the indexes, to see if people are
+ # upgrading from 2.18 or below, but somehow have a bz_schema table
+ # already. This only happens if they have done a mysqldump into
+ # a database without doing a DROP DATABASE first.
+ # We just do the check here since this check is a reliable way
+ # of telling that we are upgrading from a version pre-2.20.
+ if (grep($_ eq 'bz_schema', $self->bz_table_list_real())) {
+ die("\nYou are upgrading from a version before 2.20, but the"
+ . " bz_schema\ntable already exists. This means that you"
+ . " restored a mysqldump into\nthe Bugzilla database without"
+ . " first dropping the already-existing\nBugzilla database,"
+ . " at some point. Whenever you restore a Bugzilla\ndatabase"
+ . " backup, you must always drop the entire database first.\n\n"
+ . "Please drop your Bugzilla database and restore it from a"
+ . " backup that\ndoes not contain the bz_schema table. If for"
+ . " some reason you cannot\ndo this, you can connect to your"
+ . " MySQL database and drop the bz_schema\ntable, as a last"
+ . " resort.\n");
+ }
+
my $bug_count = $self->selectrow_array("SELECT COUNT(*) FROM bugs");
# We estimate one minute for each 3000 bugs, plus 3 minutes just
# to handle basic MySQL stuff.