]> Sergey Matveev's repositories - public-inbox.git/commitdiff
over: sort xref3 by xnum if ibx_id repeats
authorEric Wong <e@80x24.org>
Tue, 15 Dec 2020 02:02:18 +0000 (02:02 +0000)
committerEric Wong <e@80x24.org>
Thu, 17 Dec 2020 19:13:08 +0000 (19:13 +0000)
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

index 51284601bfc34fbb080ec8bfec5d1af01593e45b..62709468984d2dc57aef3c1c10853ca0dba0b7d1 100644 (file)
@@ -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;