]> Sergey Matveev's repositories - public-inbox.git/commit
sharedkv: avoid ambiguity for numeric-like string keys
authorEric Wong <e@80x24.org>
Mon, 14 Feb 2022 05:37:25 +0000 (05:37 +0000)
committerEric Wong <e@80x24.org>
Mon, 14 Feb 2022 18:43:16 +0000 (18:43 +0000)
commit2231c8b183be0be5d8a9738a3e417b5c3a09c7c7
tree4589decb5859338bd731e7f647d69252db46a06f
parent80690e594710f2fb89d306f1f5faf4a57aea79c8
sharedkv: avoid ambiguity for numeric-like string keys

While we only store URLs and binary SHA-1/SHA-256 values in skv
at the moment, we may store potentially ambiguous keys/values in
the future.  It's possible to store "02" and have it treated as
`2' unless explicitly binding parameters as SQL_BLOB.  This
behavior was independent of the sqlite_unicode parameter as
evidenced by the new tests.

I only noticed this bug while hacking on another project using
DBD::SQLite, and not while hacking on public-inbox itself.
lib/PublicInbox/SharedKV.pm
t/shared_kv.t