From 09df4b6fe6b6f589db00aef337d73c270e990bf0 Mon Sep 17 00:00:00 2001 From: Bodo-Merle Sandor Date: Sat, 20 Feb 2010 16:55:37 +0100 Subject: Bug 547428: SQL error when deleting a product and its related series when it has none r/a=LpSolit --- Bugzilla/Product.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Product.pm') diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 975af7d5d..46e91aa65 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -298,7 +298,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 = -- cgit v1.2.3-24-g4f1b