deltachat-core-rust
deltachat-core-rust copied to clipboard
Database: "Failed to run incremental vacuum"
-
Operating System (Linux/Mac/Windows/iOS/Android): Android 12.
-
Delta Chat Version: 1.31.0 (nightly build of 2022-07-15).
-
Expected behavior: No error message
Failed to run incremental vacuum
logged. -
Actual behavior: Error message
Failed to run incremental vacuum
logged. -
Steps to reproduce the problem: N/A (unknown).
-
Screenshots: N/A.
-
Remark: The error appeared while housekeeping was still active, see log for details.
the error in the log is at sql.rs:666
- the number of the beast! coincidence? :)
Maybe fixed by #2955, need to test.
Still not fixed by #2955.
There is no documentation saying it returns anything: https://www.sqlite.org/pragma.html#pragma_incremental_vacuum Maybe need to look into the code then and see what is going on there.
https://www.sqlite.org/c3ref/data_count.html has an interesting sentence: "The sqlite3_data_count(P) routine returns 0 if the previous call to sqlite3_step(P) returned SQLITE_DONE. The sqlite3_data_count(P) will return non-zero if previous call to sqlite3_step(P) returned SQLITE_ROW, except in the case of the PRAGMA incremental_vacuum where it always returns zero since each step of that multi-step pragma returns 0 columns of data."
Apparently incremental_vacuum is a "multi-step pragma" that returns 0 columns on each step. So we need to call sqlite3_step
on it until it is done.
Made a fix: #4160
There is almost no documentation, but the implementation explicitly generates a zero-column row.
Works fine now, thank you so much! :)