mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04: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
b2e7ab522b
commit
cf39455487
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