So I'm messing with public-inbox a bit.  I had to make the following
change before things would work on my Fedora system.  (This is with

The symptom was errors out of SQLite; it wouldn't pass "make test" much
less work properly.  Some digging turns up this:

        If SQLite is built with the SQLITE_ENABLE_UPDATE_DELETE_LIMIT
        compile-time option then the syntax of the UPDATE statement is
        extended with optional ORDER BY and LIMIT clauses as follows

Evidently, Fedora does not enable that option.

Now, I assume that LIMIT is there for a reason; I've not even tried to
look at the schema that public-inbox uses yet.  But I thought I would toss
this out there to see you thought.  Perhaps what I really need to do is to
ask Fedora to turn that option on?



From f0d6f3771013fadbeb8432533d51545696309ffb Mon Sep 17 00:00:00 2001
From: Jonathan Corbet <>
Date: Thu, 22 Feb 2018 23:05:46 +0000
Subject: [PATCH] Don't use LIMIT in UPDATE statements

...not all distributions build SQLite with that enabled.
 lib/PublicInbox/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/ b/lib/PublicInbox/
index a147b9f..6b6d1c6 100644
--- a/lib/PublicInbox/
+++ b/lib/PublicInbox/
@@ -57,7 +57,7 @@ sub meta_accessor {
        $prev = $dbh->selectrow_array($sql, undef, $key);
        if (defined $prev) {
-               $sql = 'UPDATE meta SET val = ? WHERE key = ? LIMIT 1';
+               $sql = 'UPDATE meta SET val = ? WHERE key = ?';
                $dbh->do($sql, undef, $value, $key);
        } else {
                $sql = 'INSERT INTO meta (key,val) VALUES (?,?)';


Reply via email to