mirror of https://github.com/sqlite/sqlite
Merge recent enhancements from trunk, including test scripts enhancements and
the removal of limits on the number of terms in a VALUES clause. FossilOrigin-Name: 5a2dec55bfadc328b430a5231a037b37831a5530
This commit is contained in:
commit
f7af7a17b9
30
Makefile.in
30
Makefile.in
|
@ -22,11 +22,15 @@ TOP = @srcdir@
|
|||
#
|
||||
BCC = @BUILD_CC@ @BUILD_CFLAGS@
|
||||
|
||||
# C Compile and options for use in building executables that
|
||||
# TCC is the C Compile and options for use in building executables that
|
||||
# will run on the target platform. (BCC and TCC are usually the
|
||||
# same unless your are cross-compiling.)
|
||||
# same unless your are cross-compiling.) Separate CC and CFLAGS macros
|
||||
# are provide so that these aspects of the build process can be changed
|
||||
# on the "make" command-line. Ex: "make CC=clang CFLAGS=-fsanitize=undefined"
|
||||
#
|
||||
TCC = @CC@ @CPPFLAGS@ @CFLAGS@ -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
|
||||
CC = @CC@
|
||||
CFLAGS = @CPPFLAGS@ @CFLAGS@
|
||||
TCC = ${CC} ${CFLAGS} -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
|
||||
TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session
|
||||
|
||||
# Define this for the autoconf-based build, so that the code knows it can
|
||||
|
@ -939,19 +943,37 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC)
|
|||
$(LTLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
|
||||
-o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
|
||||
|
||||
|
||||
# A very detailed test running most or all test cases
|
||||
fulltest: testfixture$(TEXE) sqlite3$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/test/all.test
|
||||
|
||||
# Really really long testing
|
||||
soaktest: testfixture$(TEXE) sqlite3$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/test/all.test -soak=1
|
||||
|
||||
# Do extra testing but not aeverything.
|
||||
fulltestonly: testfixture$(TEXE) sqlite3$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/test/full.test
|
||||
|
||||
# This is the common case. Run many tests but not those that take
|
||||
# a really long time.
|
||||
#
|
||||
test: testfixture$(TEXE) sqlite3$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/test/veryquick.test
|
||||
|
||||
# Run a test using valgrind. This can take a really long time
|
||||
# because valgrind is so much slower than a native machine.
|
||||
#
|
||||
valgrindtest: testfixture$(TEXE) sqlite3$(TEXE)
|
||||
OMIT_MISUSE=1 valgrind -v ./testfixture$(TEXE) $(TOP)/test/permutations.test valgrind
|
||||
|
||||
# A very fast test that checks basic sanity. The name comes from
|
||||
# the 60s-era electronics testing: "Turn it on and see if smoke
|
||||
# comes out."
|
||||
#
|
||||
smoketest: testfixture$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/test/main.test
|
||||
|
||||
sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
|
||||
echo "#define TCLSH 2" > $@
|
||||
cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
|
||||
|
|
|
@ -342,7 +342,8 @@ static int fuzzerLoadOneRule(
|
|||
rc = SQLITE_NOMEM;
|
||||
}else{
|
||||
memset(pRule, 0, sizeof(*pRule));
|
||||
pRule->zFrom = &pRule->zTo[nTo+1];
|
||||
pRule->zFrom = pRule->zTo;
|
||||
pRule->zFrom += nTo + 1;
|
||||
pRule->nFrom = nFrom;
|
||||
memcpy(pRule->zFrom, zFrom, nFrom+1);
|
||||
memcpy(pRule->zTo, zTo, nTo+1);
|
||||
|
|
|
@ -1182,7 +1182,7 @@ static RtreeSearchPoint *rtreeEnqueue(
|
|||
pNew = pCur->aPoint + i;
|
||||
pNew->rScore = rScore;
|
||||
pNew->iLevel = iLevel;
|
||||
assert( iLevel>=0 && iLevel<=RTREE_MAX_DEPTH );
|
||||
assert( iLevel<=RTREE_MAX_DEPTH );
|
||||
while( i>0 ){
|
||||
RtreeSearchPoint *pParent;
|
||||
j = (i-1)/2;
|
||||
|
|
71
manifest
71
manifest
|
@ -1,7 +1,7 @@
|
|||
C Merge\sthe\sfix\sto\sPRAGMA\sdata_version\sand\stesting\simprovements\sfrom\strunk.
|
||||
D 2014-12-31T14:27:29.243
|
||||
C Merge\srecent\senhancements\sfrom\strunk,\sincluding\stest\sscripts\senhancements\sand\nthe\sremoval\sof\slimits\son\sthe\snumber\sof\sterms\sin\sa\sVALUES\sclause.
|
||||
D 2015-01-08T20:06:06.740
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in a297ef2900c99073c8b74555f718d3e5cfc44b9a
|
||||
F Makefile.in a90b70e00180a16aae961b712583c854b265b1d5
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
F Makefile.msc 883be4b5950a20bc7e4d72a49ffc5e5905728b54
|
||||
F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0
|
||||
|
@ -111,7 +111,7 @@ F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012
|
|||
F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f
|
||||
F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
|
||||
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
|
||||
F ext/misc/fuzzer.c 136533c53cfce0957f0b48fa11dba27e21c5c01d
|
||||
F ext/misc/fuzzer.c e3e18f47252c151b5553d7e806f38e757d37c4cc
|
||||
F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
|
||||
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
|
||||
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
|
||||
|
@ -124,7 +124,7 @@ F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
|
|||
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
|
||||
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/rtree.c 57bec53e1a677ab74217fe1f20a58c3a47261d6b
|
||||
F ext/rtree/rtree.c a03ebd2480a1a4969cb363bb696d9d911e5a6ecd
|
||||
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
|
||||
F ext/rtree/rtree1.test 541bbcab74613907fea08b2ecdcdd5b7aa724cc9
|
||||
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
|
||||
|
@ -184,7 +184,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
|||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c ba266a779bc7ce10e52e59e7d3dc79fa342e8fdb
|
||||
F src/analyze.c 7a2986e6ea8247e5f21aca3d0b584598f58d84fe
|
||||
F src/analyze.c 91540f835163d5369ccbae78e2e6c74d0dd53c1d
|
||||
F src/attach.c 7f6b3fafa2290b407e4a94dcf1afda7ec0fe394b
|
||||
F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
|
||||
F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea
|
||||
|
@ -203,7 +203,7 @@ F src/expr.c 00da3072f362b06f39ce4052baa1d4ce2bb36d1c
|
|||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c e0444b61bed271a76840cbe6182df93a9baa3f12
|
||||
F src/func.c 6d3c4ebd72aa7923ce9b110a7dc15f9b8c548430
|
||||
F src/global.c 6ded36dda9466fc1c9a3c5492ded81d79bf3977d
|
||||
F src/global.c 12561d70a1b25f67b21154622bb1723426724f75
|
||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||
F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
|
||||
|
@ -212,7 +212,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
|
|||
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
|
||||
F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
|
||||
F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660
|
||||
F src/main.c 0e2e16ee46e5a33032ee3741dd120499daa721e2
|
||||
F src/main.c 1b20d9b1b74d4c4183d7654a796b62f46e8b1cae
|
||||
F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f
|
||||
|
@ -230,12 +230,12 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
|
|||
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
||||
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
||||
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||
F src/os_unix.c 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7
|
||||
F src/os_unix.c 949cdedc74dbf3c17f2c9743064ce307026f871e
|
||||
F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007
|
||||
F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21
|
||||
F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
|
||||
F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77
|
||||
F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45
|
||||
F src/parse.y c5d0d964f9ac023e8154cad512e54b0b6058e086
|
||||
F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599
|
||||
F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8
|
||||
F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf
|
||||
|
@ -245,24 +245,24 @@ F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236
|
|||
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
|
||||
F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada
|
||||
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
||||
F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75
|
||||
F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df
|
||||
F src/shell.c 81e4f2b57396db0714bc73d1f95cf3970f5dcc10
|
||||
F src/sqlite.h.in cf011109d67863c1e621d7b22c5c16d8d70c3bfd
|
||||
F src/sqlite.h.in 08c35d8b77e65a54fd7e9819a7d8ceaf63a65d50
|
||||
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
|
||||
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
|
||||
F src/sqliteInt.h 69c302a3b13d06ebaada7f85497106077df00a24
|
||||
F src/sqliteInt.h 892f2d3ba1f3b94572259addfc5a25f8db18c316
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 81712116e826b0089bb221b018929536b2b5406f
|
||||
F src/table.c e7a09215315a978057fb42c640f890160dbcc45e
|
||||
F src/tclsqlite.c 95452a59e1afd0cbce10d5243c480b0d5e1e5f59
|
||||
F src/test1.c 041c4edf2f9c49a329add297e26ee86a83852f51
|
||||
F src/test1.c 460d39e7abbcd0c61c9788c06e0d925f4d1e6a22
|
||||
F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712
|
||||
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
|
||||
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
|
||||
F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1
|
||||
F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723
|
||||
F src/test7.c 72b732baa5642f795655ba1126ea032af46ecfd2
|
||||
F src/test8.c 54ccd7b1df5062f0ecbf50a8f7b618f8b1f13b20
|
||||
F src/test8.c bf3bad9a7df2e7c58d3371ea913abeaedb429a38
|
||||
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
|
||||
F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8
|
||||
F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
|
||||
|
@ -280,7 +280,7 @@ F src/test_intarray.c 6c610a21ab8edde85a3a2c7f2b069244ecf4d834
|
|||
F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202
|
||||
F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64
|
||||
F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4
|
||||
F src/test_malloc.c ba34143f941a9d74b30bbffc8818389bb73a1ca2
|
||||
F src/test_malloc.c fffc66b2e7743ce93f039187d3fd78664193c664
|
||||
F src/test_multiplex.c caadb62cc777268b4f8fb94d5b27b80156c8f7c0
|
||||
F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3
|
||||
F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f
|
||||
|
@ -301,7 +301,7 @@ F src/test_thread.c 1e133a40b50e9c035b00174035b846e7eef481cb
|
|||
F src/test_vfs.c f84075a388527892ff184988f43b69ce69b8083c
|
||||
F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 6de09362b657f19ba83e5fa521ee715787ce9fee
|
||||
F src/threads.c 2fb3ea4d70d5acf68b539c2489b4adace61cc01b
|
||||
F src/tokenize.c e00458c9938072b0ea711c850b8dcf4ddcb5fe18
|
||||
F src/trigger.c 25571661fdeae8c7f975ff40ffec205520a3f92f
|
||||
F src/update.c d207deb7a031f698104bee879de0632b611e72dd
|
||||
|
@ -315,7 +315,7 @@ F src/vdbeapi.c 90aeb4b3f1dc86d6576a2ce2d5bad12761329bd5
|
|||
F src/vdbeaux.c db4cf9f69c415318fbc19c2e0d2efd693fbe51af
|
||||
F src/vdbeblob.c cb7359c2d99df92c35cdaedc12af6d4f83854cb7
|
||||
F src/vdbemem.c 96e41193b4affd9ebc0eea2fa628879dac88c744
|
||||
F src/vdbesort.c 80e40d889ebb536cb7a5ac4c12fa2a4662bc9181
|
||||
F src/vdbesort.c 560bdfd9eb3ae3205196e0d64ccd1de925caa6c7
|
||||
F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010
|
||||
F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9
|
||||
F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e
|
||||
|
@ -383,7 +383,7 @@ F test/between.test 34d375fb5ce1ae283ffe82b6b233e9f38e84fc6c
|
|||
F test/bigfile.test aa74f4e5db51c8e54a1d9de9fa65d01d1eb20b59
|
||||
F test/bigfile2.test 1b489a3a39ae90c7f027b79110d6b4e1dbc71bfc
|
||||
F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747
|
||||
F test/bigsort.test 835478d0ce83bd1e5b05c90571dedd9871a09196
|
||||
F test/bigsort.test 8299fa9298f4f1e02fc7d2712e8b77d6cd60e5a2
|
||||
F test/bind.test 3c7b320969000c441a70952b0b15938fbb66237c
|
||||
F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0
|
||||
F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142
|
||||
|
@ -518,7 +518,7 @@ F test/fkey1.test e1d1fa84cde579185ea01358436839703e415a5b
|
|||
F test/fkey2.test 1db212cda86b0d3ce72714001f7b6381c321341c
|
||||
F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49
|
||||
F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d
|
||||
F test/fkey5.test 8a1fde4e7721ae00b05b3178888833726ca2df8d
|
||||
F test/fkey5.test 488601fbda8350619b3029487e56830447056fd2
|
||||
F test/fkey6.test 6697550baa38505c9952eff130ab26a2d156c0cc
|
||||
F test/fkey7.test 72e915890ee4a005daaf3002cb208e8fe973ac13
|
||||
F test/fkey8.test 8f08203458321e6c19a263829de4cfc936274ab0
|
||||
|
@ -716,7 +716,7 @@ F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
|
|||
F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431
|
||||
F test/lock_common.tcl 0c270b121d40959fa2f3add382200c27045b3d95
|
||||
F test/lookaside.test 93f07bac140c5bb1d49f3892d2684decafdc7af2
|
||||
F test/main.test 39c4bb8a157f57298ed1659d6df89d9f35aaf2c8
|
||||
F test/main.test 16131264ea0c2b93b95201f0c92958e85f2ba11a
|
||||
F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9
|
||||
F test/malloc.test 96939d2d1a6f39667bbebe5bc27c6525f2ab614e
|
||||
F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a
|
||||
|
@ -744,7 +744,7 @@ F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e
|
|||
F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f
|
||||
F test/memdb.test fcb5297b321b562084fc79d64d5a12a1cd2b639b
|
||||
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
|
||||
F test/memsubsys1.test bf270964ab83bc2da5927960f78304a866fb9a9d
|
||||
F test/memsubsys1.test 690d142525a7d31efb638b0d232e25fac3afeb1a
|
||||
F test/memsubsys2.test 3a1c1a9de48e5726faa85108b02459fae8cb9ee9
|
||||
F test/minmax.test 42fbad0e81afaa6e0de41c960329f2b2c3526efd
|
||||
F test/minmax2.test b44bae787fc7b227597b01b0ca5575c7cb54d3bc
|
||||
|
@ -785,7 +785,7 @@ F test/orderby4.test 4d39bfbaaa3ae64d026ca2ff166353d2edca4ba4
|
|||
F test/orderby5.test 8f08a54836d21fb7c70245360751aedd1c2286fb
|
||||
F test/orderby6.test 8b38138ab0972588240b3fca0985d2e400432859
|
||||
F test/orderby7.test 3d1383d52ade5b9eb3a173b3147fdd296f0202da
|
||||
F test/oserror.test 50417780d0e0d7cd23cf12a8277bb44024765df3
|
||||
F test/oserror.test 14fec2796c2b6fe431c7823750e8a18a761176d7
|
||||
F test/ovfl.test 4f7ca651cba5c059a12d8c67dddd49bec5747799
|
||||
F test/pager1.test 1acbdb14c5952a72dd43129cabdbf69aaa3ed1fa
|
||||
F test/pager2.test 67b8f40ae98112bcdba1f2b2d03ea83266418c71
|
||||
|
@ -798,8 +798,8 @@ F test/pageropt.test 6b8f6a123a5572c195ad4ae40f2987007923bbd6
|
|||
F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
|
||||
F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d
|
||||
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
|
||||
F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54
|
||||
F test/permutations.test 252900b9a89018e6f9458831ae90521e1456593c
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test eccbf3203f155846298ad5b1a7255c4dd49ac325
|
||||
F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5
|
||||
F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
|
||||
F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
|
||||
|
@ -818,7 +818,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
|
|||
F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a
|
||||
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.tcl 8f35e5073901e48a634a649462fa2e7e522e9dc0
|
||||
F test/releasetest.tcl 1e68ec50478dce13b374904668fb7e09409371fb
|
||||
F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a
|
||||
F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
|
||||
F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14
|
||||
|
@ -857,6 +857,7 @@ F test/selectC.test 871fb55d884d3de5943c4057ebd22c2459e71977
|
|||
F test/selectD.test b0f02a04ef7737decb24e08be2c39b9664b43394
|
||||
F test/selectE.test fc02a1eb04c8eb537091482644b7d778ae8759b7
|
||||
F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3
|
||||
F test/selectG.test e8600e379589e85e9fefd2fe4d44a4cdd63f6982
|
||||
F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118
|
||||
F test/session.test 78fa2365e93d3663a6e933f86e7afc395adf18be
|
||||
F test/shared.test 1da9dbad400cee0d93f252ccf76e1ae007a63746
|
||||
|
@ -887,12 +888,12 @@ F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2
|
|||
F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b
|
||||
F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f
|
||||
F test/softheap1.test 40562fe6cac6d9827b7b42b86d45aedf12c15e24
|
||||
F test/sort.test c4400e7533748f6bd7413851ff148645e82b9e2d
|
||||
F test/sort2.test 84a92eebf697feee9c6697746918c7d67373eea1
|
||||
F test/sort.test 3f492e5b7be1d3f756728d2ff6edf4f6091e84cb
|
||||
F test/sort2.test 37afbc03f5559f2eb0f18940b55d38dfbb5172ac
|
||||
F test/sort3.test 6178ade30810ac9166fcdf14b7065e49c0f534e2
|
||||
F test/sort4.test 6c37d85f7cd28d50cce222fcab84ccd771e105cb
|
||||
F test/sort4.test d5e8903194ae551551349ce25dc8d0b40ca2b9c3
|
||||
F test/sort5.test a448240a42b49239edc00f85d6d7ac7a1b261e1f
|
||||
F test/sortfault.test b8e35177f97438b930ee87c9419ca2599e8073e1
|
||||
F test/sortfault.test d4ccf606a0c77498e2beb542764fd9394acb4d66
|
||||
F test/speed1.test f2974a91d79f58507ada01864c0e323093065452
|
||||
F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb
|
||||
F test/speed1p.test b180e98609c7677382cf618c0ec9b69f789033a8
|
||||
|
@ -932,7 +933,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
|
|||
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
|
||||
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
|
||||
F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
|
||||
F test/threadtest3.c 66c2693d888f9ed256d54d70dd60f569d92c12cf
|
||||
F test/threadtest3.c 9ab4b168681c3a6f70f6c833ba08e0d48dd4af9b
|
||||
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
|
||||
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
|
||||
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
|
||||
|
@ -1210,7 +1211,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
|
|||
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
|
||||
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
|
||||
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
|
||||
F tool/lemon.c 3ff0fec22f92dfb54e62eeb48772eddffdbeb0d6
|
||||
F tool/lemon.c 20f3132a1a150d50b022aa0b1fa26bd46aebf7b5
|
||||
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
|
||||
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
|
||||
F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b
|
||||
|
@ -1252,7 +1253,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
|||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 315243e49d30abd0eb31e3795ecf492aee179e4b cf48eb608af9102a8def2a5b7f5f7b348548116f
|
||||
R 3c78b315e0de46f71ce8985baa898853
|
||||
P 86e39123c1bca457672bc63eff00a823745077e5 50b5a8af843fff93452cd1c8f82152124a1d864a
|
||||
R 67779bbdb7710c0ef643df0ef1caefea
|
||||
U drh
|
||||
Z c5bac6e43352272a84a70be7a0122952
|
||||
Z d1795e9058f081650515c9a852afa236
|
||||
|
|
|
@ -1 +1 @@
|
|||
86e39123c1bca457672bc63eff00a823745077e5
|
||||
5a2dec55bfadc328b430a5231a037b37831a5530
|
|
@ -448,7 +448,7 @@ static void statInit(
|
|||
p->mxSample = mxSample;
|
||||
p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1);
|
||||
p->current.anLt = &p->current.anEq[nColUp];
|
||||
p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[2])*0xd0944565;
|
||||
p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]);
|
||||
|
||||
/* Set up the Stat4Accum.a[] and aBest[] arrays */
|
||||
p->a = (struct Stat4Sample*)&p->current.anLt[nColUp];
|
||||
|
|
|
@ -152,6 +152,13 @@ const unsigned char sqlite3CtypeMap[256] = {
|
|||
# define SQLITE_ALLOW_COVERING_INDEX_SCAN 1
|
||||
#endif
|
||||
|
||||
/* The minimum PMA size is set to this value multiplied by the database
|
||||
** page size in bytes.
|
||||
*/
|
||||
#ifndef SQLITE_SORTER_PMASZ
|
||||
# define SQLITE_SORTER_PMASZ 250
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The following singleton contains the global configuration for
|
||||
** the SQLite library.
|
||||
|
@ -182,6 +189,7 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = {
|
|||
0, /* nPage */
|
||||
0, /* mxParserStack */
|
||||
0, /* sharedCacheEnabled */
|
||||
SQLITE_SORTER_PMASZ, /* szPma */
|
||||
/* All the rest should always be initialized to zero */
|
||||
0, /* isInit */
|
||||
0, /* inProgress */
|
||||
|
|
|
@ -594,6 +594,11 @@ int sqlite3_config(int op, ...){
|
|||
}
|
||||
#endif
|
||||
|
||||
case SQLITE_CONFIG_PMASZ: {
|
||||
sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
rc = SQLITE_ERROR;
|
||||
break;
|
||||
|
|
|
@ -3717,6 +3717,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
|
|||
** that do not have a real fallocate() call.
|
||||
*/
|
||||
int nBlk = buf.st_blksize; /* File-system block size */
|
||||
int nWrite = 0; /* Number of bytes written by seekAndWrite */
|
||||
i64 iWrite; /* Next offset to write to */
|
||||
|
||||
iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1;
|
||||
|
@ -3724,11 +3725,11 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
|
|||
assert( (iWrite/nBlk)==((buf.st_size+nBlk-1)/nBlk) );
|
||||
assert( ((iWrite+1)%nBlk)==0 );
|
||||
for(/*no-op*/; iWrite<nSize; iWrite+=nBlk ){
|
||||
int nWrite = seekAndWrite(pFile, iWrite, "", 1);
|
||||
nWrite = seekAndWrite(pFile, iWrite, "", 1);
|
||||
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
|
||||
}
|
||||
if( nSize%nBlk ){
|
||||
int nWrite = seekAndWrite(pFile, nSize-1, "", 1);
|
||||
if( nWrite==0 || (nSize%nBlk) ){
|
||||
nWrite = seekAndWrite(pFile, nSize-1, "", 1);
|
||||
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
|
||||
}
|
||||
#endif
|
||||
|
|
10
src/parse.y
10
src/parse.y
|
@ -415,13 +415,19 @@ select(A) ::= with(W) selectnowith(X). {
|
|||
int cnt = 0, mxSelect;
|
||||
p->pWith = W;
|
||||
if( p->pPrior ){
|
||||
u16 allValues = SF_Values;
|
||||
pNext = 0;
|
||||
for(pLoop=p; pLoop; pNext=pLoop, pLoop=pLoop->pPrior, cnt++){
|
||||
pLoop->pNext = pNext;
|
||||
pLoop->selFlags |= SF_Compound;
|
||||
allValues &= pLoop->selFlags;
|
||||
}
|
||||
mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT];
|
||||
if( mxSelect && cnt>mxSelect ){
|
||||
if( allValues ){
|
||||
p->selFlags |= SF_AllValues;
|
||||
}else if(
|
||||
(mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0
|
||||
&& cnt>mxSelect
|
||||
){
|
||||
sqlite3ErrorMsg(pParse, "too many terms in compound SELECT");
|
||||
}
|
||||
}
|
||||
|
|
121
src/select.c
121
src/select.c
|
@ -58,20 +58,25 @@ struct SortCtx {
|
|||
#define SORTFLAG_UseSorter 0x01 /* Use SorterOpen instead of OpenEphemeral */
|
||||
|
||||
/*
|
||||
** Delete all the content of a Select structure but do not deallocate
|
||||
** the select structure itself.
|
||||
** Delete all the content of a Select structure. Deallocate the structure
|
||||
** itself only if bFree is true.
|
||||
*/
|
||||
static void clearSelect(sqlite3 *db, Select *p){
|
||||
sqlite3ExprListDelete(db, p->pEList);
|
||||
sqlite3SrcListDelete(db, p->pSrc);
|
||||
sqlite3ExprDelete(db, p->pWhere);
|
||||
sqlite3ExprListDelete(db, p->pGroupBy);
|
||||
sqlite3ExprDelete(db, p->pHaving);
|
||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||
sqlite3SelectDelete(db, p->pPrior);
|
||||
sqlite3ExprDelete(db, p->pLimit);
|
||||
sqlite3ExprDelete(db, p->pOffset);
|
||||
sqlite3WithDelete(db, p->pWith);
|
||||
static void clearSelect(sqlite3 *db, Select *p, int bFree){
|
||||
while( p ){
|
||||
Select *pPrior = p->pPrior;
|
||||
sqlite3ExprListDelete(db, p->pEList);
|
||||
sqlite3SrcListDelete(db, p->pSrc);
|
||||
sqlite3ExprDelete(db, p->pWhere);
|
||||
sqlite3ExprListDelete(db, p->pGroupBy);
|
||||
sqlite3ExprDelete(db, p->pHaving);
|
||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||
sqlite3ExprDelete(db, p->pLimit);
|
||||
sqlite3ExprDelete(db, p->pOffset);
|
||||
sqlite3WithDelete(db, p->pWith);
|
||||
if( bFree ) sqlite3DbFree(db, p);
|
||||
p = pPrior;
|
||||
bFree = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -130,8 +135,7 @@ Select *sqlite3SelectNew(
|
|||
pNew->addrOpenEphm[0] = -1;
|
||||
pNew->addrOpenEphm[1] = -1;
|
||||
if( db->mallocFailed ) {
|
||||
clearSelect(db, pNew);
|
||||
if( pNew!=&standin ) sqlite3DbFree(db, pNew);
|
||||
clearSelect(db, pNew, pNew!=&standin);
|
||||
pNew = 0;
|
||||
}else{
|
||||
assert( pNew->pSrc!=0 || pParse->nErr>0 );
|
||||
|
@ -156,10 +160,7 @@ void sqlite3SelectSetName(Select *p, const char *zName){
|
|||
** Delete the given Select structure and all of its substructures.
|
||||
*/
|
||||
void sqlite3SelectDelete(sqlite3 *db, Select *p){
|
||||
if( p ){
|
||||
clearSelect(db, p);
|
||||
sqlite3DbFree(db, p);
|
||||
}
|
||||
clearSelect(db, p, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2075,6 +2076,66 @@ static int multiSelectOrderBy(
|
|||
SelectDest *pDest /* What to do with query results */
|
||||
);
|
||||
|
||||
/*
|
||||
** Error message for when two or more terms of a compound select have different
|
||||
** size result sets.
|
||||
*/
|
||||
static void selectWrongNumTermsError(Parse *pParse, Select *p){
|
||||
if( p->selFlags & SF_Values ){
|
||||
sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms");
|
||||
}else{
|
||||
sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
|
||||
" do not have the same number of result columns", selectOpName(p->op));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Handle the special case of a compound-select that originates from a
|
||||
** VALUES clause. By handling this as a special case, we avoid deep
|
||||
** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT
|
||||
** on a VALUES clause.
|
||||
**
|
||||
** Because the Select object originates from a VALUES clause:
|
||||
** (1) It has no LIMIT or OFFSET
|
||||
** (2) All terms are UNION ALL
|
||||
** (3) There is no ORDER BY clause
|
||||
*/
|
||||
static int multiSelectValues(
|
||||
Parse *pParse, /* Parsing context */
|
||||
Select *p, /* The right-most of SELECTs to be coded */
|
||||
SelectDest *pDest /* What to do with query results */
|
||||
){
|
||||
Select *pPrior;
|
||||
int nExpr = p->pEList->nExpr;
|
||||
int nRow = 1;
|
||||
int rc = 0;
|
||||
assert( p->pNext==0 );
|
||||
assert( p->selFlags & SF_AllValues );
|
||||
do{
|
||||
assert( p->selFlags & SF_Values );
|
||||
assert( p->op==TK_ALL || (p->op==TK_SELECT && p->pPrior==0) );
|
||||
assert( p->pLimit==0 );
|
||||
assert( p->pOffset==0 );
|
||||
if( p->pEList->nExpr!=nExpr ){
|
||||
selectWrongNumTermsError(pParse, p);
|
||||
return 1;
|
||||
}
|
||||
if( p->pPrior==0 ) break;
|
||||
assert( p->pPrior->pNext==p );
|
||||
p = p->pPrior;
|
||||
nRow++;
|
||||
}while(1);
|
||||
while( p ){
|
||||
pPrior = p->pPrior;
|
||||
p->pPrior = 0;
|
||||
rc = sqlite3Select(pParse, p, pDest);
|
||||
p->pPrior = pPrior;
|
||||
if( rc ) break;
|
||||
p->nSelectRow = nRow;
|
||||
p = p->pNext;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** This routine is called to process a compound query form from
|
||||
|
@ -2156,17 +2217,19 @@ static int multiSelect(
|
|||
dest.eDest = SRT_Table;
|
||||
}
|
||||
|
||||
/* Special handling for a compound-select that originates as a VALUES clause.
|
||||
*/
|
||||
if( p->selFlags & SF_AllValues ){
|
||||
rc = multiSelectValues(pParse, p, &dest);
|
||||
goto multi_select_end;
|
||||
}
|
||||
|
||||
/* Make sure all SELECTs in the statement have the same number of elements
|
||||
** in their result sets.
|
||||
*/
|
||||
assert( p->pEList && pPrior->pEList );
|
||||
if( p->pEList->nExpr!=pPrior->pEList->nExpr ){
|
||||
if( p->selFlags & SF_Values ){
|
||||
sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms");
|
||||
}else{
|
||||
sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
|
||||
" do not have the same number of result columns", selectOpName(p->op));
|
||||
}
|
||||
selectWrongNumTermsError(pParse, p);
|
||||
rc = 1;
|
||||
goto multi_select_end;
|
||||
}
|
||||
|
@ -4052,7 +4115,9 @@ static int selectExpander(Walker *pWalker, Select *p){
|
|||
}
|
||||
pTabList = p->pSrc;
|
||||
pEList = p->pEList;
|
||||
sqlite3WithPush(pParse, findRightmost(p)->pWith, 0);
|
||||
if( pWalker->xSelectCallback2==selectPopWith ){
|
||||
sqlite3WithPush(pParse, findRightmost(p)->pWith, 0);
|
||||
}
|
||||
|
||||
/* Make sure cursor numbers have been assigned to all entries in
|
||||
** the FROM clause of the SELECT statement.
|
||||
|
@ -4343,7 +4408,9 @@ static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
|
|||
sqlite3WalkSelect(&w, pSelect);
|
||||
}
|
||||
w.xSelectCallback = selectExpander;
|
||||
w.xSelectCallback2 = selectPopWith;
|
||||
if( (pSelect->selFlags & SF_AllValues)==0 ){
|
||||
w.xSelectCallback2 = selectPopWith;
|
||||
}
|
||||
sqlite3WalkSelect(&w, pSelect);
|
||||
}
|
||||
|
||||
|
|
|
@ -1745,6 +1745,17 @@ struct sqlite3_mem_methods {
|
|||
** bytes per page required for each page in [SQLITE_CONFIG_PAGECACHE].
|
||||
** The amount of extra space required can change depending on the compiler,
|
||||
** target platform, and SQLite version.
|
||||
**
|
||||
** [[SQLITE_CONFIG_PMASZ]]
|
||||
** <dt>SQLITE_CONFIG_PMASZ
|
||||
** <dd>^The SQLITE_CONFIG_PMASZ option takes a single parameter which
|
||||
** is an unsigned integer and sets the "Minimum PMA Size" for the multithreaded
|
||||
** sorter to that integer. The default minimum PMA Size is set by the
|
||||
** [SQLITE_SORTER_PMASZ] compile-time option. New threads are launched
|
||||
** to help with sort operations when multithreaded sorting
|
||||
** is enabled (using the [PRAGMA threads] command) and the amount of content
|
||||
** to be sorted exceeds the page size times the minimum of the
|
||||
** [PRAGMA cache_size] setting and this value.
|
||||
** </dl>
|
||||
*/
|
||||
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
|
||||
|
@ -1771,6 +1782,7 @@ struct sqlite3_mem_methods {
|
|||
#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
|
||||
#define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */
|
||||
#define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */
|
||||
#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */
|
||||
|
||||
/*
|
||||
** CAPI3REF: Database Connection Configuration Options
|
||||
|
|
|
@ -2357,7 +2357,7 @@ struct Select {
|
|||
#define SF_HasTypeInfo 0x0020 /* FROM subqueries have Table metadata */
|
||||
#define SF_Compound 0x0040 /* Part of a compound query */
|
||||
#define SF_Values 0x0080 /* Synthesized from VALUES clause */
|
||||
/* 0x0100 NOT USED */
|
||||
#define SF_AllValues 0x0100 /* All terms of compound are VALUES */
|
||||
#define SF_NestedFrom 0x0200 /* Part of a parenthesized FROM clause */
|
||||
#define SF_MaybeConvert 0x0400 /* Need convertCompoundSelectToSubquery() */
|
||||
#define SF_Recursive 0x0800 /* The recursive part of a recursive CTE */
|
||||
|
@ -2851,6 +2851,7 @@ struct Sqlite3Config {
|
|||
int nPage; /* Number of pages in pPage[] */
|
||||
int mxParserStack; /* maximum depth of the parser stack */
|
||||
int sharedCacheEnabled; /* true if shared-cache mode enabled */
|
||||
u32 szPma; /* Maximum Sorter PMA size */
|
||||
/* The above might be initialized to non-zero. The following need to always
|
||||
** initially be zero, however. */
|
||||
int isInit; /* True after initialization has finished */
|
||||
|
|
59
src/test1.c
59
src/test1.c
|
@ -261,6 +261,8 @@ static int test_io_trace(
|
|||
**
|
||||
** Returns true if the program was compiled using clang with the
|
||||
** -fsanitize=address switch on the command line. False otherwise.
|
||||
**
|
||||
** Also return true if the OMIT_MISUSE environment variable exists.
|
||||
*/
|
||||
static int clang_sanitize_address(
|
||||
void *NotUsed,
|
||||
|
@ -274,6 +276,7 @@ static int clang_sanitize_address(
|
|||
res = 1;
|
||||
# endif
|
||||
#endif
|
||||
if( res==0 && getenv("OMIT_MISUSE")!=0 ) res = 1;
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(res));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
@ -6604,6 +6607,60 @@ static int test_user_delete(
|
|||
}
|
||||
#endif /* SQLITE_USER_AUTHENTICATION */
|
||||
|
||||
/*
|
||||
** tclcmd: bad_behavior TYPE
|
||||
**
|
||||
** Do some things that should trigger a valgrind or -fsanitize=undefined
|
||||
** warning. This is used to verify that errors and warnings output by those
|
||||
** tools are detected by the test scripts.
|
||||
**
|
||||
** TYPE BEHAVIOR
|
||||
** 1 Overflow a signed integer
|
||||
** 2 Jump based on an uninitialized variable
|
||||
** 3 Read after free
|
||||
*/
|
||||
static int test_bad_behavior(
|
||||
ClientData clientData, /* Pointer to an integer containing zero */
|
||||
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *CONST objv[] /* Command arguments */
|
||||
){
|
||||
int iType;
|
||||
int xyz;
|
||||
int i = *(int*)clientData;
|
||||
int j;
|
||||
int w[10];
|
||||
int *a;
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "TYPE");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( Tcl_GetIntFromObj(interp, objv[1], &iType) ) return TCL_ERROR;
|
||||
switch( iType ){
|
||||
case 1: {
|
||||
xyz = 0x7fffff00 - i;
|
||||
xyz += 0x100;
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(xyz));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
w[1] = 5;
|
||||
if( w[i]>0 ) w[1]++;
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(w[1]));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
a = malloc( sizeof(int)*10 );
|
||||
for(j=0; j<10; j++) a[j] = j;
|
||||
free(a);
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(a[i]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Register commands with the TCL interpreter.
|
||||
*/
|
||||
|
@ -6620,6 +6677,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
|||
extern int sqlite3_max_blobsize;
|
||||
extern int sqlite3BtreeSharedCacheReport(void*,
|
||||
Tcl_Interp*,int,Tcl_Obj*CONST*);
|
||||
static int iZero = 0;
|
||||
static struct {
|
||||
char *zName;
|
||||
Tcl_CmdProc *xProc;
|
||||
|
@ -6672,6 +6730,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
|||
Tcl_ObjCmdProc *xProc;
|
||||
void *clientData;
|
||||
} aObjCmd[] = {
|
||||
{ "bad_behavior", test_bad_behavior, (void*)&iZero },
|
||||
{ "sqlite3_connection_pointer", get_sqlite_pointer, 0 },
|
||||
{ "sqlite3_bind_int", test_bind_int, 0 },
|
||||
{ "sqlite3_bind_zeroblob", test_bind_zeroblob, 0 },
|
||||
|
|
|
@ -648,12 +648,12 @@ static int echoRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
|
|||
** indeed the hash of the supplied idxStr.
|
||||
*/
|
||||
static int hashString(const char *zString){
|
||||
int val = 0;
|
||||
u32 val = 0;
|
||||
int ii;
|
||||
for(ii=0; zString[ii]; ii++){
|
||||
val = (val << 3) + (int)zString[ii];
|
||||
}
|
||||
return val;
|
||||
return (int)(val&0x7fffffff);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1260,6 +1260,34 @@ static int test_config_cis(
|
|||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Usage: sqlite3_config_pmasz INTEGER
|
||||
**
|
||||
** Set the minimum PMA size.
|
||||
*/
|
||||
static int test_config_pmasz(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
int rc;
|
||||
int iPmaSz;
|
||||
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "BOOL");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( Tcl_GetIntFromObj(interp, objv[1], &iPmaSz) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
rc = sqlite3_config(SQLITE_CONFIG_PMASZ, iPmaSz);
|
||||
Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Usage: sqlite3_dump_memsys3 FILENAME
|
||||
|
@ -1514,6 +1542,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){
|
|||
{ "sqlite3_config_error", test_config_error ,0 },
|
||||
{ "sqlite3_config_uri", test_config_uri ,0 },
|
||||
{ "sqlite3_config_cis", test_config_cis ,0 },
|
||||
{ "sqlite3_config_pmasz", test_config_pmasz ,0 },
|
||||
{ "sqlite3_db_config_lookaside",test_db_config_lookaside ,0 },
|
||||
{ "sqlite3_dump_memsys3", test_dump_memsys3 ,3 },
|
||||
{ "sqlite3_dump_memsys5", test_dump_memsys3 ,5 },
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
** single-threaded if desired.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#if SQLITE_OS_WIN
|
||||
# include "os_win.h"
|
||||
#endif
|
||||
|
||||
#if SQLITE_MAX_WORKER_THREADS>0
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
** to a level 0 PMA. The purpose of this limit is to prevent various integer
|
||||
** overflows. 512MiB.
|
||||
*/
|
||||
#define SQLITE_MAX_MXPMASIZE (1<<29)
|
||||
#define SQLITE_MAX_PMASZ (1<<29)
|
||||
|
||||
/*
|
||||
** Private objects used by the sorter
|
||||
|
@ -448,11 +448,6 @@ struct SorterRecord {
|
|||
*/
|
||||
#define SRVAL(p) ((void*)((SorterRecord*)(p) + 1))
|
||||
|
||||
/* The minimum PMA size is set to this value multiplied by the database
|
||||
** page size in bytes. */
|
||||
#ifndef SQLITE_SORTER_PMASZ
|
||||
# define SQLITE_SORTER_PMASZ 10
|
||||
#endif
|
||||
|
||||
/* Maximum number of PMAs that a single MergeEngine can merge */
|
||||
#define SORTER_MAX_MERGE_COUNT 16
|
||||
|
@ -851,10 +846,11 @@ int sqlite3VdbeSorterInit(
|
|||
}
|
||||
|
||||
if( !sqlite3TempInMemory(db) ){
|
||||
pSorter->mnPmaSize = SQLITE_SORTER_PMASZ * pgsz;
|
||||
u32 szPma = sqlite3GlobalConfig.szPma;
|
||||
pSorter->mnPmaSize = szPma * pgsz;
|
||||
mxCache = db->aDb[0].pSchema->cache_size;
|
||||
if( mxCache<SQLITE_SORTER_PMASZ ) mxCache = SQLITE_SORTER_PMASZ;
|
||||
pSorter->mxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_MXPMASIZE);
|
||||
if( mxCache<(int)szPma ) mxCache = (int)szPma;
|
||||
pSorter->mxPmaSize = MIN((i64)mxCache*pgsz, SQLITE_MAX_PMASZ);
|
||||
|
||||
/* EVIDENCE-OF: R-26747-61719 When the application provides any amount of
|
||||
** scratch memory using SQLITE_CONFIG_SCRATCH, SQLite avoids unnecessary
|
||||
|
|
|
@ -20,6 +20,15 @@ set testprefix bigsort
|
|||
# loop if the product was also an integer multiple of 2^32, or
|
||||
# inefficiency otherwise.
|
||||
#
|
||||
# This test causes thrashing on machines with smaller amounts of
|
||||
# memory. Make sure the host has at least 8GB available before running
|
||||
# this test.
|
||||
#
|
||||
if {[catch {exec free | grep Mem:} out] || [lindex $out 1]<8000000} {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
PRAGMA page_size = 1024;
|
||||
CREATE TABLE t1(a, b);
|
||||
|
@ -39,5 +48,3 @@ do_execsql_test 1.1 {
|
|||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
|
|
@ -252,13 +252,17 @@ do_test fkey5-6.5 {
|
|||
} {c12 1 p4 0 c12 3 p4 0 c12 6 p4 0}
|
||||
|
||||
do_test fkey5-7.1 {
|
||||
set res {}
|
||||
db eval {
|
||||
INSERT OR IGNORE INTO c13 SELECT * FROM c12;
|
||||
INSERT OR IGNORE INTO C14 SELECT * FROM c12;
|
||||
DELETE FROM c12;
|
||||
PRAGMA foreign_key_check;
|
||||
} {
|
||||
lappend res [list $table $rowid $fkid $parent]
|
||||
}
|
||||
} {c14 1 p4 0 c14 3 p4 0 c14 6 p4 0 c13 1 p3 0 c13 2 p3 0 c13 3 p3 0 c13 4 p3 0 c13 5 p3 0 c13 6 p3 0}
|
||||
lsort $res
|
||||
} {{c13 1 0 p3} {c13 2 0 p3} {c13 3 0 p3} {c13 4 0 p3} {c13 5 0 p3} {c13 6 0 p3} {c14 1 0 p4} {c14 3 0 p4} {c14 6 0 p4}}
|
||||
do_test fkey5-7.2 {
|
||||
db eval {
|
||||
PRAGMA foreign_key_check(c14);
|
||||
|
|
|
@ -514,5 +514,25 @@ if {$::tcl_platform(platform)=="unix"
|
|||
} {1 {no such vfs: async}}
|
||||
}
|
||||
}
|
||||
|
||||
# Print the version number so that it can be picked up by releasetest.tcl.
|
||||
#
|
||||
puts [db one {SELECT 'VERSION: ' ||
|
||||
sqlite_version() || ' ' ||
|
||||
sqlite_source_id();}]
|
||||
|
||||
# Do deliberate failures if the TEST_FAILURE environment variable is set.
|
||||
# This is done to verify that failure notifications are detected by the
|
||||
# releasetest.tcl script, or possibly by other scripts involved in automatic
|
||||
# testing.
|
||||
#
|
||||
if {[info exists ::env(TEST_FAILURE)]} {
|
||||
set res 123
|
||||
if {$::env(TEST_FAILURE)==0} {set res 234}
|
||||
do_test main-99.1 {
|
||||
bad_behavior $::env(TEST_FAILURE)
|
||||
set x 123
|
||||
} $res
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
|
|
@ -176,20 +176,20 @@ do_test memsubsys1-4.6 {
|
|||
set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
|
||||
} 1
|
||||
|
||||
# Test 5: Activate both PAGECACHE and SCRATCH. But make the page size
|
||||
# Test 5: Activate both PAGECACHE and SCRATCH. But make the page size is
|
||||
# such that the SCRATCH allocations are too small.
|
||||
#
|
||||
db close
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_pagecache [expr 4096+$xtra_size] 24
|
||||
sqlite3_config_scratch 6000 2
|
||||
sqlite3_config_scratch 4000 2
|
||||
sqlite3_initialize
|
||||
reset_highwater_marks
|
||||
build_test_db memsubsys1-5 {PRAGMA page_size=4096}
|
||||
#show_memstats
|
||||
do_test memsubsys1-5.3 {
|
||||
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
|
||||
} 24
|
||||
} {/^2[34]$/}
|
||||
do_test memsubsys1-5.4 {
|
||||
set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
|
||||
expr {$maxreq>4096}
|
||||
|
@ -215,7 +215,7 @@ build_test_db memsubsys1-6 {PRAGMA page_size=4096}
|
|||
#show_memstats
|
||||
do_test memsubsys1-6.3 {
|
||||
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
|
||||
} 24
|
||||
} {/^2[34]$/}
|
||||
#do_test memsubsys1-6.4 {
|
||||
# set maxreq [lindex [sqlite3_status SQLITE_STATUS_MALLOC_SIZE 0] 2]
|
||||
# expr {$maxreq>4096 && $maxreq<=(4096+$xtra_size)}
|
||||
|
|
|
@ -51,19 +51,20 @@ proc do_re_test {tn script expression} {
|
|||
# a call to getcwd() may fail if there are no free file descriptors. So
|
||||
# an error may be reported for either open() or getcwd() here.
|
||||
#
|
||||
puts "Possible valgrind error about invalid file descriptor follows:"
|
||||
do_test 1.1.1 {
|
||||
set ::log [list]
|
||||
list [catch {
|
||||
for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
|
||||
} msg] $msg
|
||||
} {1 {unable to open database file}}
|
||||
do_test 1.1.2 {
|
||||
catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } }
|
||||
} {1}
|
||||
do_re_test 1.1.3 {
|
||||
lindex $::log 0
|
||||
} {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - }
|
||||
if {![clang_sanitize_address]} {
|
||||
do_test 1.1.1 {
|
||||
set ::log [list]
|
||||
list [catch {
|
||||
for {set i 0} {$i < 2000} {incr i} { sqlite3 dbh_$i test.db -readonly 1 }
|
||||
} msg] $msg
|
||||
} {1 {unable to open database file}}
|
||||
do_test 1.1.2 {
|
||||
catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } }
|
||||
} {1}
|
||||
do_re_test 1.1.3 {
|
||||
lindex $::log 0
|
||||
} {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - }
|
||||
}
|
||||
|
||||
|
||||
# Test a failure in open() due to the path being a directory.
|
||||
|
|
|
@ -200,7 +200,7 @@ ifcapable vtab {
|
|||
} {
|
||||
do_test percentile-2.1.$in {
|
||||
execsql {
|
||||
SELECT percentile(x, $in) from t3;
|
||||
SELECT round(percentile(x, $in),1) from t3;
|
||||
}
|
||||
} $out
|
||||
}
|
||||
|
|
|
@ -121,6 +121,19 @@ set allquicktests [test_set $alltests -exclude {
|
|||
if {[info exists ::env(QUICKTEST_INCLUDE)]} {
|
||||
set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)]
|
||||
}
|
||||
if {[info exists ::env(QUICKTEST_OMIT)]} {
|
||||
foreach x [split $::env(QUICKTEST_OMIT) ,] {
|
||||
regsub -all \\y$x\\y $allquicktests {} allquicktests
|
||||
}
|
||||
}
|
||||
|
||||
# If the TEST_FAILURE environment variable is set, it means that we what to
|
||||
# deliberately provoke test failures in order to test the test infrastructure.
|
||||
# Only the main.test module is needed for this.
|
||||
#
|
||||
if {[info exists ::env(TEST_FAILURE)]} {
|
||||
set allquicktests main.test
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# Start of tests
|
||||
|
@ -148,11 +161,7 @@ test_suite "mmap" -prefix "mm-" -description {
|
|||
} -presql {
|
||||
pragma mmap_size = 268435456;
|
||||
} -files [
|
||||
# Do not run pragma3.test, as it depends on the values returned by
|
||||
# "PRAGMA data_version". And if mmap is being used these are often,
|
||||
# but not always, one greater than if it were not.
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* pragma3.test \
|
||||
-include malloc.test
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test
|
||||
]
|
||||
|
||||
test_suite "valgrind" -prefix "" -description {
|
||||
|
|
|
@ -13,6 +13,7 @@ optional) are:
|
|||
--platform PLATFORM (see below)
|
||||
--config CONFIGNAME (Run only CONFIGNAME)
|
||||
--quick (Run "veryquick.test" only)
|
||||
--veryquick (Run "make smoketest" only)
|
||||
--buildonly (Just build testfixture - do not run)
|
||||
--dryrun (Print what would have happened)
|
||||
--info (Show diagnostic info)
|
||||
|
@ -31,11 +32,11 @@ of the SQLite source tree.
|
|||
array set ::Configs {
|
||||
"Default" {
|
||||
-O2
|
||||
--disable-amalgamation --disable-shared
|
||||
}
|
||||
"Ftrapv" {
|
||||
-O2 -ftrapv
|
||||
-DSQLITE_MAX_ATTACHED=55
|
||||
-DSQLITE_TCL_DEFAULT_FULLMUTEX=1
|
||||
"Sanitize" {
|
||||
CC=clang -fsanitize=undefined
|
||||
-DSQLITE_ENABLE_STAT4
|
||||
}
|
||||
"Unlock-Notify" {
|
||||
-O2
|
||||
|
@ -67,8 +68,10 @@ array set ::Configs {
|
|||
-DSQLITE_ENABLE_ATOMIC_WRITE=1
|
||||
-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
|
||||
-DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
|
||||
-DSQLITE_ENABLE_STAT4
|
||||
}
|
||||
"Debug-One" {
|
||||
--disable-shared
|
||||
-O2
|
||||
-DSQLITE_DEBUG=1
|
||||
-DSQLITE_MEMDEBUG=1
|
||||
|
@ -79,6 +82,8 @@ array set ::Configs {
|
|||
-DSQLITE_ENABLE_MEMSYS5=1
|
||||
-DSQLITE_ENABLE_MEMSYS3=1
|
||||
-DSQLITE_ENABLE_COLUMN_METADATA=1
|
||||
-DSQLITE_ENABLE_STAT4
|
||||
-DSQLITE_MAX_ATTACHED=125
|
||||
}
|
||||
"Device-One" {
|
||||
-O2
|
||||
|
@ -119,6 +124,7 @@ array set ::Configs {
|
|||
-DSQLITE_ENABLE_LOCKING_STYLE=1
|
||||
}
|
||||
"OS-X" {
|
||||
-O1 # Avoid a compiler bug in gcc 4.2.1 build 5658
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION=1
|
||||
-DSQLITE_DEFAULT_MEMSTATUS=0
|
||||
-DSQLITE_THREADSAFE=2
|
||||
|
@ -133,6 +139,7 @@ array set ::Configs {
|
|||
-DSQLITE_MAX_VARIABLE_NUMBER=500000
|
||||
-DSQLITE_DEBUG=1
|
||||
-DSQLITE_PREFER_PROXY_LOCKING=1
|
||||
-DSQLITE_ENABLE_API_ARMOR=1
|
||||
}
|
||||
"Extra-Robustness" {
|
||||
-DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
|
||||
|
@ -147,12 +154,19 @@ array set ::Configs {
|
|||
-DSQLITE_DISABLE_FTS4_DEFERRED
|
||||
-DSQLITE_ENABLE_RTREE
|
||||
}
|
||||
|
||||
"No-lookaside" {
|
||||
-DSQLITE_TEST_REALLOC_STRESS=1
|
||||
-DSQLITE_OMIT_LOOKASIDE=1
|
||||
-DHAVE_USLEEP=1
|
||||
}
|
||||
"Valgrind" {
|
||||
-DSQLITE_ENABLE_STAT4
|
||||
-DSQLITE_ENABLE_FTS4
|
||||
-DSQLITE_ENABLE_RTREE
|
||||
}
|
||||
Fail0 {-O0}
|
||||
Fail2 {-O0}
|
||||
Fail3 {-O0}
|
||||
}
|
||||
|
||||
array set ::Platforms {
|
||||
|
@ -164,9 +178,10 @@ array set ::Platforms {
|
|||
"Update-Delete-Limit" test
|
||||
"Extra-Robustness" test
|
||||
"Device-Two" test
|
||||
"Ftrapv" test
|
||||
"No-lookaside" test
|
||||
"Devkit" test
|
||||
"Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test}
|
||||
"Valgrind" valgrindtest
|
||||
"Default" "threadtest fulltest"
|
||||
"Device-One" fulltest
|
||||
}
|
||||
|
@ -181,9 +196,19 @@ array set ::Platforms {
|
|||
"Locking-Style" "mptest test"
|
||||
"OS-X" "threadtest fulltest"
|
||||
}
|
||||
Darwin-x86_64 {
|
||||
"Locking-Style" "mptest test"
|
||||
"OS-X" "threadtest fulltest"
|
||||
}
|
||||
"Windows NT-intel" {
|
||||
"Default" "mptest fulltestonly"
|
||||
}
|
||||
Failure-Detection {
|
||||
Fail0 "TEST_FAILURE=0 test"
|
||||
Sanitize "TEST_FAILURE=1 test"
|
||||
Fail2 "TEST_FAILURE=2 valgrindtest"
|
||||
Fail3 "TEST_FAILURE=3 valgrindtest"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -223,6 +248,29 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} {
|
|||
set errmsg $line
|
||||
}
|
||||
}
|
||||
if {[regexp {runtime error: +(.*)} $line all msg]} {
|
||||
incr ::NERRCASE
|
||||
if {$rc==0} {
|
||||
set rc 1
|
||||
set errmsg $msg
|
||||
}
|
||||
}
|
||||
if {[regexp {ERROR SUMMARY: (\d+) errors.*} $line all cnt] && $cnt>0} {
|
||||
incr ::NERRCASE
|
||||
if {$rc==0} {
|
||||
set rc 1
|
||||
set errmsg $all
|
||||
}
|
||||
}
|
||||
if {[regexp {^VERSION: 3\.\d+.\d+} $line]} {
|
||||
set v [string range $line 9 end]
|
||||
if {$::SQLITE_VERSION eq ""} {
|
||||
set ::SQLITE_VERSION $v
|
||||
} elseif {$::SQLITE_VERSION ne $v} {
|
||||
set rc 1
|
||||
set errmsg "version conflict: {$::SQLITE_VERSION} vs. {$v}"
|
||||
}
|
||||
}
|
||||
}
|
||||
close $fd
|
||||
if {!$seen} {
|
||||
|
@ -239,9 +287,17 @@ proc run_test_suite {name testtarget config} {
|
|||
#
|
||||
set cflags "-g"
|
||||
set opts ""
|
||||
set title ${name}($testtarget)
|
||||
set configOpts ""
|
||||
|
||||
regsub -all {#[^\n]*\n} $config \n config
|
||||
foreach arg $config {
|
||||
if {[string match -D* $arg]} {
|
||||
lappend opts $arg
|
||||
} elseif {[string match CC=* $arg]} {
|
||||
lappend testtarget $arg
|
||||
} elseif {[regexp {^--(enable|disable)-} $arg]} {
|
||||
lappend configOpts $arg
|
||||
} else {
|
||||
lappend cflags $arg
|
||||
}
|
||||
|
@ -261,28 +317,28 @@ proc run_test_suite {name testtarget config} {
|
|||
append opts " -DSQLITE_OS_UNIX=1"
|
||||
}
|
||||
|
||||
dryrun file mkdir $dir
|
||||
if {!$::DRYRUN} {
|
||||
set title ${name}($testtarget)
|
||||
if {!$::TRACE} {
|
||||
set n [string length $title]
|
||||
puts -nonewline "${title}[string repeat . [expr {54-$n}]]"
|
||||
puts -nonewline "${title}[string repeat . [expr {63-$n}]]"
|
||||
flush stdout
|
||||
}
|
||||
|
||||
set rc 0
|
||||
set tm1 [clock seconds]
|
||||
set origdir [pwd]
|
||||
dryrun cd $dir
|
||||
trace_cmd file mkdir $dir
|
||||
trace_cmd cd $dir
|
||||
set errmsg {}
|
||||
set rc [catch [configureCommand]]
|
||||
set rc [catch [configureCommand $configOpts]]
|
||||
if {!$rc} {
|
||||
set rc [catch [makeCommand $testtarget $cflags $opts]]
|
||||
count_tests_and_errors test.log rc errmsg
|
||||
}
|
||||
trace_cmd cd $origdir
|
||||
set tm2 [clock seconds]
|
||||
dryrun cd $origdir
|
||||
|
||||
if {!$::DRYRUN} {
|
||||
set hours [expr {($tm2-$tm2)/3600}]
|
||||
if {!$::TRACE} {
|
||||
set hours [expr {($tm2-$tm1)/3600}]
|
||||
set minutes [expr {(($tm2-$tm1)/60)%60}]
|
||||
set seconds [expr {($tm2-$tm1)%60}]
|
||||
set tm [format (%02d:%02d:%02d) $hours $minutes $seconds]
|
||||
|
@ -299,33 +355,36 @@ proc run_test_suite {name testtarget config} {
|
|||
# The following procedure returns the "configure" command to be exectued for
|
||||
# the current platform, which may be Windows (via MinGW, etc).
|
||||
#
|
||||
proc configureCommand {} {
|
||||
set result [list dryrun exec]
|
||||
proc configureCommand {opts} {
|
||||
set result [list trace_cmd exec]
|
||||
if {$::tcl_platform(platform)=="windows"} {
|
||||
lappend result sh
|
||||
}
|
||||
lappend result $::SRCDIR/configure -enable-load-extension >& test.log
|
||||
lappend result $::SRCDIR/configure --enable-load-extension
|
||||
foreach x $opts {lappend result $x}
|
||||
lappend result >& test.log
|
||||
}
|
||||
|
||||
# The following procedure returns the "make" command to be executed for the
|
||||
# specified targets, compiler flags, and options.
|
||||
#
|
||||
proc makeCommand { targets cflags opts } {
|
||||
set result [list dryrun exec make clean]
|
||||
set result [list trace_cmd exec make clean]
|
||||
foreach target $targets {
|
||||
lappend result $target
|
||||
}
|
||||
lappend result CFLAGS=$cflags OPTS=$opts >>& test.log
|
||||
}
|
||||
|
||||
# The following procedure either prints its arguments (if ::DRYRUN is true)
|
||||
# or executes the command of its arguments in the calling context
|
||||
# (if ::DRYRUN is false).
|
||||
# The following procedure prints its arguments if ::TRACE is true.
|
||||
# And it executes the command of its arguments in the calling context
|
||||
# if ::DRYRUN is false.
|
||||
#
|
||||
proc dryrun {args} {
|
||||
if {$::DRYRUN} {
|
||||
proc trace_cmd {args} {
|
||||
if {$::TRACE} {
|
||||
puts $args
|
||||
} else {
|
||||
}
|
||||
if {!$::DRYRUN} {
|
||||
uplevel 1 $args
|
||||
}
|
||||
}
|
||||
|
@ -342,13 +401,14 @@ proc process_options {argv} {
|
|||
set ::BUILDONLY 0
|
||||
set ::DRYRUN 0
|
||||
set ::EXEC exec
|
||||
set ::TRACE 0
|
||||
set config {}
|
||||
set platform $::tcl_platform(os)-$::tcl_platform(machine)
|
||||
|
||||
for {set i 0} {$i < [llength $argv]} {incr i} {
|
||||
set x [lindex $argv $i]
|
||||
if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]}
|
||||
switch -- $x {
|
||||
switch -glob -- $x {
|
||||
-srcdir {
|
||||
incr i
|
||||
set ::SRCDIR [file normalize [lindex $argv $i]]
|
||||
|
@ -362,6 +422,9 @@ proc process_options {argv} {
|
|||
-quick {
|
||||
set ::QUICK 1
|
||||
}
|
||||
-veryquick {
|
||||
set ::QUICK 2
|
||||
}
|
||||
|
||||
-config {
|
||||
incr i
|
||||
|
@ -376,6 +439,10 @@ proc process_options {argv} {
|
|||
set ::DRYRUN 1
|
||||
}
|
||||
|
||||
-trace {
|
||||
set ::TRACE 1
|
||||
}
|
||||
|
||||
-info {
|
||||
puts "Command-line Options:"
|
||||
puts " --srcdir $::SRCDIR"
|
||||
|
@ -384,6 +451,7 @@ proc process_options {argv} {
|
|||
if {$::QUICK} {puts " --quick"}
|
||||
if {$::BUILDONLY} {puts " --buildonly"}
|
||||
if {$::DRYRUN} {puts " --dryrun"}
|
||||
if {$::TRACE} {puts " --trace"}
|
||||
puts "\nAvailable --platform options:"
|
||||
foreach y [lsort [array names ::Platforms]] {
|
||||
puts " [list $y]"
|
||||
|
@ -394,6 +462,14 @@ proc process_options {argv} {
|
|||
}
|
||||
exit
|
||||
}
|
||||
-g -
|
||||
-D* -
|
||||
-O* -
|
||||
-enable-* -
|
||||
-disable-* -
|
||||
*=* {
|
||||
lappend ::EXTRACONFIG [lindex $argv $i]
|
||||
}
|
||||
|
||||
default {
|
||||
puts stderr ""
|
||||
|
@ -426,7 +502,10 @@ proc process_options {argv} {
|
|||
puts -nonewline "Flags:"
|
||||
if {$::DRYRUN} {puts -nonewline " --dryrun"}
|
||||
if {$::BUILDONLY} {puts -nonewline " --buildonly"}
|
||||
if {$::QUICK} {puts -nonewline " --quick"}
|
||||
switch -- $::QUICK {
|
||||
1 {puts -nonewline " --quick"}
|
||||
2 {puts -nonewline " --veryquick"}
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
|
||||
|
@ -435,18 +514,25 @@ proc process_options {argv} {
|
|||
proc main {argv} {
|
||||
|
||||
# Process any command line options.
|
||||
set ::EXTRACONFIG {}
|
||||
process_options $argv
|
||||
puts [string repeat * 70]
|
||||
puts [string repeat * 79]
|
||||
|
||||
set ::NERR 0
|
||||
set ::NTEST 0
|
||||
set ::NTESTCASE 0
|
||||
set ::NERRCASE 0
|
||||
set ::SQLITE_VERSION {}
|
||||
set STARTTIME [clock seconds]
|
||||
foreach {zConfig target} $::CONFIGLIST {
|
||||
if {$::QUICK} {set target test}
|
||||
if {$::BUILDONLY} {set target testfixture}
|
||||
set config_options $::Configs($zConfig)
|
||||
if {$target ne "checksymbols"} {
|
||||
switch -- $::QUICK {
|
||||
1 {set target test}
|
||||
2 {set target smoketest}
|
||||
}
|
||||
if {$::BUILDONLY} {set target testfixture}
|
||||
}
|
||||
set config_options [concat $::Configs($zConfig) $::EXTRACONFIG]
|
||||
|
||||
incr NTEST
|
||||
run_test_suite $zConfig $target $config_options
|
||||
|
@ -454,10 +540,11 @@ proc main {argv} {
|
|||
# If the configuration included the SQLITE_DEBUG option, then remove
|
||||
# it and run veryquick.test. If it did not include the SQLITE_DEBUG option
|
||||
# add it and run veryquick.test.
|
||||
if {$target!="checksymbols" && !$::BUILDONLY} {
|
||||
if {$target!="checksymbols" && $target!="valgrindtest"
|
||||
&& !$::BUILDONLY && $::QUICK<2} {
|
||||
set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*]
|
||||
set xtarget $target
|
||||
regsub -all {fulltest[a-z]+} $xtarget test xtarget
|
||||
regsub -all {fulltest[a-z]*} $xtarget test xtarget
|
||||
if {$debug_idx < 0} {
|
||||
incr NTEST
|
||||
append config_options " -DSQLITE_DEBUG=1"
|
||||
|
@ -476,8 +563,11 @@ proc main {argv} {
|
|||
set min [expr {($elapsetime/60)%60}]
|
||||
set sec [expr {$elapsetime%60}]
|
||||
set etime [format (%02d:%02d:%02d) $hr $min $sec]
|
||||
puts [string repeat * 70]
|
||||
puts "$::NERRCASE failures of $::NTESTCASE tests run in $etime"
|
||||
puts [string repeat * 79]
|
||||
puts "$::NERRCASE failures out of $::NTESTCASE tests in $etime"
|
||||
if {$::SQLITE_VERSION ne ""} {
|
||||
puts "SQLite $::SQLITE_VERSION"
|
||||
}
|
||||
}
|
||||
|
||||
main $argv
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
# 2015-01-05
|
||||
#
|
||||
# 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 verifies that INSERT operations with a very large number of
|
||||
# VALUE terms works and does not hit the SQLITE_LIMIT_COMPOUND_SELECT limit.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix selectG
|
||||
|
||||
# Do an INSERT with a VALUES clause that contains 100,000 entries. Verify
|
||||
# that this insert happens quickly (in less than 10 seconds). Actually, the
|
||||
# insert will normally happen in less than 0.5 seconds on a workstation, but
|
||||
# we allow plenty of overhead for slower machines. The speed test checks
|
||||
# for an O(N*N) inefficiency that was once in the code and that would make
|
||||
# the insert run for over a minute.
|
||||
#
|
||||
do_test 100 {
|
||||
set sql "CREATE TABLE t1(x);\nINSERT INTO t1(x) VALUES"
|
||||
for {set i 1} {$i<100000} {incr i} {
|
||||
append sql "($i),"
|
||||
}
|
||||
append sql "($i);"
|
||||
set microsec [lindex [time {db eval $sql}] 0]
|
||||
db eval {
|
||||
SELECT count(x), sum(x), avg(x), $microsec<10000000 FROM t1;
|
||||
}
|
||||
} {100000 5000050000 50000.5 1}
|
||||
|
||||
finish_test
|
|
@ -16,6 +16,11 @@
|
|||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix sort
|
||||
db close
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_pmasz 10
|
||||
sqlite3_initialize
|
||||
sqlite3 db test.db
|
||||
|
||||
# Create a bunch of data to sort against
|
||||
#
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix sort2
|
||||
db close
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_pmasz 10
|
||||
sqlite3_initialize
|
||||
sqlite3 db test.db
|
||||
|
||||
foreach {tn script} {
|
||||
1 { }
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix sort4
|
||||
db close
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_pmasz 10
|
||||
sqlite3_initialize
|
||||
sqlite3 db test.db
|
||||
|
||||
|
||||
# Configure the sorter to use 3 background threads.
|
||||
db eval {PRAGMA threads=3}
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix sortfault
|
||||
db close
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_pmasz 10
|
||||
sqlite3_initialize
|
||||
sqlite3 db test.db
|
||||
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
PRAGMA cache_size = 5;
|
||||
|
|
|
@ -447,8 +447,12 @@ static void free_err(Error *p){
|
|||
|
||||
static void print_err(Error *p){
|
||||
if( p->rc!=SQLITE_OK ){
|
||||
printf("Error: (%d) \"%s\" at line %d\n", p->rc, p->zErr, p->iLine);
|
||||
if( sqlite3_strglob("* - no such table: *",p->zErr)!=0 ) nGlobalErr++;
|
||||
int isWarn = 0;
|
||||
if( p->rc==SQLITE_SCHEMA ) isWarn = 1;
|
||||
if( sqlite3_strglob("* - no such table: *",p->zErr)==0 ) isWarn = 1;
|
||||
printf("%s: (%d) \"%s\" at line %d\n", isWarn ? "Warning" : "Error",
|
||||
p->rc, p->zErr, p->iLine);
|
||||
if( !isWarn ) nGlobalErr++;
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
@ -981,6 +985,7 @@ static void walthread1(int nMs){
|
|||
"INSERT INTO t1 VALUES(randomblob(100));"
|
||||
"INSERT INTO t1 SELECT md5sum(x) FROM t1;"
|
||||
);
|
||||
closedb(&err, &db);
|
||||
|
||||
setstoptime(&err, nMs);
|
||||
for(i=0; i<WALTHREAD1_NTHREAD; i++){
|
||||
|
@ -1433,7 +1438,6 @@ int main(int argc, char **argv){
|
|||
{ walthread3, "walthread3", 20000 },
|
||||
{ walthread4, "walthread4", 20000 },
|
||||
{ walthread5, "walthread5", 1000 },
|
||||
{ walthread5, "walthread5", 1000 },
|
||||
|
||||
{ cgt_pager_1, "cgt_pager_1", 0 },
|
||||
{ dynamic_triggers, "dynamic_triggers", 20000 },
|
||||
|
@ -1447,27 +1451,31 @@ int main(int argc, char **argv){
|
|||
{ stress1, "stress1", 10000 },
|
||||
{ stress2, "stress2", 60000 },
|
||||
};
|
||||
|
||||
int i;
|
||||
static char *substArgv[] = { 0, "*", 0 };
|
||||
int i, iArg;
|
||||
int nTestfound = 0;
|
||||
|
||||
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
|
||||
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
|
||||
|
||||
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
|
||||
char const *z = aTest[i].zTest;
|
||||
if( argc>1 ){
|
||||
int iArg;
|
||||
for(iArg=1; iArg<argc; iArg++){
|
||||
if( 0==sqlite3_strglob(argv[iArg], z) ) break;
|
||||
}
|
||||
if( iArg==argc ) continue;
|
||||
if( argc<2 ){
|
||||
argc = 2;
|
||||
argv = substArgv;
|
||||
}
|
||||
for(iArg=1; iArg<argc; iArg++){
|
||||
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
|
||||
if( sqlite3_strglob(argv[iArg],aTest[i].zTest)==0 ) break;
|
||||
}
|
||||
if( i>=sizeof(aTest)/sizeof(aTest[0]) ) goto usage;
|
||||
}
|
||||
for(iArg=1; iArg<argc; iArg++){
|
||||
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
|
||||
char const *z = aTest[i].zTest;
|
||||
if( sqlite3_strglob(argv[iArg],z)==0 ){
|
||||
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
|
||||
fflush(stdout);
|
||||
aTest[i].xTest(aTest[i].nMs);
|
||||
nTestfound++;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
|
||||
fflush(stdout);
|
||||
aTest[i].xTest(aTest[i].nMs);
|
||||
nTestfound++;
|
||||
}
|
||||
if( nTestfound==0 ) goto usage;
|
||||
|
||||
|
|
14
tool/lemon.c
14
tool/lemon.c
|
@ -1497,10 +1497,12 @@ int main(int argc, char **argv)
|
|||
{OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."},
|
||||
{OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."},
|
||||
{OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."},
|
||||
{OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."},
|
||||
{OPT_FSTR, "f", 0, "Ignored. (Placeholder for -f compiler options.)"},
|
||||
{OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
|
||||
{OPT_FSTR, "I", 0, "Ignored. (Placeholder for '-I' compiler options.)"},
|
||||
{OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."},
|
||||
{OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."},
|
||||
{OPT_FSTR, "O", 0, "Ignored. (Placeholder for '-O' compiler options.)"},
|
||||
{OPT_FLAG, "p", (char*)&showPrecedenceConflict,
|
||||
"Show conflicts resolved by precedence rules"},
|
||||
{OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
|
||||
|
@ -1508,6 +1510,8 @@ int main(int argc, char **argv)
|
|||
{OPT_FLAG, "s", (char*)&statistics,
|
||||
"Print parser stats to standard output."},
|
||||
{OPT_FLAG, "x", (char*)&version, "Print the version number."},
|
||||
{OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."},
|
||||
{OPT_FSTR, "W", 0, "Ignored. (Placeholder for '-W' compiler options.)"},
|
||||
{OPT_FLAG,0,0,0}
|
||||
};
|
||||
int i;
|
||||
|
@ -1812,6 +1816,8 @@ static int handleflags(int i, FILE *err)
|
|||
errline(i,1,err);
|
||||
}
|
||||
errcnt++;
|
||||
}else if( op[j].arg==0 ){
|
||||
/* Ignore this option */
|
||||
}else if( op[j].type==OPT_FLAG ){
|
||||
*((int*)op[j].arg) = v;
|
||||
}else if( op[j].type==OPT_FFLAG ){
|
||||
|
@ -2001,17 +2007,17 @@ void OptPrint(){
|
|||
break;
|
||||
case OPT_INT:
|
||||
case OPT_FINT:
|
||||
fprintf(errstream," %s=<integer>%*s %s\n",op[i].label,
|
||||
fprintf(errstream," -%s<integer>%*s %s\n",op[i].label,
|
||||
(int)(max-lemonStrlen(op[i].label)-9),"",op[i].message);
|
||||
break;
|
||||
case OPT_DBL:
|
||||
case OPT_FDBL:
|
||||
fprintf(errstream," %s=<real>%*s %s\n",op[i].label,
|
||||
fprintf(errstream," -%s<real>%*s %s\n",op[i].label,
|
||||
(int)(max-lemonStrlen(op[i].label)-6),"",op[i].message);
|
||||
break;
|
||||
case OPT_STR:
|
||||
case OPT_FSTR:
|
||||
fprintf(errstream," %s=<string>%*s %s\n",op[i].label,
|
||||
fprintf(errstream," -%s<string>%*s %s\n",op[i].label,
|
||||
(int)(max-lemonStrlen(op[i].label)-8),"",op[i].message);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue