]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Msgmap.pm
searchidx: regenerate and avoid article number gaps on full index
[public-inbox.git] / lib / PublicInbox / Msgmap.pm
index feef8ba79ab9a657d8135b0c65ca0186dd7bed51..3237a5ed6ae0d8caa5a56bd1a17e380efc61a0b8 100644 (file)
@@ -108,10 +108,10 @@ sub created_at {
 sub mid_insert {
        my ($self, $mid) = @_;
        my $dbh = $self->{dbh};
-       my $sql = 'INSERT OR IGNORE INTO msgmap (mid) VALUES (?)';
-       my $sth = $self->{mid_insert} ||= $dbh->prepare($sql);
-       $sth->bind_param(1, $mid);
-       return if $sth->execute == 0;
+       my $sth = $dbh->prepare_cached(<<'');
+INSERT OR IGNORE INTO msgmap (mid) VALUES (?)
+
+       return if $sth->execute($mid) == 0;
        $dbh->last_insert_id(undef, undef, 'msgmap', 'num');
 }