From: dan Date: Fri, 16 May 2014 15:48:17 +0000 (+0000) Subject: Add extra test to backcompat.test to ensure that old and new versions of FTS may... X-Git-Tag: version-3.8.5~39^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e82384817d3ce4b1657664bb5233fa573fcd5082;p=thirdparty%2Fsqlite.git Add extra test to backcompat.test to ensure that old and new versions of FTS may work together on the same incremental merge operation. FossilOrigin-Name: 3997d47bb9c8593a2cd30317ea65163b99db1832 --- diff --git a/manifest b/manifest index f12f2aa4a8..543d66fc2f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\scausing\san\sincorrect\ssegment\ssize\svalue\sto\sbe\sstored\sif\sboth\san\sold\sand\snew\sFTS\sversion\sperformed\swork\son\sthe\ssame\sincremental\smerge\soperation. -D 2014-05-16T10:30:44.076 +C Add\sextra\stest\sto\sbackcompat.test\sto\sensure\sthat\sold\sand\snew\sversions\sof\sFTS\smay\swork\stogether\son\sthe\ssame\sincremental\smerge\soperation. +D 2014-05-16T15:48:17.688 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -336,7 +336,7 @@ F test/autoindex1.test 762ff3f8e25d852aae55c6462ca166a80c0cde61 F test/autovacuum.test 941892505d2c0f410a0cb5970dfa1c7c4e5f6e74 F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4 F test/avtrans.test 0252654f4295ddda3b2cce0e894812259e655a85 -F test/backcompat.test 5f8ad58b3eaebc78cd2c66c65476a42e6f32b2ad +F test/backcompat.test 19a1f337c68419b020a7481dd272a472c4ad8ef4 F test/backup.test c9cdd23a495864b9edf75a9fa66f5cb7e10fcf62 F test/backup2.test 34986ef926ea522911a51dfdb2f8e99b7b75ebcf F test/backup4.test 2a2e4a64388090b152de753fd9e123f28f6a3bd4 @@ -1172,7 +1172,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5809986ffcc5d9cbab64760f8d7fbfbb6b626ee7 -R 12132d8d56290c779558e11739c0e6c3 +P a9a2aeab298ba2ac0b8835e61406e2d83bf7e39b +R 03d2cea8f8e26027c7bf9b05231d6fb8 U dan -Z a463ca0b0e1281a342011aafc1248dc1 +Z ba763e498b0d066dca73ae5326487971 diff --git a/manifest.uuid b/manifest.uuid index 0c30c7f481..1f33001479 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a9a2aeab298ba2ac0b8835e61406e2d83bf7e39b \ No newline at end of file +3997d47bb9c8593a2cd30317ea65163b99db1832 \ No newline at end of file diff --git a/test/backcompat.test b/test/backcompat.test index fdc2410b7a..ea7e6a9eed 100644 --- a/test/backcompat.test +++ b/test/backcompat.test @@ -58,12 +58,24 @@ proc do_backcompat_test {rv bin1 bin2 script} { code1 { sqlite3 db test.db } code2 { sqlite3 db test.db } + foreach c {code1 code2} { + $c { + set v [split [db version] .] + if {[llength $v]==3} {lappend v 0} + set ::sqlite_libversion [format \ + "%d%.2d%.2d%2d" [lindex $v 0] [lindex $v 1] [lindex $v 2] [lindex $v 3] + ] + } + } + uplevel $script catch { code1 { db close } } catch { code2 { db close } } catch { close $::bc_chan2 } catch { close $::bc_chan1 } + + } array set ::incompatible [list] @@ -381,6 +393,48 @@ ifcapable fts3 { } { do_test backcompat-3.7 [list sql1 $q] [sql2 $q] } + + # Now test that an incremental merge can be started by one version + # and finished by another. And that the integrity-check still + # passes. + do_test backcompat-3.8 { + sql1 { + DROP TABLE IF EXISTS t1; + DROP TABLE IF EXISTS t2; + CREATE TABLE t1(docid, words); + CREATE VIRTUAL TABLE t2 USING fts3(words); + } + code1 [list source $testdir/genesis.tcl] + code1 { fts_kjv_genesis } + sql1 { + INSERT INTO t2 SELECT words FROM t1; + INSERT INTO t2 SELECT words FROM t1; + INSERT INTO t2 SELECT words FROM t1; + INSERT INTO t2 SELECT words FROM t1; + INSERT INTO t2 SELECT words FROM t1; + INSERT INTO t2 SELECT words FROM t1; + SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level; + } + } {0 {0 1 2 3 4 5}} + + if {[code1 { set ::sqlite_libversion }] >=3071200 + && [code2 { set ::sqlite_libversion }] >=3071200 + } { + do_test backcompat-3.9 { + sql1 { INSERT INTO t2(t2) VALUES('merge=100,4'); } + sql2 { INSERT INTO t2(t2) VALUES('merge=100,4'); } + sql1 { INSERT INTO t2(t2) VALUES('merge=100,4'); } + sql2 { INSERT INTO t2(t2) VALUES('merge=2500,4'); } + sql2 { + SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level; + } + } {0 {0 1} 1 0} + + do_test backcompat-3.10 { + sql1 { INSERT INTO t2(t2) VALUES('integrity-check') } + sql2 { INSERT INTO t2(t2) VALUES('integrity-check') } + } {} + } } } }