mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix invalid reschedule revlog entries
https://forums.ankiweb.net/t/statistics-messed-up-after-fsrs-reschedule/54622 Caused by syncing the revlogs in a normal sync to a client that doesn't understand them yet - they end up using the default for RevlogReviewKind instead, which is 0.
This commit is contained in:
parent
5f68c5208e
commit
28ba578fc7
1 changed files with 18 additions and 2 deletions
|
@ -1,7 +1,23 @@
|
||||||
UPDATE revlog
|
UPDATE revlog
|
||||||
SET ivl = min(max(round(ivl), -2147483648), 2147483647),
|
SET ivl = min(max(round(ivl), -2147483648), 2147483647),
|
||||||
lastIvl = min(max(round(lastIvl), -2147483648), 2147483647),
|
lastIvl = min(max(round(lastIvl), -2147483648), 2147483647),
|
||||||
time = min(max(round(time), 0), 2147483647)
|
time = min(max(round(time), 0), 2147483647),
|
||||||
|
type = (
|
||||||
|
CASE
|
||||||
|
WHEN type = 0
|
||||||
|
AND time = 0
|
||||||
|
AND ease = 0 THEN 5
|
||||||
|
ELSE type
|
||||||
|
END
|
||||||
|
)
|
||||||
WHERE ivl != min(max(round(ivl), -2147483648), 2147483647)
|
WHERE ivl != min(max(round(ivl), -2147483648), 2147483647)
|
||||||
OR lastIvl != min(max(round(lastIvl), -2147483648), 2147483647)
|
OR lastIvl != min(max(round(lastIvl), -2147483648), 2147483647)
|
||||||
OR time != min(max(round(time), 0), 2147483647)
|
OR time != min(max(round(time), 0), 2147483647)
|
||||||
|
OR type != (
|
||||||
|
CASE
|
||||||
|
WHEN type = 0
|
||||||
|
AND time = 0
|
||||||
|
AND ease = 0 THEN 5
|
||||||
|
ELSE type
|
||||||
|
END
|
||||||
|
)
|
Loading…
Reference in a new issue