SQLite Forum

cksumvfs producing invalid checksums
Login
I have been attempting to add page checksums to an sqlite3 database used by my backup software, but have found when using https://www.sqlite.org/cksumvfs.html I am unable to migrate an existing database without getting checksum failures.

Below is a git repository containing the database and a script to reproduce the issue:

https://github.com/andrewchambers/sqlitecksumvfsreport


A summary of the problem:

```
cp backup.sendlog backup.copy.sendlog

# Vacuum works fine initially, integrity checks pass.
./sqlite3-shell <<EOF
.open backup.copy.sendlog
vacuum;
vacuum;
pragma integrity_check;
EOF

# Enable cksumvfs following sqlite website.
# Second vacuum fails with failed checksum, even thought first was ok.
./sqlite3-shell <<EOF
.load ./cksumvfs.so
.open backup.copy.sendlog
.filectrl reserve_bytes 8
vacuum;
vacuum;
EOF
```

produces the output:

```
+ cp backup.sendlog backup.copy.sendlog
+ ./sqlite3-shell
ok
+ ./sqlite3-shell
8
Error: near line 5: disk I/O error
```

Could anyone help me confirm if this is a bug, or if I am doing anything wrong?

Thanks for any help.