From 9daa0c9acb3019c719a282c81888707b465bc9ce Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 2 Dec 2021 17:20:48 +1000 Subject: [PATCH] fix new cards not appearing in correct order in v3 This was broken by an SQLite upgrade - previously we received the rows in ix_cards_sched order, but recent versions use a table scan for that query when the order is unspecified. Solved by being explicit about the order we expect results to arrive. https://forums.ankiweb.net/t/skipping-new-cards/15410 --- rslib/src/storage/card/new_cards.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rslib/src/storage/card/new_cards.sql b/rslib/src/storage/card/new_cards.sql index 8f68f57e1..3f461f0aa 100644 --- a/rslib/src/storage/card/new_cards.sql +++ b/rslib/src/storage/card/new_cards.sql @@ -6,4 +6,7 @@ SELECT id, odid FROM cards WHERE did = ? - AND queue = 0 \ No newline at end of file + AND queue = 0 +ORDER BY did, + queue, + due \ No newline at end of file