From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A074B1FA17 for ; Wed, 20 Jan 2021 05:04:50 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/7] overidx: eidx_prep: fix leftover dbh reference Date: Wed, 20 Jan 2021 14:04:45 +0900 Message-Id: <20210120050449.71330-4-e@80x24.org> In-Reply-To: <20210119093435.17955-1-e@80x24.org> References: <20210119093435.17955-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index 0a4eb39e..e606dcf5 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -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; }; }