OLD | NEW |
1 # 2011 December 21 | 1 # 2011 December 21 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 do_test zerodamage-2.1 { | 82 do_test zerodamage-2.1 { |
83 set ::max_journal_size 0 | 83 set ::max_journal_size 0 |
84 db close | 84 db close |
85 sqlite3 db file:test.db?psow=FALSE -uri 1 | 85 sqlite3 db file:test.db?psow=FALSE -uri 1 |
86 db eval { | 86 db eval { |
87 UPDATE t1 SET y=randomblob(50) WHERE x=124; | 87 UPDATE t1 SET y=randomblob(50) WHERE x=124; |
88 } | 88 } |
89 concat [file_control_powersafe_overwrite db -1] [set ::max_journal_size] | 89 concat [file_control_powersafe_overwrite db -1] [set ::max_journal_size] |
90 } {0 0 24704} | 90 } {0 0 24704} |
91 | 91 |
92 ifcapable wal { | 92 if {[wal_is_capable]} { |
93 # Run a WAL-mode transaction with POWERSAFE_OVERWRITE on to verify that the | 93 # Run a WAL-mode transaction with POWERSAFE_OVERWRITE on to verify that the |
94 # WAL file does not get too big. | 94 # WAL file does not get too big. |
95 # | 95 # |
96 do_test zerodamage-3.0 { | 96 do_test zerodamage-3.0 { |
97 db eval { | 97 db eval { |
98 PRAGMA journal_mode=WAL; | 98 PRAGMA journal_mode=WAL; |
99 } | 99 } |
100 db close | 100 db close |
101 sqlite3 db file:test.db?psow=TRUE -uri 1 | 101 sqlite3 db file:test.db?psow=TRUE -uri 1 |
102 db eval { | 102 db eval { |
103 UPDATE t1 SET y=randomblob(50) WHERE x=124; | 103 UPDATE t1 SET y=randomblob(50) WHERE x=124; |
104 } | 104 } |
105 file size test.db-wal | 105 file size test.db-wal |
106 } {1080} | 106 } {1080} |
107 | 107 |
108 # Repeat the previous with POWERSAFE_OVERWRITE off. Verify that the WAL file | 108 # Repeat the previous with POWERSAFE_OVERWRITE off. Verify that the WAL file |
109 # is padded. | 109 # is padded. |
110 # | 110 # |
111 do_test zerodamage-3.1 { | 111 do_test zerodamage-3.1 { |
112 db close | 112 db close |
113 sqlite3 db file:test.db?psow=FALSE -uri 1 | 113 sqlite3 db file:test.db?psow=FALSE -uri 1 |
114 db eval { | 114 db eval { |
| 115 PRAGMA synchronous=FULL; |
115 UPDATE t1 SET y=randomblob(50) WHERE x=124; | 116 UPDATE t1 SET y=randomblob(50) WHERE x=124; |
116 } | 117 } |
117 file size test.db-wal | 118 file size test.db-wal |
118 } {16800} | 119 } {16800} |
119 } | 120 } |
120 | 121 |
121 finish_test | 122 finish_test |
OLD | NEW |