]> Sergey Matveev's repositories - public-inbox.git/commitdiff
overidx: eidx_prep: fix leftover dbh reference
authorEric Wong <e@80x24.org>
Wed, 20 Jan 2021 05:04:45 +0000 (14:04 +0900)
committerEric Wong <e@80x24.org>
Thu, 21 Jan 2021 03:29:17 +0000 (03:29 +0000)
Leaving $dbh in another field was causing over.sqlite3 to
remain open after ->dbh_close.  Fix up some minor style
issues while we're at it.

lib/PublicInbox/OverIdx.pm

index 0a4eb39e0a9d112260eb417c035846c5bac5e7e4..e606dcf564bfb8e59bf517558002a8b005579769 100644 (file)
@@ -537,7 +537,7 @@ sub eidx_prep ($) {
        my ($self) = @_;
        $self->{-eidx_prep} //= do {
                my $dbh = $self->dbh;
-               $dbh->do(<<"");
+               $dbh->do(<<'');
 INSERT OR IGNORE INTO counter (key) VALUES ('eidx_docid')
 
                $dbh->do(<<'');
@@ -574,11 +574,9 @@ CREATE TABLE IF NOT EXISTS eidx_meta (
                # Currently used for "-extindex --reindex" for Xapian
                # data, but may be used in more places down the line.
                $dbh->do(<<'');
-CREATE TABLE IF NOT EXISTS eidxq (
-       docid INTEGER PRIMARY KEY NOT NULL
-)
+CREATE TABLE IF NOT EXISTS eidxq (docid INTEGER PRIMARY KEY NOT NULL)
 
-               $dbh;
+               1;
        };
 }