Ticket Hash: | 89b8c9ac540eb58af7c79f1b4995a44fa2d8fa59 | ||
Title: | False reports of corruption after writing db with two different versions (3.7 and 3.6). | ||
Status: | Fixed | Type: | Code_Defect |
Severity: | Minor | Priority: | Immediate |
Subsystem: | B-Tree | Resolution: | Fixed |
Last Modified: |
2011-02-10 19:24:13 14.39 years ago |
Created: |
2011-02-09 18:08:46 14.39 years ago |
Version Found In: | 3.7.0 - 3.7.5 |
Description: | ||||
Version 3.7.0 and greater may incorrectly report that an auto-vacuum capable database is corrupt if the following sequence occurs:
This leaves the database in a state where 3.7.0 and greater report that it is corrupt (and no data can be read from it). It is not actually corrupt, and all data can still be read by earlier versions. A database can be "repaired" by vacuuming it with a version earlier than 3.7.0. SQLite version 3.7.6 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> PRAGMA auto_vacuum = 1; sqlite> CREATE TABLE t1(x); sqlite> .quit SQLite version 3.6.23.1 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> DROP TABLE t1; sqlite> .quit SQLite version 3.7.6 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> PRAGMA integrity_check; Error: database disk image is malformed drh added on 2011-02-09 18:39:32: PRAGMA writable_schema=ON; Immediately after opening the connection, and then running VACUUM (or any other write operation) on the database. |