Highlights
pad db restore could destroy the database it was restoring (#1331 / #1332).
Passing the live SQLite database path as the backup file truncated it to zero bytes: the destination was opened for writing before the source was read, and they were the same file. v0.15.2 refuses the restore when the backup and the database resolve to the same file — os.SameFile, so symlinks and hard links are caught too — and leaves both untouched.
Reported and fixed by @mattfaltyn, with three reproductions and a control run.
Who should upgrade. Anyone who runs pad db restore against a SQLite database. The PostgreSQL restore path is unaffected — it returns before the SQLite file-copy branch, so it never had this failure mode.
That is the only change from v0.15.1.
Changelog
Bug fixes
- b1f17c9: fix(cli): refuse SQLite self-restore (#1332) (@mattfaltyn)