Bug 310108: checksetup.pl fails if attachstatuses or attachstatusdefs tables are empty

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave


git-svn-id: svn://10.0.0.236/trunk@185985 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%kerio.com 2005-12-13 04:53:02 +00:00
parent 383f14ce23
commit ed57700376

View File

@ -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'");