* [PATCH] isearch: avoid hex string for Xapian sortable_serialise
@ 2023-08-19 8:30 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-08-19 8:30 UTC (permalink / raw)
To: meta
While a string representing a integer in hex is fine for DBI and
SQLite, Xapian's sortable_serialise requires a Perl integer value.
So just retrieve the last Xapian DB document ID in this rare
code path because we can't use 64-bit integer literals in some
32-bit Perl builds (e.g. OpenBSD on i386)
Fixes: be2a0a353d60 ("isearch: support 64-bit article numbers for SQLite query")
---
lib/PublicInbox/Isearch.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/Isearch.pm b/lib/PublicInbox/Isearch.pm
index 5cbc36fd..5cac08ba 100644
--- a/lib/PublicInbox/Isearch.pm
+++ b/lib/PublicInbox/Isearch.pm
@@ -47,11 +47,11 @@ SELECT MAX(docid) FROM xref3 WHERE ibx_id = ? AND xnum >= ? AND xnum <= ?
$r[1] = $sth->fetchrow_array;
if (defined($r[1]) && defined($r[0])) {
$opt{limit} = $r[1] - $r[0] + 1;
- } else { # these are fed to SQLite
- $r[1] //= '0x7'.('f'x15); # string for some 32-bit Perl
+ } else {
+ $r[1] //= $self->{es}->xdb->get_lastdocid;
$r[0] //= 0;
}
- $opt{uid_range} = \@r;
+ $opt{uid_range} = \@r; # these are fed to Xapian and SQLite
}
$self->{es}->mset($str, \%opt);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-19 8:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19 8:30 [PATCH] isearch: avoid hex string for Xapian sortable_serialise Eric Wong
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).