]> 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:57:32 +0000 (16:57 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 20 Feb 2010 15:57:32 +0000 (16:57 +0100)
r/a=LpSolit

Bugzilla/Product.pm

index c993905db9508557723fb1c018f2ca67e7182e4d..359a574417101180794301cb1ac4cbc90612ee9d 100644 (file)
@@ -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 =