(bug 13454) Article::updateCategoryCounts can attempt to execute empty inserts.
authorAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 20 Mar 2008 17:33:32 +0000 (17:33 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 20 Mar 2008 17:33:32 +0000 (17:33 +0000)
includes/Article.php

index 10ff075..4404625 100644 (file)
@@ -3367,6 +3367,10 @@ class Article {
                #
                # Sometimes I wish we had INSERT ... ON DUPLICATE KEY UPDATE.
                $insertCats = array_merge( $added, $deleted );
+               if( !$insertCats ) {
+                       # Okay, nothing to do
+                       return;
+               }
                $insertRows = array();
                foreach( $insertCats as $cat ) {
                        $insertRows[] = array( 'cat_title' => $cat );