From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 656E71F56D for ; Sun, 1 Oct 2023 09:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1696154071; bh=xEq75vw91hCB5XvnmnGG7rtTrbn7+qZ4MJRPdrXiXHY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tDjdEVnc6M3qbeb6qbVEVMOHcA9LjI1nU9nwrGyHQ0s2c7mTI71vs8s+JQAgE/jiW PeqKBzLsvvKJ6sbZ3WYUjx3nZ5B8EXsnwrP2Mis80tOBsWVybO70g7luklJgR9h58C mlcUrakODtUUFyM3Il9/3k6SXAccGt5UjODc198M= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 10/13] overidx: fix version comparison Date: Sun, 1 Oct 2023 09:54:26 +0000 Message-ID: <20231001095429.2092610-11-e@80x24.org> In-Reply-To: <20231001095429.2092610-1-e@80x24.org> References: <20231001095429.2092610-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can't use $DBD::SQLite::sqlite_version_number with older versions of DBD::SQLite. Thus we need to treat the $DBD::SQLite::sqlite_version string (e.g. "3.8.3", not v-string) and convert it to a v-string with eval for version comparisons to determine if we can fork multiple children when using SQLite. Fixes: fa04201baae9 ("lei: force --jobs=1,1 for SQLite < 3.8.3") --- lib/PublicInbox/OverIdx.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index 6cc86d5d..5cea3706 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -671,13 +671,14 @@ sub vivify_xvmd { } sub fork_ok { - return 1 if $DBD::SQLite::sqlite_version >= 3008003; + state $fork_ok = eval("v$DBD::SQLite::sqlite_version") ge v3.8.3; + return 1 if $fork_ok; my ($opt) = @_; my @j = split(/,/, $opt->{jobs} // ''); state $warned; - grep { $_ > 1 } @j and $warned //= warn('DBD::SQLite version is ', - $DBD::SQLite::sqlite_version, - ", need >= 3008003 (3.8.3) for --jobs > 1\n"); + grep { $_ > 1 } @j and $warned //= warn(<= v3.8.3 for --jobs > 1 +EOM $opt->{jobs} = '1,1'; undef; }