From ae887eab29d3f2a665e6b188d3cb834825daa57c Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Tue, 13 Dec 2005 12:50:45 +0000 Subject: Bug 310108: checksetup.pl fails if attachstatuses or attachstatusdefs tables are empty Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- checksetup.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'checksetup.pl') diff --git a/checksetup.pl b/checksetup.pl index 7f207faf4..e21600ebf 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -3210,10 +3210,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'"); -- cgit v1.2.1