Add extra tests to cover untested branches in fts5.

FossilOrigin-Name: 61deab043dcea860070dba6b02601a7de627fff1
This commit is contained in:
dan 2016-01-16 21:06:41 +00:00
parent 2ce1865dd8
commit 3ed7029921
6 changed files with 62 additions and 19 deletions

View File

@ -26,8 +26,6 @@ foreach_detail_mode $testprefix {
fts5_aux_test_functions db
if 1 {
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%);
INSERT INTO t1(t1, rank) VALUES('pgsz', 32);
@ -110,8 +108,6 @@ do_faultsim_test 4.2 -faults oom-t* -body {
{0 {4 {0.0 0.1 0.2} 5 {1.0 1.1 1.2} 6 {2.0 2.1 2.2}}} {1 SQLITE_NOMEM}
}
}
#-------------------------------------------------------------------------
# An OOM within an "ORDER BY rank" query.
@ -134,6 +130,26 @@ do_faultsim_test 5 -faults oom-* -prep {
faultsim_test_result [list 0 {3 2 1}]
}
set doc [string repeat "xyz " 500]
do_execsql_test 6.0 {
CREATE VIRTUAL TABLE yy USING fts5(y, detail=%DETAIL%);
INSERT INTO yy(yy, rank) VALUES('pgsz', 64);
INSERT INTO yy VALUES ($doc);
INSERT INTO yy VALUES ('1 2 3');
INSERT INTO yy VALUES ('xyz');
UPDATE yy SET y = y WHERE rowid = 1;
UPDATE yy SET y = y WHERE rowid = 1;
UPDATE yy SET y = y WHERE rowid = 1;
UPDATE yy SET y = y WHERE rowid = 1;
} {}
do_faultsim_test 6 -faults oom-* -body {
execsql { SELECT rowid FROM yy('xyz') }
} -test {
faultsim_test_result [list 0 {1 3}]
}
} ;# foreach_detail_mode...
finish_test

View File

@ -63,6 +63,7 @@ do_execsql_test 2.2 {
SELECT rnddoc(6), rnddoc(6) FROM r
)
INSERT INTO x1 SELECT * FROM r LIMIT 10000;
DELETE FROM x1 WHERE (rowid%2);
}
set res [db one {SELECT count(*) FROM x1_data}]
@ -71,8 +72,7 @@ do_execsql_test 2.3 {
} $res
do_execsql_test 2.4 {
UPDATE x1_data SET block = X'';
-- SELECT count(fts5_decode(rowid, block)) FROM x1_data;
SELECT count(*) FROM x1_data;
SELECT count(fts5_decode(rowid, block)) FROM x1_data;
} $res
do_execsql_test 2.5 {

View File

@ -87,6 +87,34 @@ do_test 1.4 {
}
} {}
#-------------------------------------------------------------------------
# Lots of deletes/inserts of the same document with the same rowid.
#
do_execsql_test 2.0 {
CREATE VIRTUAL TABLE x2 USING fts5(x, detail=%DETAIL%);
INSERT INTO x2(x2, rank) VALUES('crisismerge', 2);
INSERT INTO x2 VALUES('a b c');
INSERT INTO x2 VALUES('a b c');
}
do_test 2.1 {
for {set i 0} {$i < 1000} {incr i} {
execsql { DELETE FROM x2 WHERE rowid = 2 }
execsql { INSERT INTO x2(rowid, x) VALUES(2, 'a b c') }
}
} {}
do_execsql_test 2.1.integrity {
INSERT INTO x2(x2) VALUES('integrity-check');
}
do_test 2.2 {
for {set i 0} {$i < 1000} {incr i} {
execsql { UPDATE x2 SET x=x WHERE rowid=2 }
}
} {}
do_execsql_test 2.2.integrity {
INSERT INTO x2(x2) VALUES('integrity-check');
}
}
finish_test

View File

@ -334,8 +334,7 @@ TESTSRC += \
$(TOP)/ext/misc/vfslog.c \
$(TOP)/ext/fts5/fts5_tcl.c \
$(TOP)/ext/fts5/fts5_test_mi.c \
$(TOP)/ext/fts5/fts5_test_tok.c \
$(FTS5_SRC)
$(TOP)/ext/fts5/fts5_test_tok.c
#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c

View File

@ -1,5 +1,5 @@
C Improvements\sto\sthe\sway\ssqlite3VdbeAddOpList()\sworks,\sresulting\sin\sa\sslightly\nsmaller\sand\sfaster\sbinary.
D 2016-01-16T20:50:21.742
C Add\sextra\stests\sto\scover\suntested\sbranches\sin\sfts5.
D 2016-01-16T21:06:41.650
F Makefile.in a476545d0c8626224d0bacac85c6e2967474af81
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 01e855f958932d0d3ed62ec675fc63e2cef61fcb
@ -153,7 +153,7 @@ F ext/fts5/test/fts5fault5.test 10c13a783de3f42a21e3e53e123b62ed0c3a1618
F ext/fts5/test/fts5fault6.test 9682664d679643ac6736e90c225526cc84073cda
F ext/fts5/test/fts5fault7.test 01be274bfc8d9bf22451a3bf5892e9399d044f1b
F ext/fts5/test/fts5fault8.test f2d8a2b673a5f72ca1fa0e85bdbfb2041ffd347d
F ext/fts5/test/fts5fault9.test 964a3ee82b95053bd45d809fe2b7acf4a8c90ca9
F ext/fts5/test/fts5fault9.test e10e395428a9ea0596ebe752ff7123d16ab78e08
F ext/fts5/test/fts5full.test 6f6143af0c6700501d9fd597189dfab1555bb741
F ext/fts5/test/fts5hash.test 00668f6fa9b9bffbd7c1be29f408aa2bdade0451
F ext/fts5/test/fts5integrity.test 87db5d4e7da0ce04a1dcba5ba91658673c997a65
@ -171,7 +171,7 @@ F ext/fts5/test/fts5query.test f5ec25f5f2fbb70033424113cdffc101b1985a40
F ext/fts5/test/fts5rank.test 7e9e64eac7245637f6f2033aec4b292aaf611aab
F ext/fts5/test/fts5rebuild.test 03935f617ace91ed23a6099c7c74d905227ff29b
F ext/fts5/test/fts5restart.test c17728fdea26e7d0f617d22ad5b4b2862b994c17
F ext/fts5/test/fts5rowid.test 400384798349d658eaf06aefa1e364957d5d4821
F ext/fts5/test/fts5rowid.test 27a1e18c26d599a80bcabf6f687a4f1d8d29d2d2
F ext/fts5/test/fts5simple.test 2bc6451cbe887a9215f5b14ae307c70d850344c9
F ext/fts5/test/fts5simple2.test 7b51f8d411e9a77fa4519fb09ba5a3afda75c94d
F ext/fts5/test/fts5synonym.test 6475d189c2e20d60795808f83e36bf9318708d48
@ -183,7 +183,7 @@ F ext/fts5/test/fts5unicode.test fbef8d8a3b4b88470536cc57604a82ca52e51841
F ext/fts5/test/fts5unicode2.test c1dd890ba32b7609adba78e420faa847abe43b59
F ext/fts5/test/fts5unicode3.test 35c3d02aa7acf7d43d8de3bfe32c15ba96e8928e
F ext/fts5/test/fts5unindexed.test e9539d5b78c677315e7ed8ea911d4fd25437c680
F ext/fts5/test/fts5update.test 6f0abb89556f0a638b982e010f4d8d1de373a61c
F ext/fts5/test/fts5update.test 57c7012a7919889048947addae10e0613df45529
F ext/fts5/test/fts5version.test 978f59541d8cef7e8591f8be2115ec5ccb863e2e
F ext/fts5/test/fts5vocab.test 480d780aa6b699816c5066225fbd86f3a0239477
F ext/fts5/tool/fts5speed.tcl aaee41894b552df8fbf8616aad003b2ea9ba3221
@ -267,7 +267,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
F main.mk 7575015811ef75a2cfcbc6f09de161cc8236e8a5
F main.mk 8670f56454bdc59d5e33397bf8c7e43eb33af50c
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
@ -1417,7 +1417,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P de77d6026e8035c505a704e7b8cfe5af6579d35f
R e442832cd3e3e0853ec0a993c2468ee7
U drh
Z 51b7d6e877f13b345892ef271baf2a12
P 88ceb588bcdb3ca86d0c58cfdeb61b5fe070872f
R 06f6f18fb8f74fb2b70e371e01be7b37
U dan
Z df25345e1d2056d2ea7917d42461493d

View File

@ -1 +1 @@
88ceb588bcdb3ca86d0c58cfdeb61b5fe070872f
61deab043dcea860070dba6b02601a7de627fff1