]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Msgmap.pm
Merge remote-tracking branch 'origin/nntp-tls'
[public-inbox.git] / lib / PublicInbox / Msgmap.pm
index d474badef16b06a9bf74b63f80224860598d406c..5a89b85a51e297660291f0c4e5477bd2865608da 100644 (file)
@@ -126,11 +126,11 @@ sub mid_insert {
        my ($self, $mid) = @_;
        my $dbh = $self->{dbh};
        my $sth = $dbh->prepare_cached(<<'');
-INSERT OR IGNORE INTO msgmap (mid) VALUES (?)
+INSERT INTO msgmap (mid) VALUES (?)
 
-       return if $sth->execute($mid) == 0;
+       return unless eval { $sth->execute($mid) };
        my $num = $dbh->last_insert_id(undef, undef, 'msgmap', 'num');
-       $self->num_highwater($num) unless !defined($num);
+       $self->num_highwater($num) if defined($num);
        $num;
 }