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 C8B761F934 for ; Mon, 7 Dec 2020 07:40:53 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/5] over: gracefully show invalid ibx_id Date: Mon, 7 Dec 2020 07:40:49 +0000 Message-Id: <20201207074053.14483-2-e@80x24.org> In-Reply-To: <20201207074053.14483-1-e@80x24.org> References: <20201207074053.14483-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: While "public-inbox-extindex --gc" invocations try to ensure proper ordering, it is still possible for users to change the `inboxes' tables via sqlite3(1) or similar means. So show a "missing://ibx_id=$ibx_id" placeholder to avoid undefined variable warnings. URLs such as "imaps://..." will eventually be supported as eidx_keys, so having a URL-like "missing://" as a placeholder probably makes sense. --- lib/PublicInbox/Over.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index f34e7fc1..51284601 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -275,6 +275,7 @@ SELECT eidx_key FROM inboxes WHERE ibx_id = ? my $r = $_; $eidx_key_sth->execute($r->[0]); my $eidx_key = $eidx_key_sth->fetchrow_array; + $eidx_key //= "missing://ibx_id=$r->[0]"; "$eidx_key:$r->[1]:".unpack('H*', $r->[2]); } @$rows ]; }