From: Andrew Dolgov Date: Fri, 6 Mar 2009 15:09:55 +0000 (+0300) Subject: ccache_update: protect insert with transaction block X-Git-Tag: 1.3.2~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c205bb8d15364f643eaefd9b60ac2f6a459bc38c;p=tt-rss.git ccache_update: protect insert with transaction block --- 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) {