Closed rogerbinns closed 5 months ago
It doesn't matter what parent VFS is used - eg unix
gives the same error. And leaving out the rekey has everything fine too.
If "memdb"
in the code is replaced with ""
which means use the default vfs, then this issue does not happen. Using "multipleciphers-unix"
has the same effect as it is the default VFS.
The problem here is that the implementation of PRAGMA rekey
should check first whether the VFS used for the current database supports encryption (that is, includes the multiple ciphers VFS shim in the VFS stack).
The current implementation of PRAGMA rekey
does not perform this check. The reason can be found in the history: before the SQLITE_HAS_CODEC
feature was removed in early 2020 the implementation of the encryption extension implicitly worked for all VFSes automatically, because the encryption/decryption took place, before data were written/read to/from disk.
Now, the user has to select a VFS which supports encryption through the multiple ciphers VFS shim.
The fix will be to add checks for encryption support to the implementation of sqlite3_key
and sqlite3_rekey
.
Commit 5208c1687ee65100685f49c609070143099db1fa should fix the issue.
With apsw-sqlite3mc:
Result: