]> Sergey Matveev's repositories - public-inbox.git/commitdiff
Don't use LIMIT in UPDATE statements
authorJonathan Corbet <corbet@pi.lwn.net>
Thu, 22 Feb 2018 23:05:46 +0000 (23:05 +0000)
committerEric Wong <e@80x24.org>
Thu, 22 Feb 2018 23:38:26 +0000 (23:38 +0000)
...not all distributions build SQLite with that enabled.

[ew: LIMIT shouldn't be necessary because `key' is primary]

lib/PublicInbox/Msgmap.pm

index a147b9f346d6ace41c580735b91825270225e271..6b6d1c6ee6086b8fd61ce4a04a45ab5b5619f961 100644 (file)
@@ -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 (?,?)';