diff --git a/ext/fts3/fts3_write.c b/ext/fts3/fts3_write.c index ee5cdb3c0d..6960c31bd1 100644 --- a/ext/fts3/fts3_write.c +++ b/ext/fts3/fts3_write.c @@ -3797,14 +3797,14 @@ static int nodeReaderInit(NodeReader *p, const char *aNode, int nNode){ p->nNode = nNode; /* Figure out if this is a leaf or an internal node. */ - if( p->aNode[0] ){ + if( aNode && aNode[0] ){ /* An internal node. */ p->iOff = 1 + sqlite3Fts3GetVarint(&p->aNode[1], &p->iChild); }else{ p->iOff = 1; } - return nodeReaderNext(p); + return aNode ? nodeReaderNext(p) : SQLITE_OK; } /* @@ -4296,8 +4296,8 @@ static int fts3IncrmergeLoad( NodeReader reader; pNode = &pWriter->aNodeWriter[i]; - rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n); - if( reader.aNode ){ + if( pNode->block.a){ + rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n); while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); blobGrowBuffer(&pNode->key, reader.term.n, &rc); if( rc==SQLITE_OK ){ diff --git a/manifest b/manifest index bf11626237..c673bdb3d4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\sin\sthe\s3.30.0\sbeta\s1\senhancements. -D 2019-09-30T16:49:59.832 +C Bring\sthe\sbegin-concurrent-pnu-wal2\sbranch\sup-to-date\swith\s3.30.0. +D 2019-10-04T16:24:47.090 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -101,7 +101,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004 F ext/fts3/fts3_unicode.c 4b9af6151c29b35ed09574937083cece7c31e911f69615e168a39677569b684d F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f -F ext/fts3/fts3_write.c 6efc4cd7dc554df06c35bfd3335503838645806a78fc33137a55eb97a8b2f3b2 +F ext/fts3/fts3_write.c 13582783abedf905e6946ce95edff7103c07810fb03a9c3b40212d21a3efa09c F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9 F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100 F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73 @@ -495,7 +495,7 @@ F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c 40557ebd69f4115e7a273f9304a8ab637a47ce44f3c6923396928f023967b5e8 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa -F src/loadext.c a045bb3425a9a633cc0f78e93d9beda6866f4c0f15bfdee735aba7c6b39f5cc4 +F src/loadext.c 4ddc65ae13c0d93db0ceedc8b14a28c8c260513448b0eb8c5a2ac375e3b6a85d F src/main.c d702cd01d10eb97648edd655d7194e15bac985dd015df196c9df8a45fb46f74c F src/malloc.c 0f9da2a66b230a5785af94b9672126845099b57b70a32c987d04ac28c69da990 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 @@ -507,7 +507,7 @@ F src/memdb.c 02a5fcec19b9d40dd449ca802dc1b2e8f93f255fbf2a886277a3c3800d8d35db F src/memjournal.c 7561c01c90958f3ba9bc6cb2d857123d932bdfa5539ea34427a0957b2e35154d F src/msvc.h 3a15918220367a8876be3fa4f2abe423a861491e84b864fb2b7426bf022a28f8 F src/mutex.c bae36f8af32c22ad80bbf0ccebec63c252b6a2b86e4d3e42672ff287ebf4a604 -F src/mutex.h 779d588e3b7756ec3ecf7d78cde1d84aba414f85 +F src/mutex.h a7b2293c48db5f27007c3bdb21d438873637d12658f5a0bf8ad025bb96803c4a F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4 F src/mutex_unix.c aaf9ebc3f89df28483c52208497a99a02cc3650011422fc9d4c57e4392f7fe58 F src/mutex_w32.c 7670d770c94bbfe8289bec9d7f1394c5a00a57c37f892aab6b6612d085255235 @@ -533,7 +533,7 @@ F src/random.c f27af4099afaea7284ade5c206224dcfdb2334cfd119d018b470d46356b3f27d F src/resolve.c e021be0c1c4a2125fa38aabcd8dbb764bf5b2c889a948c30d3708430ec6ccd00 F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93 F src/select.c addc1c57cb391158d1d444e237a90b83797395b60214d660715c149c1aeb8bf4 -F src/shell.c.in 026d8a5b3e1c477f23ef027e1ecb4c86e9e3fed0aa922e3825cf4d7feb6bdd69 +F src/shell.c.in d70bcf630c4073eaa994fa74be98886c781918e794cb8b562be8df10f018e274 F src/sqlite.h.in 5c794e32368499d5b9f1a034d426e8d1968f5593aff1ae5efc5197fb32b053e3 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h cef696ce3293242c67b2339763608427bf72ee66f1f3a05389ac2a7b46001c31 @@ -542,7 +542,7 @@ F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6 F src/status.c 46e7aec11f79dad50965a5ca5fa9de009f7d6bde08be2156f1538a0a296d4d0e F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34 F src/tclsqlite.c 50c93be3e1c03b4e6cf6756e5197afcfe7f5cd0497d83a7ac317cde09e19b290 -F src/test1.c dba1b71424954bd61725cdc09d7af44cee99dd9bd58e72b80c743adde5809019 +F src/test1.c e9f578242b276b48f826ea35850aa5077f59a1128a2ff4575356ba27e88f446f F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5 F src/test3.c 61798bb0d38b915067a8c8e03f5a534b431181f802659a6616f9b4ff7d872644 F src/test4.c 405834f6a93ec395cc4c9bb8ecebf7c3d8079e7ca16ae65e82d01afd229694bb @@ -604,7 +604,7 @@ F src/upsert.c 710c91bb13e3c3fed5b6fe17cb13e09560bdd003ad8b8c51e6b16c80cfc48b10 F src/utf.c 2f0fac345c7660d5c5bd3df9e9d8d33d4c27f366bcfb09e07443064d751a0507 F src/util.c fffdfa627be74d69ef425f92db124e7148af449bb8a3286e79577c42bca84061 F src/vacuum.c 0bbe81da32e3adb91bd70d84da38494234857373fb2e94811c4a5eb21cee870d -F src/vdbe.c ca8912c339c5773e1763fb9087d7aaf7fdce8aebc4a144f768ad66445a4c6686 +F src/vdbe.c a81238e51e05e34b14935054cd5115299c05d32c94ce0c128e99b44f99b78ba8 F src/vdbe.h 3f2b571e702e77e6bf031f0236e554aedfae643e991f69000320f481408455cf F src/vdbeInt.h e95de5129124d77f01439e6635012adfaf23c0017bff47296126143cf18bd0c6 F src/vdbeapi.c 95001d0f84ee3cda344fed98ca0d7961deb4fc836b83495630d0af1f7cc4789e @@ -624,7 +624,7 @@ F src/wherecode.c 535c8e228478fd971b9a5b6cb6773995b0fbf7020d5989508a5094ce5b8cd9 F src/whereexpr.c 05c283d26aa9c3f5d1bf13a5f6a573b43295b9db280eff18e26f97d7d7f119b4 F src/window.c 064f251451c8e2a1c76b6269229d911a651e119c6a5f522b6eaebf8dc8714041 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 -F test/affinity2.test da465d3d490ab24ef64f7715b5953343a4967762b9350b29eb1462879ff3fb9e +F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627 F test/affinity3.test 6a101af2fc945ce2912f6fe54dd646018551710d F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggnested.test 12106f0748e8e9bfc1a8e6840e203e051eae06a26ed13fc9fd5db108a8d6db54 @@ -787,7 +787,7 @@ F test/corruptI.test a17bbf54fdde78d43cf3cc34b0057719fd4a173a3d824285b67dc5257c0 F test/corruptJ.test 4d5ccc4bf959464229a836d60142831ef76a5aa4 F test/corruptK.test 5b4212fe346699831c5ad559a62c54e11c0611bdde1ea8423a091f9c01aa32af F test/corruptL.test dfad96373bf9264d73039315ea6013994b90bf6776847adc7ec06b6fad3c04b2 -F test/corruptM.test 04a4061b1979283851953217e411187be79e50f5e5e3ef340c3f8e564173aae1 +F test/corruptM.test 7d574320e08c1b36caa3e47262061f186367d593a7e305d35f15289cc2c3e067 F test/cost.test 51f4fcaae6e78ad5a57096831259ed6c760e2ac6876836e91c00030fad385b34 F test/count.test cb2e0f934c6eb33670044520748d2ecccd46259c F test/countofview.test e17d6e6688cf74f22783c9ec6e788c0790ee4fbbaee713affd00b1ac0bb39b86 @@ -1002,6 +1002,7 @@ F test/fts4merge.test 1096e30b58ad616bd502141bfe5bfe4c3a518df89e958d41a5ed1ce322 F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891 F test/fts4merge3.test 8d9ccb4a3d41c4c617a149d6c4b13ad02de797d0 F test/fts4merge4.test d895b1057a7798b67e03455d0fa50e9ea836c47b +F test/fts4merge5.test 69932d85cda8a1c4dcfb742865900ed8fbda51724b8cf9a45bbe226dfd06c596 F test/fts4noti.test 5553d7bb2e20bf4a06b23e849352efc022ce6309 F test/fts4onepass.test d69ddc4ee3415e40b0c5d1d0408488a87614d4f63ba9c44f3e52db541d6b7cc7 F test/fts4opt.test 0fd0cc84000743ff2a883b9b84b4a5be07249f0ba790c8848a757164cdd46b2a @@ -1236,7 +1237,7 @@ F test/pagesize.test 5769fc62d8c890a83a503f67d47508dfdc543305 F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff -F test/permutations.test f50586ec3c9e02383eba04db24c31cf834bdda65e74846ab098d413216bae157 +F test/permutations.test d25c0732ce4b1a728a064bc7005f1ca628d2301932cfbdda563bbb38b0ce5262 F test/pg_common.tcl 222a1bad1c41c308fa366313cd7b51b3be7e9b21c8736a421b974ac941693b54 F test/pragma.test 59becdfd720b80d463ab750f69f7118fde10dfd556aa5d554f3bf6b7e5ea7533 F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f @@ -1264,7 +1265,7 @@ F test/recover.test ccb8c2623902a92ebb76770edd075cb4f75a4760bb7afde38026572c6e79 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/regexp2.test 40e894223b3d6672655481493f1be12012f2b33c F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2118d -F test/releasetest.tcl 968fc1e8fd23e113fb8a04379747f3a9f2c12d207b2de85aeff5a825962e1cd7 x +F test/releasetest.tcl fb76d8fcc95ac29d6356cd9e52b726ab9e43a24082897618dfbcb7c2b0049153 x F test/releasetest_data.tcl 9919fc6ac5bc92f8878fecfd1840db15999f660a6c9f609240b41aa62b885c88 F test/resetdb.test 8062cf10a09d8c048f8de7711e94571c38b38168db0e5877ba7561789e5eeb2b F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb @@ -1704,7 +1705,7 @@ F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f F test/walthread.test 14b20fcfa6ae152f5d8e12f5dc8a8a724b7ef189f5d8ef1e2ceab79f2af51747 F test/walvfs.test f1accd66c876e3a0f6b4bef5b18d13411062d0ff0a0016e32bb41570474e99fc F test/wapp.tcl b440cd8cf57953d3a49e7ee81e6a18f18efdaf113b69f7d8482b0710a64566ec -F test/wapptest.tcl 3090239c59379d41e1a0644feb6683082fdb86edfab0c668973f8003f22c0e5d x +F test/wapptest.tcl 3cca775aede0591756a1fc0da55bbb3715d8c363873fd2cfdd4d555b0a4af57d x F test/where.test 19c709c9f0f6ed12c23f909f6592aa55fba34269d5a2898537aa27a22b9ce650 F test/where2.test 478d2170637b9211f593120648858593bf2445a1 F test/where3.test 2341a294e17193a6b1699ea7f192124a5286ca6acfcc3f4b06d16c931fbcda2c @@ -1758,13 +1759,13 @@ F test/with2.test e0030e2f0267a910d6c0e4f46f2dfe941c1cc0d4f659ba69b3597728e7e8f1 F test/with3.test b5f1372097690c6ef84db2f13fc7e64a88c7263c3f88493605f90597e8a68d45 F test/with4.test 257be66c0c67fee1defbbac0f685c3465e2cad037f21ce65f23f86084f198205 F test/withM.test 693b61765f2b387b5e3e24a4536e2e82de15ff64 -F test/without_rowid1.test f40c2757272ce171b88e4227f14450db2c4d42800d447baa7656a65562d2f8d9 +F test/without_rowid1.test 0abe18762b74714580c1d4d00a8e540e58966d3e46aae41ddb1a1d2c88c9277d F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99 F test/without_rowid3.test ea4b59dd1b0d7f5f5e4b7cca978cdb905752a9d7c57dc4344a591dba765a3691 F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a F test/without_rowid5.test 89b1c587bd92a0590e440da33e7666bf4891572a -F test/without_rowid6.test 3c1bbf0eb81c672115933158b62b009e67cf1a7f8c2c612bbce63a7385efa18e -F test/without_rowid7.test 0e0d7be00f05f54898e20e07bcc947cd97b42d7106021fa0d2897324bc6d330e +F test/without_rowid6.test 8463b20098e9f75a501a9f17dfb42fffc79068eac0b2775fe56ef2281d2df45e +F test/without_rowid7.test d7c59a93d726b55812d620f8f284e01904a5b85f9ee9eea8f2f68571a5e8c40e F test/wordcount.c d721a4b6fae93e6e33449700bce1686bc23257c27425bc3ef1599dc912adec66 F test/writecrash.test f1da7f7adfe8d7f09ea79b42e5ca6dcc41102f27f8e334ad71539501ddd910cc F test/zeroblob.test 07a5b11ab591d1f26c626945fb7f228f68b993533b2ada77273edf6ee29db174 @@ -1875,7 +1876,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 15593bf3ad9650ce6a6ef8591240eba1be11974d3827cb86ebf0ecec3acda321 918bd97d2946c0a403030fcf0eba596a742ada94b122bf0ac4b808097171056b -R 14a2b6e512944d3eae00258663f0742b +P ebf8872626e71f5fbaefb76e95d218dfa123d15134762c810d6a5f442325154e 16e1dced8b56ef422e5b747dd26accba5bf9f2df69b24b10363ef288890e21ee +R 556acaaef6b1df878b539e6537d27862 U drh -Z b686345ed7e3385b4fd027116b867118 +Z 72dc42d82d67df2be002412a3fb18a38 diff --git a/manifest.uuid b/manifest.uuid index d4acd4078c..56d420a80c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ebf8872626e71f5fbaefb76e95d218dfa123d15134762c810d6a5f442325154e \ No newline at end of file +dd09f7ce970e8b139d105d005a4c99ae0766c1cba6e0794d46bd6879570c33bc \ No newline at end of file diff --git a/src/loadext.c b/src/loadext.c index 03997c0275..423a16fde9 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -463,7 +463,11 @@ static const sqlite3_api_routines sqlite3Apis = { sqlite3_stmt_isexplain, sqlite3_value_frombind, /* Version 3.30.0 and later */ +#ifndef SQLITE_OMIT_VIRTUALTABLE sqlite3_drop_modules, +#else + 0, +#endif }; /* diff --git a/src/mutex.h b/src/mutex.h index 03eb1faadb..a6806a2505 100644 --- a/src/mutex.h +++ b/src/mutex.h @@ -67,4 +67,5 @@ #define MUTEX_LOGIC(X) #else #define MUTEX_LOGIC(X) X +int sqlite3_mutex_held(sqlite3_mutex*); #endif /* defined(SQLITE_MUTEX_OMIT) */ diff --git a/src/shell.c.in b/src/shell.c.in index 549216e32f..7f82675e35 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -9419,7 +9419,7 @@ static int do_meta_command(char *zLine, ShellState *p){ }else #endif /* !defined(SQLITE_OMIT_TRACE) */ -#ifdef SQLITE_DEBUG +#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_VIRTUALTABLE) if( c=='u' && strncmp(azArg[0], "unmodule", n)==0 ){ int ii; int lenOpt; diff --git a/src/test1.c b/src/test1.c index a659a47636..4a8f95bfad 100644 --- a/src/test1.c +++ b/src/test1.c @@ -1131,7 +1131,9 @@ static int SQLITE_TCLAPI test_drop_modules( return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; +#ifndef SQLITE_OMIT_VIRTUALTABLE sqlite3_drop_modules(db, argc>2 ? (const char**)(argv+2) : 0); +#endif return TCL_OK; } diff --git a/src/vdbe.c b/src/vdbe.c index 6070a1f81a..c402b59d36 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -554,7 +554,7 @@ static void memTracePrint(Mem *p){ printf(" i:%lld", p->u.i); #ifndef SQLITE_OMIT_FLOATING_POINT }else if( p->flags & MEM_Real ){ - printf(" r:%g", p->u.r); + printf(" r:%.17g", p->u.r); #endif }else if( sqlite3VdbeMemIsRowSet(p) ){ printf(" (rowset)"); diff --git a/test/affinity2.test b/test/affinity2.test index acdf91c062..6ad257ac36 100644 --- a/test/affinity2.test +++ b/test/affinity2.test @@ -118,14 +118,19 @@ do_execsql_test 507 { # 2019-08-30 ticket https://www.sqlite.org/src/info/40812aea1fde9594 # -do_execsql_test 600 { - DROP TABLE IF EXISTS t0; - CREATE TABLE t0(c0 REAL UNIQUE); - INSERT INTO t0(c0) VALUES (3175546974276630385); - SELECT 3175546974276630385 < c0 FROM t0; -} {1} -do_execsql_test 601 { - SELECT 1 FROM t0 WHERE 3175546974276630385 < c0; -} {1} +# Due to some differences in floating point computations, these tests do not +# work under valgrind. +# +if {![info exists ::G(valgrind)]} { + do_execsql_test 600 { + DROP TABLE IF EXISTS t0; + CREATE TABLE t0(c0 REAL UNIQUE); + INSERT INTO t0(c0) VALUES (3175546974276630385); + SELECT 3175546974276630385 < c0 FROM t0; + } {1} + do_execsql_test 601 { + SELECT 1 FROM t0 WHERE 3175546974276630385 < c0; + } {1} +} finish_test diff --git a/test/corruptM.test b/test/corruptM.test index 0b9f5e4983..15fc8d6d0d 100644 --- a/test/corruptM.test +++ b/test/corruptM.test @@ -22,6 +22,16 @@ set testprefix corruptM # database_may_be_corrupt +proc open_db2_and_catchsql {sql} { + set rc [catch { sqlite3 db2 test.db } msg] + if {$rc} { + return [list $rc $msg] + } + set res [catchsql $sql db2] + db2 close + set res +} + db close forcedelete test.db sqlite3 db test.db @@ -38,165 +48,139 @@ do_execsql_test corruptM-101 { UPDATE sqlite_master SET tbl_name=NULL WHERE name='t1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 {} | index i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-102 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; - } db2 + } } {1 {malformed database schema (t1)}} -db2 close do_execsql_test corruptM-110 { UPDATE sqlite_master SET tbl_name='tx' WHERE name='t1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 tx | index i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-111 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; - } db2 + } } {1 {malformed database schema (t1)}} -db2 close do_execsql_test corruptM-112 { UPDATE sqlite_master SET tbl_name='t1', type='tabl' WHERE name='t1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {tabl t1 t1 | index i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-113 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; - } db2 + } } {1 {malformed database schema (t1)}} -db2 close do_execsql_test corruptM-114 { UPDATE sqlite_master SET tbl_name='t9',type='table',name='t9'WHERE name='t1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t9 t9 | index i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-114 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; - } db2 + } } {1 {malformed database schema (t9)}} -db2 close do_execsql_test corruptM-120 { UPDATE sqlite_master SET name='t1',tbl_name='T1' WHERE name='t9'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 T1 | index i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-121 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {0 {ok 111 222 333 15 22}} -db2 close do_execsql_test corruptM-130 { UPDATE sqlite_master SET type='view' WHERE name='t1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {view t1 T1 | index i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-131 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (t1)}} -db2 close do_execsql_test corruptM-140 { UPDATE sqlite_master SET type='table', tbl_name='t1' WHERE name='t1'; UPDATE sqlite_master SET tbl_name='tx' WHERE name='i1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | index i1 tx | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-141 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (i1)}} -db2 close do_execsql_test corruptM-150 { UPDATE sqlite_master SET type='table', tbl_name='t1' WHERE name='i1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | table i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-151 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (i1)}} -db2 close do_execsql_test corruptM-160 { UPDATE sqlite_master SET type='view', tbl_name='t1' WHERE name='i1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | view i1 t1 | view v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-161 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (i1)}} -db2 close do_execsql_test corruptM-170 { UPDATE sqlite_master SET type='index', tbl_name='t1' WHERE name='i1'; UPDATE sqlite_master SET type='table', tbl_name='v2' WHERE name='v2'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | index i1 t1 | table v2 v2 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-171 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (v2)}} -db2 close do_execsql_test corruptM-180 { UPDATE sqlite_master SET type='view',name='v3',tbl_name='v3' WHERE name='v2'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | index i1 t1 | view v3 v3 | trigger r1 t1 |} -sqlite3 db2 test.db do_test corruptM-181 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (v3)}} -db2 close do_execsql_test corruptM-190 { UPDATE sqlite_master SET type='view',name='v2',tbl_name='v2' WHERE name='v3'; UPDATE sqlite_master SET type='view' WHERE name='r1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | index i1 t1 | view v2 v2 | view r1 t1 |} -sqlite3 db2 test.db do_test corruptM-191 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (r1)}} -db2 close do_execsql_test corruptM-192 { UPDATE sqlite_master SET type='trigger',tbl_name='v2' WHERE name='r1'; SELECT type, name, tbl_name, '|' FROM sqlite_master; } {table t1 t1 | index i1 t1 | view v2 v2 | trigger r1 v2 |} -sqlite3 db2 test.db do_test corruptM-193 { - catchsql { + open_db2_and_catchsql { PRAGMA quick_check; SELECT * FROM t1, v2; - } db2 + } } {1 {malformed database schema (r1)}} -db2 close finish_test diff --git a/test/fts4merge5.test b/test/fts4merge5.test new file mode 100644 index 0000000000..1fad778b95 --- /dev/null +++ b/test/fts4merge5.test @@ -0,0 +1,58 @@ +# 2019 October 02 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#************************************************************************* +# This file implements regression tests for SQLite library. The +# focus of this script is testing the FTS4 module. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +set testprefix fts4merge5 + +# If SQLITE_ENABLE_FTS3 is defined, omit this file. +ifcapable !fts3 { + finish_test + return +} + +source $testdir/genesis.tcl + +do_execsql_test 1.1 { + CREATE TABLE t1(docid, words); +} +fts_kjv_genesis + +do_execsql_test 1.2 { + CREATE VIRTUAL TABLE x1 USING fts3; + INSERT INTO x1(x1) VALUES('nodesize=64'); + INSERT INTO x1(x1) VALUES('maxpending=64'); +} + +do_execsql_test 1.3 { + INSERT INTO x1(docid, content) SELECT * FROM t1; +} + +for {set tn 1} {1} {incr tn} { + set tc1 [db total_changes] + do_execsql_test 1.4.$tn.1 { + INSERT INTO x1(x1) VALUES('merge=1,2'); + } + set tc2 [db total_changes] + + if {($tc2 - $tc1)<2} break + + do_execsql_test 1.4.$tn.1 { + INSERT INTO x1(x1) VALUES('integrity-check'); + } +} + + + +finish_test diff --git a/test/permutations.test b/test/permutations.test index 8a86dd9ce5..55d544fc51 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -125,6 +125,7 @@ set allquicktests [test_set $alltests -exclude { walcrash2.test e_fkey.test backup.test fts4merge.test fts4merge2.test fts4merge4.test fts4check.test + fts4merge5.test fts3cov.test fts3snippet.test fts3corrupt2.test fts3an.test fts3defer.test fts4langid.test fts3sort.test fts5unicode.test @@ -464,8 +465,8 @@ test_suite "coverage-analyze" -description { Coverage tests for file analyze.c. } -files { analyze3.test analyze4.test analyze5.test analyze6.test - analyze7.test analyze8.test analyze9.test analyzeA.test - analyze.test analyzeB.test mallocA.test + analyze7.test analyze8.test analyze9.test + analyze.test mallocA.test } test_suite "coverage-sorter" -description { @@ -643,7 +644,7 @@ test_suite "utf16" -description { } -files { alter.test alter3.test analyze.test analyze3.test analyze4.test analyze5.test analyze6.test - analyze7.test analyze8.test analyze9.test analyzeA.test analyzeB.test + analyze7.test analyze8.test analyze9.test auth.test bind.test blob.test capi2.test capi3.test collate1.test collate2.test collate3.test collate4.test collate5.test collate6.test conflict.test date.test delete.test expr.test fkey1.test func.test diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 997e5eab9f..37f00eb4c0 100755 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -412,6 +412,8 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { # skip over "value is outside range" errors if {[regexp {value .* is outside the range of representable} $line]} { # noop + } elseif {[regexp {overflow: .* cannot be represented} $line]} { + # noop } else { incr ::NERRCASE if {$rc==0} { diff --git a/test/wapptest.tcl b/test/wapptest.tcl index 5753455e2b..201078e78d 100755 --- a/test/wapptest.tcl +++ b/test/wapptest.tcl @@ -825,8 +825,13 @@ for {set i 0} {$i < [llength $argv]} {incr i} { } } +wapptest_init for {set i 0} {$i < [llength $lTestArg]} {incr i} { - switch -- [lindex $lTestArg $i] { + set opt [lindex $lTestArg $i] + if {[string range $opt 0 1]=="--"} { + set opt [string range $opt 1 end] + } + switch -- $opt { -platform { if {$i==[llength $lTestArg]-1} { wapptest_usage } incr i @@ -882,7 +887,6 @@ for {set i 0} {$i < [llength $lTestArg]} {incr i} { } } -wapptest_init if {$G(noui)==0} { wapp-start $lWappArg } else { diff --git a/test/without_rowid1.test b/test/without_rowid1.test index 294b13c77a..23fae118e4 100644 --- a/test/without_rowid1.test +++ b/test/without_rowid1.test @@ -17,6 +17,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix without_rowid1 +proc do_execsql_test_if_vtab {tn sql {res {}}} { + ifcapable vtab { uplevel [list do_execsql_test $tn $sql $res] } +} + # Create and query a WITHOUT ROWID table. # do_execsql_test without_rowid1-1.0 { @@ -31,7 +35,7 @@ do_execsql_test without_rowid1-1.0 { integrity_check without_rowid1-1.0ic -do_execsql_test without_rowid1-1.0ixi { +do_execsql_test_if_vtab without_rowid1-1.0ixi { SELECT name, key FROM pragma_index_xinfo('t1'); } {c 1 a 1 b 0 d 0} @@ -119,7 +123,7 @@ do_execsql_test 2.1.2 { UPDATE t4 SET a = 'ABC'; SELECT * FROM t4; } {ABC def} -do_execsql_test 2.1.3 { +do_execsql_test_if_vtab 2.1.3 { SELECT name, coll, key FROM pragma_index_xinfo('t4'); } {a nocase 1 b BINARY 0} @@ -135,7 +139,7 @@ do_execsql_test 2.2.2 { SELECT * FROM t4; } {xyz ABC} -do_execsql_test 2.2.3 { +do_execsql_test_if_vtab 2.2.3 { SELECT name, coll, key FROM pragma_index_xinfo('t4'); } {a nocase 1 b BINARY 0} @@ -146,7 +150,7 @@ do_execsql_test 2.3.1 { UPDATE t5 SET a='abc', b='def'; } {} -do_execsql_test 2.3.2 { +do_execsql_test_if_vtab 2.3.2 { SELECT name, coll, key FROM pragma_index_xinfo('t5'); } {b BINARY 1 a BINARY 1} @@ -165,7 +169,7 @@ do_execsql_test 2.4.2 { SELECT * FROM t6 ORDER BY c; } {ABC def ghi ABC def ghi} -do_execsql_test 2.4.3 { +do_execsql_test_if_vtab 2.4.3 { SELECT name, coll, key FROM pragma_index_xinfo('t6'); } {b BINARY 1 a nocase 1 c BINARY 0} diff --git a/test/without_rowid6.test b/test/without_rowid6.test index 4ad4d84576..567acfaed6 100644 --- a/test/without_rowid6.test +++ b/test/without_rowid6.test @@ -16,6 +16,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl +proc do_execsql_test_if_vtab {tn sql {res {}}} { + ifcapable vtab { uplevel [list do_execsql_test $tn $sql $res] } +} + do_execsql_test without_rowid6-100 { CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,a,b,c,d,a,b,c)) WITHOUT ROWID; CREATE INDEX t1a ON t1(b, b); @@ -24,7 +28,7 @@ do_execsql_test without_rowid6-100 { INSERT INTO t1(a,b,c,d,e) SELECT i, i+1000, printf('x%dy',i), 0, 0 FROM c; ANALYZE; } {} -do_execsql_test without_rowid6-101 { +do_execsql_test_if_vtab without_rowid6-101 { SELECT name, key FROM pragma_index_xinfo('t1'); } {a 1 b 1 c 1 d 1 e 0} do_execsql_test without_rowid6-110 { @@ -54,7 +58,7 @@ do_execsql_test without_rowid6-200 { INSERT INTO t1(a,b,c) VALUES(1,8,3),(4,5,6),(7,2,9); SELECT a FROM t1 WHERE b>3 ORDER BY b; } {4 1} -do_execsql_test without_rowid6-201 { +do_execsql_test_if_vtab without_rowid6-201 { SELECT name, key FROM pragma_index_xinfo('t1'); } {b 1 a 0 c 0} do_execsql_test without_rowid6-210 { @@ -111,7 +115,7 @@ do_execsql_test without_rowid6-500 { INSERT INTO t1(a,b,c) VALUES(1,8,3),(4,5,6),(7,2,9); SELECT a FROM t1 WHERE b>3 ORDER BY b; } {4 1} -do_execsql_test without_rowid6-501 { +do_execsql_test_if_vtab without_rowid6-501 { SELECT name, key FROM pragma_index_xinfo('t1'); } {b 1 c 1 a 0} do_execsql_test without_rowid6-510 { diff --git a/test/without_rowid7.test b/test/without_rowid7.test index c75ceff35b..56e9fb40b9 100644 --- a/test/without_rowid7.test +++ b/test/without_rowid7.test @@ -15,6 +15,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix without_rowid7 +proc do_execsql_test_if_vtab {tn sql {res {}}} { + ifcapable vtab { uplevel [list do_execsql_test $tn $sql $res] } +} + do_execsql_test 1.0 { CREATE TABLE t1(a, b COLLATE nocase, PRIMARY KEY(a, a, b)) WITHOUT ROWID; } @@ -36,13 +40,13 @@ do_execsql_test 2.1 { do_execsql_test 2.2a { PRAGMA index_info(t2); } {0 0 a 1 0 a} -do_execsql_test 2.2b { +do_execsql_test_if_vtab 2.2b { SELECT *, '|' FROM pragma_index_info('t2'); } {0 0 a | 1 0 a |} do_execsql_test 2.3a { PRAGMA index_xinfo(t2); } {0 0 a 0 nocase 1 1 0 a 0 BINARY 1 2 1 b 0 BINARY 0} -do_execsql_test 2.3b { +do_execsql_test_if_vtab 2.3b { SELECT *, '|' FROM pragma_index_xinfo('t2'); } {0 0 a 0 nocase 1 | 1 0 a 0 BINARY 1 | 2 1 b 0 BINARY 0 |}