From: Eric Wong Date: Tue, 15 Dec 2020 02:02:18 +0000 (+0000) Subject: over: sort xref3 by xnum if ibx_id repeats X-Git-Tag: v1.7.0~1547 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4c434e62a115c1158a0dc31468f109616a4ed088;p=public-inbox.git 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. --- 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;