]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 547428: SQL error when deleting a product and its related series when it has...
authorBodo-Merle Sandor <sbodomerle@gmail.com>
Sat, 20 Feb 2010 15:55:37 +0000 (16:55 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 20 Feb 2010 15:55:37 +0000 (16:55 +0100)
r/a=LpSolit

Bugzilla/Product.pm

index 975af7d5d6c290ad1b5fbf19c7bedeccbcd1da0b..46e91aa65c2bbe38c460910994f44b9cecf26681 100644 (file)
@@ -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 =