From: Eric Wong Date: Mon, 7 Dec 2020 07:40:49 +0000 (+0000) Subject: over: gracefully show invalid ibx_id X-Git-Tag: v1.7.0~1576 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f0958e5f609c20070e6d6b33c8509989e2f237e9;p=public-inbox.git over: gracefully show invalid ibx_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. --- 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 ]; }