From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 87FEE1FA13 for ; Tue, 15 Dec 2020 02:02:25 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/9] over: sort xref3 by xnum if ibx_id repeats Date: Tue, 15 Dec 2020 02:02:18 +0000 Message-Id: <20201215020224.11739-4-e@80x24.org> In-Reply-To: <20201215020224.11739-1-e@80x24.org> References: <20201215020224.11739-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-) 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;