From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/4] search: do not use $QP_FLAGS until Xapian is loaded
Date: Thu, 31 Dec 2020 17:47:47 -1200 [thread overview]
Message-ID: <20210101054750.6771-2-e@80x24.org> (raw)
In-Reply-To: <20210101054750.6771-1-e@80x24.org>
The default $QP_FLAGS won't be set until after Xapian is
loaded, duh...
This fixes t/imapd.t with TEST_RUN_MODE=0
---
lib/PublicInbox/Search.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 547b6fbe..0bdf6fc6 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -196,6 +196,7 @@ sub xdb_shards_flat ($) {
my $xpfx = $self->{xpfx};
my (@xdb, $slow_phrase);
load_xapian();
+ $self->{qp_flags} //= $QP_FLAGS;
if ($xpfx =~ m/xapian${\SCHEMA_VERSION}\z/) {
@xdb = ($X{Database}->new($xpfx));
$self->{qp_flags} |= FLAG_PHRASE() if !-f "$xpfx/iamchert";
@@ -232,7 +233,6 @@ sub mset_to_artnums {
sub xdb ($) {
my ($self) = @_;
$self->{xdb} //= do {
- $self->{qp_flags} //= $QP_FLAGS;
my @xdb = $self->xdb_shards_flat or return;
$self->{nshard} = scalar(@xdb);
my $xdb = shift @xdb;
next prev parent reply other threads:[~2021-01-01 5:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-01 5:47 [PATCH 0/4] TEST_RUN_MODE=0 fixes Eric Wong
2021-01-01 5:47 ` Eric Wong [this message]
2021-01-01 5:47 ` [PATCH 2/4] t/lei: fix TEST_RUN_MODE=0, simplify oneshot fallback Eric Wong
2021-01-01 5:47 ` [PATCH 3/4] import: unset GIT_CONFIG with `git config --global' Eric Wong
2021-01-01 5:47 ` [PATCH 4/4] treewide: reduce load_xapian* callsites 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=20210101054750.6771-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).