]> Sergey Matveev's repositories - public-inbox.git/commitdiff
pop3: quiet warning for cached active statements
authorEric Wong <e@80x24.org>
Fri, 12 Aug 2022 09:14:48 +0000 (09:14 +0000)
committerEric Wong <e@80x24.org>
Fri, 12 Aug 2022 17:10:07 +0000 (17:10 +0000)
Setting the $if_active parameter of ->prepare_cached to `1'
seemed to be the best option many years ago, so it's probably
the best option going forward when caching prepared statements.

Fixes: cab36ebd00ca72f8 ("pop3: remove untouched rows on QUIT/disconnect")
lib/PublicInbox/POP3.pm

index 82df257c2d7002d910ef3d35753512672cacac32..bd7dfc6583890901974febd0ed36d536e3403e4c 100644 (file)
@@ -303,7 +303,7 @@ sub __cleanup_state {
        $self->{pop3d}->{-state_dbh}->prepare_cached(<<'')->execute($txn_id);
 DELETE FROM deletes WHERE txn_id = ? AND uid_dele = -1
 
-       my $sth = $self->{pop3d}->{-state_dbh}->prepare_cached(<<'');
+       my $sth = $self->{pop3d}->{-state_dbh}->prepare_cached(<<'', undef, 1);
 SELECT COUNT(*) FROM deletes WHERE user_id = ?
 
        $sth->execute($user_id);