From: Bodo-Merle Sandor Date: Sat, 20 Feb 2010 15:57:32 +0000 (+0100) Subject: Bug 547428: SQL error when deleting a product and its related series when it has... X-Git-Tag: bugzilla-3.6rc1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73ac7dc3a34ae3e342a37ab16f4b3bf521a74d55;p=thirdparty%2Fbugzilla.git Bug 547428: SQL error when deleting a product and its related series when it has none r/a=LpSolit --- diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index c993905db9..359a574417 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -411,7 +411,9 @@ sub remove_from_db { WHERE series_categories.name = ?', undef, $self->name); - $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids)); + if (scalar @$series_ids) { + $dbh->do('DELETE FROM series WHERE ' . $dbh->sql_in('series_id', $series_ids)); + } # If no subcategory uses this product name, completely purge it. my $in_use =