From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/5] over: gracefully show invalid ibx_id
Date: Mon, 7 Dec 2020 07:40:49 +0000 [thread overview]
Message-ID: <20201207074053.14483-2-e@80x24.org> (raw)
In-Reply-To: <20201207074053.14483-1-e@80x24.org>
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 ];
}
next prev parent reply other threads:[~2020-12-07 7:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 7:40 [PATCH 0/5] extindex: random cleanups Eric Wong
2020-12-07 7:40 ` Eric Wong [this message]
2020-12-07 7:40 ` [PATCH 2/5] overidx: wrap eidx_key => ibx_id mapping Eric Wong
2020-12-07 7:40 ` [PATCH 3/5] extsearchidx: remove needless SHA-1 check Eric Wong
2020-12-07 7:40 ` [PATCH 4/5] searchidx: remove $oid parameter from most calls Eric Wong
2020-12-07 7:40 ` [PATCH 5/5] shard_add_eidx_info: pass $eidx_key instead of $ibx object Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201207074053.14483-2-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).