From cc1fd0263a8cfed6ae7acb488956f6063dc62d63 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 28 Oct 2005 06:26:16 +0000 Subject: [PATCH] * MySQL 5.0 strict mode fix for moving unwatched pages It was doing an empty REPLACE, which apparently is unpopular. --- RELEASE-NOTES | 1 + includes/WatchedItem.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9ce790bd20..e132b2f48f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -180,6 +180,7 @@ fully support the editing toolbar, but was found to be too confusing. * Fail gracefully on invalid namespace in Special:Newpages * (bug 3806) Gracefully fall back to client-side scaling on |thumb| image that passes $wgMaxImageArea +* MySQL 5.0 strict mode fix for moving unwatched pages === Caveats === diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index fbbc366b10..2b01a31bf9 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -160,6 +160,11 @@ class WatchedItem { ); } $dbw->freeResult( $res ); + + if( empty( $values ) ) { + // Nothing to do + return true; + } # Perform replace # Note that multi-row replace is very efficient for MySQL but may be inefficient for -- 2.20.1