-C Get\sread-only\sSHM\sfile\stests\spassing\son\sWin32.
-D 2017-11-09T20:02:44.785
+C Enhance\swalro2.test\sto\sbetter\sensure\sthat\sreadonly_shm\sclients\sare\snot\susing\ninvalid\s*-shm\sfiles.
+D 2017-11-09T20:34:35.406
F Makefile.in 5bae3f2f3d42f2ad52b141562d74872c97ac0fca6c54953c91bb150a0e6427a8
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 3a5cb477ec3ce5274663b693164e349db63348667cd45bad78cc13d580b691e2
F test/walpersist.test 8c6b7e3ec1ba91b5e4dc4e0921d6d3f87cd356a6
F test/walprotocol.test 0b92feb132ccebd855494d917d3f6c2d717ace20
F test/walro.test cb438d05ba0d191f10b688e39c4f0cd5b71569a1d1f4440e5bdf3c6880e08c20
-F test/walro2.test bde4b25b701be452ba1436409d9ee418513f77bf4c11229d558fd14282330e00
+F test/walro2.test 8812e514c968bf4ee317571fafedac43443360ae23edd7d0f4ef1eae0c13e8e8
F test/walrofault.test c70cb6e308c443867701856cce92ad8288cd99488fa52afab77cca6cfd51af68
F test/walshared.test 0befc811dcf0b287efae21612304d15576e35417
F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 43c311701bdf1202918cd46fa6133a11458e0ef8ddb09e46290a231083f395ce
-R b51af4203460b2806284a868a4615565
-U mistachkin
-Z 2f0a43c33871392e0df8028f39e6b334
+P abef05353554e72f4d08aff562b87ff8530e8537a79e58d831205ea8c46eed07
+R 43c8def15803418ff2b6211daf889aff
+U dan
+Z b374f730e5d2822de9c4c678f7c53c0c
return
}
+proc copy_to_test2 {bZeroShm} {
+ forcecopy test.db test.db2
+ forcecopy test.db-wal test.db2-wal
+ if {$bZeroShm} {
+ forcedelete test.db2-shm
+ set fd [open test.db2-shm w]
+ seek $fd [expr [file size test.db-shm]-1]
+ puts -nonewline $fd "\0"
+ close $fd
+ } else {
+ forcecopy test.db-shm test.db2-shm
+ }
+}
+
+foreach bZeroShm {0 1} {
+set TN [expr $bZeroShm+1]
do_multiclient_test tn {
# Close all connections and delete the database.
}
}
- do_test 1.1 {
+ do_test $TN.1.1 {
code2 { sqlite3 db2 test.db }
sql2 {
CREATE TABLE t1(x, y);
file exists test.db-shm
} {1}
- do_test 1.2.1 {
- forcecopy test.db test.db2
- forcecopy test.db-wal test.db2-wal
- forcecopy test.db-shm test.db2-shm
+ do_test $TN.1.2.1 {
+ copy_to_test2 $bZeroShm
code1 {
sqlite3 db file:test.db2?readonly_shm=1
}
sql1 { SELECT * FROM t1 }
} {a b c d}
- do_test 1.2.2 {
+ do_test $TN.1.2.2 {
sql1 { SELECT * FROM t1 }
} {a b c d}
- do_test 1.3.1 {
+ do_test $TN.1.3.1 {
code3 { sqlite3 db3 test.db2 }
sql3 { SELECT * FROM t1 }
} {a b c d}
- do_test 1.3.2 {
+ do_test $TN.1.3.2 {
sql1 { SELECT * FROM t1 }
} {a b c d}
code2 { db2 close }
code3 { db3 close }
- do_test 2.1 {
+ do_test $TN.2.1 {
code2 { sqlite3 db2 test.db }
sql2 {
INSERT INTO t1 VALUES('e', 'f');
file exists test.db-shm
} {1}
- do_test 2.2 {
- forcecopy test.db test.db2
- forcecopy test.db-wal test.db2-wal
- forcecopy test.db-shm test.db2-shm
+ do_test $TN.2.2 {
+ copy_to_test2 $bZeroShm
code1 {
sqlite3 db file:test.db2?readonly_shm=1
}
}
} {a b c d e f g h}
- do_test 2.3.1 {
+ do_test $TN.2.3.1 {
code3 { sqlite3 db3 test.db2 }
sql3 { SELECT * FROM t1 }
} {a b c d e f g h}
- do_test 2.3.2 {
+ do_test $TN.2.3.2 {
sql3 { INSERT INTO t1 VALUES('i', 'j') }
code3 { db3 close }
sql1 { COMMIT }
} {}
- do_test 2.3.3 {
+ do_test $TN.2.3.3 {
sql1 { SELECT * FROM t1 }
} {a b c d e f g h i j}
catch { code1 { db close } }
catch { code2 { db2 close } }
catch { code3 { db3 close } }
- do_test 3.1.0 {
+ do_test $TN.3.1.0 {
list [file exists test.db-wal] [file exists test.db-shm]
} {0 0}
- do_test 3.1.1 {
+ do_test $TN.3.1.1 {
close [open test.db-wal w]
close [open test.db-shm w]
code1 {
sql1 { SELECT * FROM t1 }
} {a b c d e f g h}
- do_test 3.2.0 {
+ do_test $TN.3.2.0 {
list [file size test.db-wal] [file size test.db-shm]
} {0 0}
- do_test 3.2.1 {
+ do_test $TN.3.2.1 {
code2 { sqlite3 db2 test.db }
sql2 { INSERT INTO t1 VALUES(1, 2) ; PRAGMA wal_checkpoint=truncate }
code2 { db2 close }
sql1 { SELECT * FROM t1 }
} {a b c d e f g h 1 2}
- do_test 3.2.2 {
+ do_test $TN.3.2.2 {
list [file size test.db-wal] [file size test.db-shm]
} {0 32768}
- do_test 3.3.0 {
+ do_test $TN.3.3.0 {
code2 { sqlite3 db2 test.db }
sql2 {
INSERT INTO t1 VALUES(3, 4);
code1 { db close }
list [file size test.db-wal] [file size test.db-shm]
} [list [wal_file_size 4 1024] 32768]
- do_test 3.3.1 {
+ do_test $TN.3.3.1 {
code1 { sqlite3 db file:test.db?readonly_shm=1 }
sql1 { SELECT * FROM t1 }
} {a b c d e f g h 1 2 3 4 5 6 7 8 9 10}
- do_test 3.3.2 {
+ do_test $TN.3.3.2 {
code2 { sqlite3 db2 test.db }
sql2 {
PRAGMA wal_checkpoint;
code2 { db2 close }
list [file size test.db-wal] [file size test.db-shm]
} [list [wal_file_size 4 1024] 32768]
- do_test 3.3.3 {
+ do_test $TN.3.3.3 {
sql1 { SELECT * FROM t1 }
} {i ii}
catch { code2 { db2 close } }
catch { code3 { db3 close } }
- do_test 4.0 {
+ do_test $TN.4.0 {
code1 { forcedelete test.db }
code1 { sqlite3 db test.db }
sql1 {
INSERT INTO t1 VALUES('world');
}
- forcecopy test.db test.db2
- forcecopy test.db-wal test.db2-wal
- forcecopy test.db-shm test.db2-shm
-
+ copy_to_test2 $bZeroShm
+
code1 { db close }
} {}
- do_test 4.1.1 {
+ do_test $TN.4.1.1 {
code2 { sqlite3 db2 file:test.db2?readonly_shm=1 }
sql2 { SELECT * FROM t1 }
} {hello world}
- do_test 4.1.2 {
+ do_test $TN.4.1.2 {
code3 { sqlite3 db3 test.db2 }
sql3 {
INSERT INTO t1 VALUES('!');
}
code3 { db3 close }
} {}
- do_test 4.1.3 {
+ do_test $TN.4.1.3 {
sql2 { SELECT * FROM t1 }
} {hello world !}
catch { code2 { db2 close } }
catch { code3 { db3 close } }
- do_test 4.2.1 {
+ do_test $TN.4.2.1 {
code1 { sqlite3 db test.db }
sql1 {
INSERT INTO t1 VALUES('!');
SELECT count(*) FROM t2;
}
} {500}
- do_test 4.2.2 {
+ do_test $TN.4.2.2 {
file size test.db-wal
} {461152}
- do_test 4.2.4 {
+ do_test $TN.4.2.4 {
file_control_persist_wal db 1; db close
- forcecopy test.db test.db2
- forcecopy test.db-wal test.db2-wal
- forcecopy test.db-shm test.db2-shm
-
+ copy_to_test2 $bZeroShm
code2 { sqlite3 db2 file:test.db2?readonly_shm=1 }
sql2 {
SELECT * FROM t1;
catch { code2 { db2 close } }
catch { code3 { db3 close } }
- do_test 5.0 {
+ do_test $TN.5.0 {
code1 { forcedelete test.db }
code1 { sqlite3 db test.db }
sql1 {
INSERT INTO t1 VALUES('hello');
}
- forcecopy test.db test.db2
- forcecopy test.db-wal test.db2-wal
- forcecopy test.db-shm test.db2-shm
+ copy_to_test2 $bZeroShm
code1 { db close }
} {}
- do_test 5.1 {
+ do_test $TN.5.1 {
code2 { sqlite3 db2 file:test.db2?readonly_shm=1 }
sql2 {
SELECT * FROM t1;
}
} {hello world ! world hello}
- do_test 5.2 {
+ do_test $TN.5.2 {
code1 {
proc handle_read {op args} {
if {$op=="xRead" && [file tail [lindex $args 0]]=="test.db2-wal"} {
code1 { set ::res2 }
} {hello world ! world hello}
- do_test 5.3 {
+ do_test $TN.5.3 {
code1 { db close }
code1 { tvfs delete }
} {}
catch { code2 { db2 close } }
catch { code3 { db3 close } }
- do_test 6.1 {
+ do_test $TN.6.1 {
code1 { forcedelete test.db }
code1 { sqlite3 db test.db }
sql1 {
INSERT INTO t1 VALUES('hello');
}
- forcecopy test.db test.db2
- forcecopy test.db-wal test.db2-wal
- forcecopy test.db-shm test.db2-shm
+ copy_to_test2 $bZeroShm
code1 { db close }
} {}
- do_test 6.2 {
+ do_test $TN.6.2 {
code1 {
set ::nRem 5
proc handle_read {op args} {
}
} {hello world ! world hello}
- do_test 6.3 {
+ do_test $TN.6.3 {
code1 { db close }
code1 { tvfs delete }
} {}
}
+} ;# foreach bZeroShm
finish_test