From 4c434e62a115c1158a0dc31468f109616a4ed088 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 15 Dec 2020 02:02:18 +0000 Subject: over: sort xref3 by xnum if ibx_id repeats While unlikely to happen, it may be possible for messages from the same inbox to get indexed multiple times. Provide consistent results in this case for ease-of-testing. --- lib/PublicInbox/Over.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Over.pm') diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index 51284601..62709468 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -264,7 +264,7 @@ sub get_xref3 { my ($self, $num) = @_; my $dbh = dbh($self); my $sth = $dbh->prepare_cached(<<'', undef, 1); -SELECT ibx_id,xnum,oidbin FROM xref3 WHERE docid = ? ORDER BY ibx_id ASC +SELECT ibx_id,xnum,oidbin FROM xref3 WHERE docid = ? ORDER BY ibx_id,xnum ASC $sth->execute($num); my $rows = $sth->fetchall_arrayref; -- cgit v1.2.3-24-ge0c7