Changed multiplex shim's xFilesize to return an error on mismatched chunk size.
Added test of same. FossilOrigin-Name: 6818c6e42faf233afa6b30799c5b425aa42d0783
This commit is contained in:
parent
f5913a27bf
commit
8fcfc3449c
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
||||
C Make\ssure\sa\stest\sof\smultiplex\sshim\sdoesn't\sfail\sif\sa\sfile\salready\sexists.
|
||||
D 2010-12-01T22:08:46
|
||||
C Changed\smultiplex\sshim's\sxFilesize\sto\sreturn\san\serror\son\smismatched\schunk\ssize.\nAdded\stest\sof\ssame.
|
||||
D 2010-12-01T23:42:43
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 4547616ad2286053af6ccccefa242dc925e49bf0
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -207,7 +207,7 @@ F src/test_intarray.h 489edb9068bb926583445cb02589344961054207
|
||||
F src/test_journal.c 785edd54f963aefb3c1628124170a56697c68c70
|
||||
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
|
||||
F src/test_malloc.c 09a88f0c111201dc4f8c20470aa1b5f611d59200
|
||||
F src/test_multiplex.c a324e1fbd546aca59ec4e552fb42aa5142881ea3
|
||||
F src/test_multiplex.c 5990431a852aa21c9a67da748f23d2cf1e21f8fc
|
||||
F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3
|
||||
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
|
||||
F src/test_osinst.c f408c6a181f2fb04c56273afd5c3e1e82f60392c
|
||||
@ -565,7 +565,7 @@ F test/misc5.test 45b2e3ed5f79af2b4f38ae362eaf4c49674575bd
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test c5f4e6a82e04e71820c0f9f64f6733f04c8ae0ae
|
||||
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
|
||||
F test/multiplex.test 3dffa3c64d9c360ed5fc4d306cb207f38ac61ac6
|
||||
F test/multiplex.test 6ceff2b3a5d43f849c267f66bb81adbaec1d5eca
|
||||
F test/mutex1.test 5b71777fc127509cd257910c8db799de557a02de
|
||||
F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
|
||||
F test/nan.test a44e04df1486fcfb02d32468cbcd3c8e1e433723
|
||||
@ -893,7 +893,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
P 7061601f4935af483f4068d257d6f8a9c728fd33
|
||||
R be3df1fcdd63362b61d1190d0e50a188
|
||||
P 80de240a329d8df4aa1e437711bf6ed889d92c5f
|
||||
R 9d689007bef74be6a6722ba1d7a17c9d
|
||||
U shaneh
|
||||
Z a185b27bff85acc7f680ed6845cb5027
|
||||
Z adfe35934b96a87c5f43ce195a5410c9
|
||||
|
@ -1 +1 @@
|
||||
80de240a329d8df4aa1e437711bf6ed889d92c5f
|
||||
6818c6e42faf233afa6b30799c5b425aa42d0783
|
@ -545,8 +545,10 @@ static int multiplexFileSize(sqlite3_file *pConn, sqlite3_int64 *pSize){
|
||||
if( rc2!=SQLITE_OK ){
|
||||
rc = rc2;
|
||||
}else{
|
||||
if( sz>gMultiplex.nChunkSize ){
|
||||
rc = SQLITE_IOERR_FSTAT;
|
||||
}
|
||||
*pSize += sz;
|
||||
assert(sz<=gMultiplex.nChunkSize);
|
||||
}
|
||||
}else{
|
||||
break;
|
||||
|
@ -451,5 +451,42 @@ do_faultsim_test multiplex-5.5 -prep {
|
||||
multiplex_set 32768 16
|
||||
}
|
||||
|
||||
# test that mismatch filesize is detected
|
||||
set all_journal_modes {delete persist truncate memory off}
|
||||
foreach jmode $all_journal_modes {
|
||||
do_test multiplex-5.6.1.$jmode {
|
||||
sqlite3_multiplex_shutdown
|
||||
multiplex_delete test.db
|
||||
sqlite3 db test.db
|
||||
db eval {
|
||||
PRAGMA page_size = 1024;
|
||||
PRAGMA auto_vacuum = off;
|
||||
}
|
||||
db eval "PRAGMA journal_mode = $jmode;"
|
||||
} $jmode
|
||||
do_test multiplex-5.6.2.$jmode {
|
||||
execsql {
|
||||
CREATE TABLE t1(a, b);
|
||||
INSERT INTO t1 VALUES(1, randomblob(1100));
|
||||
INSERT INTO t1 VALUES(2, randomblob(1100));
|
||||
INSERT INTO t1 VALUES(3, randomblob(1100));
|
||||
INSERT INTO t1 VALUES(4, randomblob(1100));
|
||||
INSERT INTO t1 VALUES(5, randomblob(1100));
|
||||
}
|
||||
db close
|
||||
sqlite3_multiplex_initialize "" 1
|
||||
multiplex_set 4096 16
|
||||
sqlite3 db test.db
|
||||
} {}
|
||||
do_test multiplex-5.6.3.$jmode {
|
||||
catchsql {
|
||||
INSERT INTO t1 VALUES(6, randomblob(1100));
|
||||
}
|
||||
} {1 {disk I/O error}}
|
||||
do_test multiplex-5.6.4.$jmode {
|
||||
db close
|
||||
} {}
|
||||
}
|
||||
|
||||
catch { sqlite3_multiplex_shutdown }
|
||||
finish_test
|
||||
|
Loading…
Reference in New Issue
Block a user