Closed kmvanbrunt closed 6 years ago
Thanks! That was a memory leak in unqlite_commit() that caused this data loss that we finally identified thanks to this report. Please update to UnQLite to 1.1.9 to fix this issue.
Thanks a lot for the quick fix.
I am experiencing lost data and/or file corruption when using unqlite 1.1.8 on Windows. The following code reliably produces this behavior and has been tested on Windows 7 and 10.
The code inserts 200 records into a database and calls
unqlite_commit()
after each insertion because frequent commits seem to make the problem happen faster. After inserting the records, I count how many were inserted and the value is 200. I then close and reopen the database and recount the records. The new count is substantially lower (I've seen as low as 6).Things I've noticed:
Removing the call to
unqlite_commit()
results in the correct amount of records being read back from the file.Using a constant seed in
srand()
results in the same number of missing records each time. Therefore identical keys/records produces the same behavior every run. I have a commented seed for this purpose.Am I doing anything wrong in this code?