about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm
index 2f64d90c..f2857908 100644
--- a/lib/PublicInbox/Msgmap.pm
+++ b/lib/PublicInbox/Msgmap.pm
@@ -84,10 +84,10 @@ sub mid_insert {
         $dbh->last_insert_id(undef, undef, 'msgmap', 'num');
 }
 
-use constant MID_FOR => 'SELECT mid FROM msgmap WHERE num = ? LIMIT 1';
 sub mid_for {
         my ($self, $num) = @_;
         my $dbh = $self->{dbh};
+        use constant MID_FOR => 'SELECT mid FROM msgmap WHERE num = ? LIMIT 1';
         my $sth = $self->{mid_for} ||= $dbh->prepare(MID_FOR);
         $sth->bind_param(1, $num);
         $sth->execute;