]> Sergey Matveev's repositories - public-inbox.git/commit
msgmap: mid_insert: use plain "INSERT" to detect duplicates
authorEric Wong <e@80x24.org>
Mon, 24 Jun 2019 23:29:37 +0000 (23:29 +0000)
committerEric Wong <e@80x24.org>
Mon, 24 Jun 2019 23:45:01 +0000 (23:45 +0000)
commit2752bc2b24d1e2c96c18b5f18372fc25e0ffc1fa
treec02e1d2e1ffc203d7a92ad94c3da9eb20e9d0e89
parentf4f0a3be0864721d90f9557ffe1c513b0289a74b
msgmap: mid_insert: use plain "INSERT" to detect duplicates

"INSERT OR IGNORE" still bumps the auto-increment counter in
SQLite, which causes gaps to appear in NNTP article numbering.

This bug appeared in v2 repos where V2Writable may call ->add
repeatedly on the same message.  This bug is apparent with
public-inbox-watch and work-in-progress IMAP watchers which may
rescan and (attempt to) reinsert the same message on mailbox
changes.

Most uses of public-inbox-mda were not affected, unless the
same message is actually delivered multiple times to the mda.
v1 is not affected, either, since deduplication is only based
on Message-ID and msgmap never sees the duplicate.

Reported-by: "Eric W. Biederman" <ebiederm@xmission.com>
lib/PublicInbox/Msgmap.pm
t/msgmap.t
t/v2writable.t