From 128f205324ec70a375eb92532f2a80621bff7461 Mon Sep 17 00:00:00 2001 From: Glen Sawyer Date: Tue, 30 May 2023 14:56:25 -0600 Subject: [PATCH] [plugin] Statistics: fix sync caused by semicolon in SQL comment (#10503) Follow-up to . --- plugins/statistics.koplugin/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index c8db6b535..c53daa1ca 100644 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -3050,11 +3050,11 @@ function ReaderStatistics.onSync(local_path, cached_path, income_path) return false end + -- NOTE: We could replace this first `UPDATE` with an "upsert" by adding an `ON CONFLICT` clause to the + -- following `INSERT`, but using `ON CONFLICT` unnecessarily increments the autoincrement for the table. + -- See https://sqlite.org/forum/info/98d4fb9ced866287 sql = sql .. [[ - -- If book was opened more recently on another device, then update local db's `last_open` field - -- NOTE: We could do this as an "upsert" by adding an `ON CONFLICT` clause to the following `INSERT` - -- but using `ON CONFLICT` unnecessarily increments the autoincrement for the table; - -- see https://sqlite.org/forum/info/98d4fb9ced866287 + -- If book was opened more recently on another device, then update local last_open field UPDATE book AS b SET last_open = i.last_open FROM income_db.book AS i