OLD | NEW |
1 *** Throughout this document, a page is deemed to have been synced | 1 *** Throughout this document, a page is deemed to have been synced |
2 automatically as soon as it is written when PRAGMA synchronous=OFF. | 2 automatically as soon as it is written when PRAGMA synchronous=OFF. |
3 Otherwise, the page is not synced until the xSync method of the VFS | 3 Otherwise, the page is not synced until the xSync method of the VFS |
4 is called successfully on the file containing the page. | 4 is called successfully on the file containing the page. |
5 | 5 |
6 *** Definition: A page of the database file is said to be "overwriteable" if | 6 *** Definition: A page of the database file is said to be "overwriteable" if |
7 one or more of the following are true about the page: | 7 one or more of the following are true about the page: |
8 | 8 |
9 (a) The original content of the page as it was at the beginning of | 9 (a) The original content of the page as it was at the beginning of |
10 the transaction has been written into the rollback journal and | 10 the transaction has been written into the rollback journal and |
(...skipping 26 matching lines...) Expand all Loading... |
37 first 100 bytes of the database file. | 37 first 100 bytes of the database file. |
38 | 38 |
39 (5) All writes to the database file are synced prior to the rollback journal | 39 (5) All writes to the database file are synced prior to the rollback journal |
40 being deleted, truncated, or zeroed. | 40 being deleted, truncated, or zeroed. |
41 | 41 |
42 (6) If a master journal file is used, then all writes to the database file | 42 (6) If a master journal file is used, then all writes to the database file |
43 are synced prior to the master journal being deleted. | 43 are synced prior to the master journal being deleted. |
44 | 44 |
45 *** Definition: Two databases (or the same database at two points it time) | 45 *** Definition: Two databases (or the same database at two points it time) |
46 are said to be "logically equivalent" if they give the same answer to | 46 are said to be "logically equivalent" if they give the same answer to |
47 all queries. Note in particular the the content of freelist leaf | 47 all queries. Note in particular the content of freelist leaf |
48 pages can be changed arbitarily without effecting the logical equivalence | 48 pages can be changed arbitarily without effecting the logical equivalence |
49 of the database. | 49 of the database. |
50 | 50 |
51 (7) At any time, if any subset, including the empty set and the total set, | 51 (7) At any time, if any subset, including the empty set and the total set, |
52 of the unsynced changes to a rollback journal are removed and the | 52 of the unsynced changes to a rollback journal are removed and the |
53 journal is rolled back, the resulting database file will be logical | 53 journal is rolled back, the resulting database file will be logical |
54 equivalent to the database file at the beginning of the transaction. | 54 equivalent to the database file at the beginning of the transaction. |
55 | 55 |
56 (8) When a transaction is rolled back, the xTruncate method of the VFS | 56 (8) When a transaction is rolled back, the xTruncate method of the VFS |
57 is called to restore the database file to the same size it was at | 57 is called to restore the database file to the same size it was at |
58 the beginning of the transaction. (In some VFSes, the xTruncate | 58 the beginning of the transaction. (In some VFSes, the xTruncate |
59 method is a no-op, but that does not change the fact the SQLite will | 59 method is a no-op, but that does not change the fact the SQLite will |
60 invoke it.) | 60 invoke it.) |
61 | 61 |
62 (9) Whenever the database file is modified, at least one bit in the range | 62 (9) Whenever the database file is modified, at least one bit in the range |
63 of bytes from 24 through 39 inclusive will be changed prior to releasing | 63 of bytes from 24 through 39 inclusive will be changed prior to releasing |
64 the EXCLUSIVE lock. | 64 the EXCLUSIVE lock. |
65 | 65 |
66 (10) The pattern of bits in bytes 24 through 39 shall not repeat in less | 66 (10) The pattern of bits in bytes 24 through 39 shall not repeat in less |
67 than one billion transactions. | 67 than one billion transactions. |
68 | 68 |
69 (11) A database file is well-formed at the beginning and at the conclusion | 69 (11) A database file is well-formed at the beginning and at the conclusion |
70 of every transaction. | 70 of every transaction. |
71 | 71 |
72 (12) An EXCLUSIVE lock must be held on the database file before making | 72 (12) An EXCLUSIVE lock must be held on the database file before making |
73 any changes to the database file. | 73 any changes to the database file. |
74 | 74 |
75 (13) A SHARED lock must be held on the database file before reading any | 75 (13) A SHARED lock must be held on the database file before reading any |
76 content out of the database file. | 76 content out of the database file. |
OLD | NEW |