They're both using the same database file which is wrong (tests run in
parallel). But more importantly, they test almost nothing, and we have a
better checkpoint test already.
- try_wal_watermark_read_page - try to read page from the DB with given WAL watermark value
- wal_changed_pages_after - return set of unique pages changed after watermark WAL position
We need to ensures that there is a single, shared `Database` object per
a database file. We need because it is not safe to have multiple
independent WAL files open because coordination happens at process-level
POSIX file advisory locks.
Fixes#2267
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>
Closes#2299
Commit ac33ae90 ("core: Enforce single, shared database object per
database file") changes the semantics of the WAL because unless we close
all the connections, the WAL remains open due to `Database` being kept
open in memory. Fix test failures by properly closing the connection
between different test cases.
This PR addresses two related issues in the SQLite3 C API
implementation:
1. Properly sets error codes on the database object when handling SQL
preparation failures
2. Fixes C string handling in sqlite3_errstr_impl to ensure proper null-
termination
Error codes should be correctly set on the database object, making them
accessible to API consumers. Also fixes and issue where C strings
weren't properly null-terminated in error reporting functions, which
causes the issue in #2197 where messages all get pushed onto a single
line. Its possible that this also fixes a buffer overflow, but I'm not
actually sure what the behavior was.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#2212