From: mkanat%kerio.com <> Date: Tue, 13 Dec 2005 12:53:02 +0000 (+0000) Subject: Bug 310108: checksetup.pl fails if attachstatuses or attachstatusdefs tables are... X-Git-Tag: bugzilla-2.20.1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74f6c740534f1d66a7aff19caf8bffc7d5314543;p=thirdparty%2Fbugzilla.git Bug 310108: checksetup.pl fails if attachstatuses or attachstatusdefs tables are empty Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- diff --git a/checksetup.pl b/checksetup.pl index bf93a65894..fea6f4c71c 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -3189,10 +3189,9 @@ if ($dbh->bz_table_info("attachstatuses") print "Converting attachment statuses to flags...\n"; # Get IDs for the old attachment status and new flag fields. - $sth = $dbh->prepare("SELECT fieldid FROM fielddefs " . - "WHERE name='attachstatusdefs.name'"); - $sth->execute(); - my $old_field_id = $sth->fetchrow_arrayref()->[0] || 0; + my ($old_field_id) = $dbh->selectrow_array( + "SELECT fieldid FROM fielddefs WHERE name='attachstatusdefs.name'") + || 0; $sth = $dbh->prepare("SELECT fieldid FROM fielddefs " . "WHERE name='flagtypes.name'");