]> Sergey Matveev's repositories - public-inbox.git/commitdiff
overidx: fix compatibility with current versions
authorEric Wong <e@yhbt.net>
Sun, 26 Jul 2020 19:43:06 +0000 (19:43 +0000)
committerEric Wong <e@yhbt.net>
Sun, 26 Jul 2020 19:52:17 +0000 (19:52 +0000)
We still need to use SQL_BLOB to ensure existing versions of
public-inbox can read over.sqlite3 because they're still using
{sqlite_unicode}.  This partially reverts commit
e9fc1290ead44e06d20ff58e0a6acb5306d4fbe2.

Fixes: e9fc1290ead44e06 ("over: unset sqlite_unicode attribute")
lib/PublicInbox/OverIdx.pm

index fcb450794fc2c05bffab9a49a330b686d22f1913..5821c562b814de635862db755db1c7a42f9954e8 100644 (file)
@@ -12,7 +12,7 @@ use strict;
 use warnings;
 use base qw(PublicInbox::Over);
 use IO::Handle;
-use DBI;
+use DBI qw(:sql_types); # SQL_BLOB
 use PublicInbox::MID qw/id_compress mids_for_index references/;
 use PublicInbox::Smsg qw(subject_normalized);
 use Compress::Zlib qw(compress);
@@ -337,7 +337,7 @@ VALUES (?,?,?,?,?,?)
        my $n = 0;
        my @v = ($num, $tid, $sid, $ts, $ds);
        foreach (@v) { $sth->bind_param(++$n, $_) }
-       $sth->bind_param(++$n, $ddd);
+       $sth->bind_param(++$n, $ddd, SQL_BLOB);
        $sth->execute;
        $sth = $dbh->prepare_cached(<<'');
 INSERT INTO id2num (id, num) VALUES (?,?)