mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
Handle invalid float mtimes in DB check
Likely an add-on or third-party tool created them, and they were breaking DB queries for a user. https://sqlite.org/stricttables.html could help us avoid this class of issue in the future, though we'd need to check what client versions we'd break with this change, and would need to change the 'sfld is an integer' hack.
This commit is contained in:
parent
8646d48d93
commit
684e46b2a7
2 changed files with 7 additions and 0 deletions
3
rslib/src/storage/card/fix_mod.sql
Normal file
3
rslib/src/storage/card/fix_mod.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
UPDATE cards
|
||||
SET mod = cast(mod AS integer)
|
||||
WHERE mod != cast(mod AS integer)
|
||||
|
|
@ -353,6 +353,10 @@ impl super::SqliteStorage {
|
|||
.db
|
||||
.prepare(include_str!("fix_ivl.sql"))?
|
||||
.execute(params![mtime, usn])?;
|
||||
other_cnt += self
|
||||
.db
|
||||
.prepare(include_str!("fix_mod.sql"))?
|
||||
.execute(params![])?;
|
||||
other_cnt += self
|
||||
.db
|
||||
.prepare(include_str!("fix_ordinal.sql"))?
|
||||
|
|
|
|||
Loading…
Reference in a new issue