From c205bb8d15364f643eaefd9b60ac2f6a459bc38c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 6 Mar 2009 18:09:55 +0300 Subject: [PATCH] ccache_update: protect insert with transaction block --- functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions.php b/functions.php index d5c231b8..d59d5aa1 100644 --- a/functions.php +++ b/functions.php @@ -5861,6 +5861,8 @@ $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid); } + db_query($link, "BEGIN"); + $result = db_query($link, "SELECT feed_id FROM $table WHERE owner_uid = '$owner_uid' AND feed_id = '$feed_id' LIMIT 1"); @@ -5876,6 +5878,8 @@ ($feed_id, $unread, $owner_uid, NOW())"); } + db_query($link, "COMMIT"); + if ($feed_id > 0 && $prev_unread != $unread) { if (!$is_cat) { -- 2.39.5