diff --git a/anki/sched.py b/anki/sched.py index bdc83bc9c..5e8add3a5 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -352,7 +352,7 @@ did = ? and queue = 0 limit ?)""", did, lim) if lim: # fill the queue with the current did self._newQueue = self.col.db.list(""" -select id from cards where did = ? and queue = 0 order by due limit ?""", did, lim) + select id from cards where did = ? and queue = 0 order by due,ord limit ?""", did, lim) if self._newQueue: self._newQueue.reverse() return True diff --git a/anki/schedv2.py b/anki/schedv2.py index 74bba3183..087fb56e5 100644 --- a/anki/schedv2.py +++ b/anki/schedv2.py @@ -353,7 +353,7 @@ did = ? and queue = 0 limit ?)""", did, lim) if lim: # fill the queue with the current did self._newQueue = self.col.db.list(""" -select id from cards where did = ? and queue = 0 order by due limit ?""", did, lim) + select id from cards where did = ? and queue = 0 order by due,ord limit ?""", did, lim) if self._newQueue: self._newQueue.reverse() return True