From 5b8efa96d4d08631ceda9ef2a1c82f4660b09803 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 20 Mar 2008 17:33:32 +0000 Subject: [PATCH] (bug 13454) Article::updateCategoryCounts can attempt to execute empty inserts. --- includes/Article.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Article.php b/includes/Article.php index 10ff07574a..4404625ba2 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 ); -- 2.20.1