From: mkanat%bugzilla.org <> Date: Sat, 4 Nov 2006 07:12:01 +0000 (+0000) Subject: Bug 359234: missing indexes on the cc and profiles table cause upgrades to fail X-Git-Tag: bugzilla-2.22.2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=601d7b385dc7e741df1eb90b641bae24ceea4847;p=thirdparty%2Fbugzilla.git Bug 359234: missing indexes on the cc and profiles table cause upgrades to fail Patch By Noel Cragg r=mkanat, a=myk --- diff --git a/checksetup.pl b/checksetup.pl index 776d014389..21c37e4c74 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -35,6 +35,7 @@ # Lance Larsh # A. Karl Kornel # Marc Schumann +# Noel Cragg # # # @@ -2261,8 +2262,9 @@ if (!$dbh->bz_column_info('bugs', 'lastdiffed')) { # declared to be unique. Sure enough, somehow, I got 22 duplicated entries # in my database. This code detects that, cleans up the duplicates, and # then tweaks the table to declare the field to be unique. What a pain. -if (!$dbh->bz_index_info('profiles', 'profiles_login_name_idx') || - !$dbh->bz_index_info('profiles', 'profiles_login_name_idx')->{TYPE}) { +if (!$dbh->bz_index_info('profiles', 'profiles_login_name_idx') + || !$dbh->bz_index_info('profiles', 'profiles_login_name_idx')->{TYPE}) +{ print "Searching for duplicate entries in the profiles table ...\n"; while (1) { # This code is weird in that it loops around and keeps doing this @@ -2495,7 +2497,9 @@ if (!$dbh->bz_column_info('products', 'defaultmilestone')) { # prevents certain database inconsistencies, and, moreover, is required for # new generalized list code to work. -if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE}) { +if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx') + || !$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE}) +{ # XXX should eliminate duplicate entries before altering # @@ -2504,7 +2508,9 @@ if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE}) { {TYPE => 'UNIQUE', FIELDS => [qw(bug_id who)]}); } -if (!$dbh->bz_index_info('keywords', 'keywords_bug_id_idx')->{TYPE}) { +if (!$dbh->bz_index_info('keywords', 'keywords_bug_id_idx') + || !$dbh->bz_index_info('keywords', 'keywords_bug_id_idx')->{TYPE}) +{ # XXX should eliminate duplicate entries before altering #