Ticket Hash: | 0cfd98ee201a2aa8f3f494bcc90d2977dc4d1990 | ||
Title: | Potential corruption of backup db when backing up a db last written by sqlite<3.7.0 | ||
Status: | Closed | Type: | Code_Defect |
Severity: | Important | Priority: | Immediate |
Subsystem: | Pager | Resolution: | Fixed |
Last Modified: |
2012-12-21 16:16:53 12.53 years ago |
Created: |
2012-12-21 16:01:01 12.53 years ago |
Version Found In: | 3.7.15 |
Description: | ||||
Versions of sqlite 3.7.0 and newer store the size of the database image in the database file header. Earlier versions do not. When a new version writes to the db, it updates the database size field and sets a flag in the header to indicate that the last version to write the db updated the db size field. An earlier version does not update the db size field, but does clear the flag.
If the flag is set, SQLite trusts the db size field in the header. So if it is set incorrectly, the database is considered corrupt. The current problem comes about as follows:
Note: The "flag" mentioned above is not actually a flag, it is a second copy of the change counter that is only updated by post-3.7.0 versions of sqlite. The flag is considered set if that second copy matches the first. | ||||
User Comments: | ||||
dan added on 2012-12-21 16:16:53:
Fixed by [ff6857b6ed]. |