Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add extra tests for test_superlock.c. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1c4e58e7211522f0e7dfddd3a2b52f1d |
User & Date: | dan 2010-11-20 10:57:45.000 |
Context
2010-11-20
| ||
12:01 | Extra tests for "PRAGMA checkpoint_fullfsync". (check-in: e38c81cc18 user: dan tags: trunk) | |
10:57 | Add extra tests for test_superlock.c. (check-in: 1c4e58e721 user: dan tags: trunk) | |
2010-11-19
| ||
18:48 | Add tests for "PRAGMA checkpoint_fullfsync". (check-in: 765aa1b862 user: dan tags: trunk) | |
Changes
Changes to test/superlock.test.
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | + + + + + + + + + + + + + + + + + + + + + + + + + + | # set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/lock_common.tcl set testprefix superlock # Test organization: # # 1.*: Test superlock on a rollback database. Test that once the db is # superlocked, it is not possible for a second client to read from # it. # # 2.*: Test superlock on a WAL database with zero frames in the WAL file. # Test that once the db is superlocked, it is not possible to read, # write or checkpoint the db. # # 3.*: As 2.*, for WAL databases with one or more frames in the WAL. # # 4.*: As 2.*, for WAL databases with one or more checkpointed frames # in the WAL. # # 5.*: Test that a call to sqlite3demo_superlock() uses the busy handler # correctly to wait for existing clients to clear on a WAL database. # And returns SQLITE_BUSY if no busy handler is defined or the busy # handler returns 0 before said clients relinquish their locks. # # 6.*: Test that if a superlocked WAL database is overwritten, existing # clients run the recovery to build the new wal-index after the # superlock is released. # # do_execsql_test 1.1 { CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); PRAGMA journal_mode = DELETE; } {delete} |
︙ | |||
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | + | do_test 4.2 { sqlite3demo_superlock unlock test.db } {unlock} do_catchsql_test 4.3 { SELECT * FROM t1 } {1 {database is locked}} do_catchsql_test 4.4 { INSERT INTO t1 VALUES(5, 6)} {1 {database is locked}} do_catchsql_test 4.5 { PRAGMA wal_checkpoint } {1 {database is locked}} do_test 4.6 { unlock } {} do_multiclient_test tn { proc busyhandler {x} { switch -- $x { 1 { sql1 "COMMIT" } 2 { sql2 "COMMIT" } 3 { sql3 "COMMIT" } } lappend ::busylist $x |
︙ | |||
88 89 90 91 92 93 94 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | do_test 5.$tn.4 { csql2 { SELECT * FROM t1 } } {1 {database is locked}} do_test 5.$tn.5 { csql3 { INSERT INTO t1 VALUES(5, 6) } } {1 {database is locked}} do_test 5.$tn.6 { csql1 "PRAGMA wal_checkpoint" } {1 {database is locked}} do_test 5.$tn.7 { unlock } {} |