1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Merge the fix to PRAGMA data_version and testing improvements from trunk.

FossilOrigin-Name: 86e39123c1bca457672bc63eff00a823745077e5
This commit is contained in:
drh
2014-12-31 14:27:29 +00:00
27 changed files with 453 additions and 239 deletions

View File

@@ -539,6 +539,11 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
$(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \ $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
$(TLIBS) -rpath "$(libdir)" $(TLIBS) -rpath "$(libdir)"
mptest: mptester$(EXE)
rm -f mptest1.db
./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test
rm -f mptest2.db
./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test
# This target creates a directory named "tsrc" and fills it with # This target creates a directory named "tsrc" and fills it with
# copies of all of the C source code and header files needed to # copies of all of the C source code and header files needed to
@@ -985,6 +990,34 @@ wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c
speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo
$(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS) $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS)
# This target will fail if the SQLite amalgamation contains any exported
# symbols that do not begin with "sqlite3_". It is run as part of the
# releasetest.tcl script.
#
checksymbols: sqlite3.lo
nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
echo '0 errors out of 1 tests'
# The next two rules are used to support the "threadtest" target. Building
# threadtest runs a few thread-safety tests that are implemented in C. This
# target is invoked by the releasetest.tcl script.
#
THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
$(TOP)/test/tt3_checkpoint.c \
$(TOP)/test/tt3_index.c \
$(TOP)/test/tt3_vacuum.c \
$(TOP)/test/tt3_stress.c \
$(TOP)/test/tt3_lookaside1.c
threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
$(LTLINK) $(TOP)/test/threadtest3.c sqlite3.lo -o $@ $(TLIBS)
threadtest: threadtest3$(TEXE)
./threadtest3$(TEXE)
releasetest:
$(TCLSH_CMD) $(TOP)/test/releasetest.tcl
# Standard install and cleanup targets # Standard install and cleanup targets
# #
lib_install: libsqlite3.la lib_install: libsqlite3.la

View File

@@ -1,7 +1,7 @@
C Merge\sthe\sPRAGMA\sdata_version\sredefinition\sand\sother\sfixes\sfrom\strunk. C Merge\sthe\sfix\sto\sPRAGMA\sdata_version\sand\stesting\simprovements\sfrom\strunk.
D 2014-12-22T18:48:48.561 D 2014-12-31T14:27:29.243
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 0869fe2a3b7853f048a945fd9cdf671a329b7351 F Makefile.in a297ef2900c99073c8b74555f718d3e5cfc44b9a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc 883be4b5950a20bc7e4d72a49ffc5e5905728b54 F Makefile.msc 883be4b5950a20bc7e4d72a49ffc5e5905728b54
F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0
@@ -177,7 +177,7 @@ F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test cce8e306d8596d5a2e497e27112dae1f6e5e3538 F mptest/crash01.test cce8e306d8596d5a2e497e27112dae1f6e5e3538
F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8 F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
F mptest/mptest.c 499a74af4be293b7c1c7c3d40f332b67227dd739 F mptest/mptest.c 24c5f72415df2eab7088ef8c9f99f163aed590c8
F mptest/multiwrite01.test 499ad0310da8dff8e8f98d2e272fc2a8aa741b2e F mptest/multiwrite01.test 499ad0310da8dff8e8f98d2e272fc2a8aa741b2e
F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
@@ -190,10 +190,10 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5
F src/btree.c 1de0560426ecde85ff3ea95d7c94261d7652e284 F src/btree.c 4c098bb6e8678e4596983862abf78f7a0fcb807e
F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474
F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34
F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463
F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a
@@ -212,7 +212,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660
F src/main.c 569d43f0a07b26bfdf12d8571453100e0c18868e F src/main.c 0e2e16ee46e5a33032ee3741dd120499daa721e2
F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f
@@ -230,15 +230,15 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 F src/os_unix.c 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7
F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007
F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21
F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c
F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77
F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45
F src/pcache.c ace1b67632deeaa84859b4c16c27711dfb7db3d4 F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599
F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8
F src/pcache1.c facbdd3ecc09c8f750089d941305694301328e98 F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf
F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591
F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9
F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236
@@ -247,7 +247,7 @@ F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75
F src/shell.c 81e4f2b57396db0714bc73d1f95cf3970f5dcc10 F src/shell.c 81e4f2b57396db0714bc73d1f95cf3970f5dcc10
F src/sqlite.h.in fdd032d889da139009700d7d9b8d0d43c1900c90 F src/sqlite.h.in cf011109d67863c1e621d7b22c5c16d8d70c3bfd
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
F src/sqliteInt.h 69c302a3b13d06ebaada7f85497106077df00a24 F src/sqliteInt.h 69c302a3b13d06ebaada7f85497106077df00a24
@@ -255,7 +255,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/status.c 81712116e826b0089bb221b018929536b2b5406f
F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/table.c e7a09215315a978057fb42c640f890160dbcc45e
F src/tclsqlite.c 95452a59e1afd0cbce10d5243c480b0d5e1e5f59 F src/tclsqlite.c 95452a59e1afd0cbce10d5243c480b0d5e1e5f59
F src/test1.c 56e33bf6b1827c6ca7520c189131ddd778fb2267 F src/test1.c 041c4edf2f9c49a329add297e26ee86a83852f51
F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
@@ -315,10 +315,10 @@ F src/vdbeapi.c 90aeb4b3f1dc86d6576a2ce2d5bad12761329bd5
F src/vdbeaux.c db4cf9f69c415318fbc19c2e0d2efd693fbe51af F src/vdbeaux.c db4cf9f69c415318fbc19c2e0d2efd693fbe51af
F src/vdbeblob.c cb7359c2d99df92c35cdaedc12af6d4f83854cb7 F src/vdbeblob.c cb7359c2d99df92c35cdaedc12af6d4f83854cb7
F src/vdbemem.c 96e41193b4affd9ebc0eea2fa628879dac88c744 F src/vdbemem.c 96e41193b4affd9ebc0eea2fa628879dac88c744
F src/vdbesort.c c150803a3e98fbc68bd07772cbbd4328a0a7212d F src/vdbesort.c 80e40d889ebb536cb7a5ac4c12fa2a4662bc9181
F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010
F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9
F src/wal.c 847692349eb6e1fb8543dbc97e69ddbfa4cc7ea7 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
F src/where.c d46de821bc604a4fd36fa3928c086950e91aafb1 F src/where.c d46de821bc604a4fd36fa3928c086950e91aafb1
@@ -495,8 +495,8 @@ F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52
F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585 F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585
F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9 F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9
F test/e_wal.test 0967f0b8f1dfda871dc7b9b5574198f1f4f7d69a F test/e_wal.test 0967f0b8f1dfda871dc7b9b5574198f1f4f7d69a
F test/e_walauto.test eab3bedddbc3fd19795d51e618da41a48e19a3e3 F test/e_walauto.test d2dfc6681aade1f1306a8a336f5a258d8b62becd
F test/e_walckpt.test 3116a98fa0dd9b2c9e493de7c59730adfe436746 F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608
F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664 F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473 F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473
@@ -772,7 +772,7 @@ F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
F test/nan.test e9648b9d007c7045242af35e11a984d4b169443a F test/nan.test e9648b9d007c7045242af35e11a984d4b169443a
F test/nolock.test 0540dd96f39b8876e3ffdd8814fad0ea425efeee F test/nolock.test 0540dd96f39b8876e3ffdd8814fad0ea425efeee
F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf
F test/notify2.test ce23eb522c9e1fff6443f96376fe67872202061c F test/notify2.test 2ecabaa1305083856b7c39cf32816b612740c161
F test/notify3.test 10ff25cde502e72a92053a2f215d64bece4ef934 F test/notify3.test 10ff25cde502e72a92053a2f215d64bece4ef934
F test/notnull.test f8fcf58669ddba79274daa2770d61dfad8274f62 F test/notnull.test f8fcf58669ddba79274daa2770d61dfad8274f62
F test/null.test a8b09b8ed87852742343b33441a9240022108993 F test/null.test a8b09b8ed87852742343b33441a9240022108993
@@ -799,10 +799,10 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54
F test/permutations.test 5e60eb6ca8429453ab20525dc6ac93d9c41dac6e F test/permutations.test 252900b9a89018e6f9458831ae90521e1456593c
F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5
F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
F test/pragma3.test 3da08d907ba027c50ede8d6e95418f32898971a5 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a
F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d
@@ -818,8 +818,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a F test/releasetest.tcl 8f35e5073901e48a634a649462fa2e7e522e9dc0
F test/releasetest.tcl a4279c890698584feb2ffc86735857a4e4474180
F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a
F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14
@@ -933,7 +932,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
F test/threadtest3.c f8c6595664a4c5ef5f28d97a612386fe14dd1940 F test/threadtest3.c 66c2693d888f9ed256d54d70dd60f569d92c12cf
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
@@ -1097,7 +1096,7 @@ F test/triggerB.test 56780c031b454abac2340dbb3b71ac5c56c3d7fe
F test/triggerC.test a68980c5955d62ee24be6f97129d824f199f9a4c F test/triggerC.test a68980c5955d62ee24be6f97129d824f199f9a4c
F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650 F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650
F test/triggerE.test 355e9c5cbaed5cd039a60baad1fb2197caeb8e52 F test/triggerE.test 355e9c5cbaed5cd039a60baad1fb2197caeb8e52
F test/tt3_checkpoint.c 5e63ee65ed5f87176e25a996480cb02c6caec8b4 F test/tt3_checkpoint.c 9e75cf7c1c364f52e1c47fd0f14c4340a9db0fe1
F test/tt3_index.c 39eec10a35f57672225be4d182862152896dee4a F test/tt3_index.c 39eec10a35f57672225be4d182862152896dee4a
F test/tt3_lookaside1.c 0377e202c3c2a50d688cb65ba203afeda6fafeb9 F test/tt3_lookaside1.c 0377e202c3c2a50d688cb65ba203afeda6fafeb9
F test/tt3_stress.c c57d804716165811d979d4a719e05baccd79277f F test/tt3_stress.c c57d804716165811d979d4a719e05baccd79277f
@@ -1142,7 +1141,7 @@ F test/wal.test 885f32b2b390b30b4aa3dbb0e568f8f78d40f5cc
F test/wal2.test 1f841d2048080d32f552942e333fd99ce541dada F test/wal2.test 1f841d2048080d32f552942e333fd99ce541dada
F test/wal3.test b22eb662bcbc148c5f6d956eaf94b047f7afe9c0 F test/wal3.test b22eb662bcbc148c5f6d956eaf94b047f7afe9c0
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
F test/wal5.test 174cc1512e304a7dfa28ac30527e28ea02fc37df F test/wal5.test 11b8658dd4d5448f4604124bebd9b68be5bc3e66
F test/wal6.test 527581f5527bf9c24394991e2be83000aace5f9e F test/wal6.test 527581f5527bf9c24394991e2be83000aace5f9e
F test/wal64k.test 163655ecd2cb8afef4737cac2a40fdd2eeaf20b8 F test/wal64k.test 163655ecd2cb8afef4737cac2a40fdd2eeaf20b8
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
@@ -1197,6 +1196,7 @@ F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99
F test/without_rowid3.test 1081aabf60a1e1123b7f9a8f6ae19954351843b0 F test/without_rowid3.test 1081aabf60a1e1123b7f9a8f6ae19954351843b0
F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a
F test/without_rowid5.test 61256715b686359df48ca1742db50cc7e3e7b862 F test/without_rowid5.test 61256715b686359df48ca1742db50cc7e3e7b862
F test/without_rowid6.test deddb78ef539c355bddec00cdfaea6c56efd8b3f
F test/wordcount.c 9915e06cb33d8ca8109b8700791afe80d305afda F test/wordcount.c 9915e06cb33d8ca8109b8700791afe80d305afda
F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688
F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac
@@ -1219,7 +1219,7 @@ F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 88a1e3b0c769773fb7a9ebb363ffc603a4ac21d8 F tool/mksqlite3c-noext.tcl 88a1e3b0c769773fb7a9ebb363ffc603a4ac21d8
F tool/mksqlite3c.tcl a2f61b529778ffe620531352c03b5cdc6fd03c0a F tool/mksqlite3c.tcl da1b2f86cb5b3fb0200826137d5f480dc089c7ea
F tool/mksqlite3h.tcl 2d0f1b3768f8d000b7881217d5fd4c776eb27467 F tool/mksqlite3h.tcl 2d0f1b3768f8d000b7881217d5fd4c776eb27467
F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1 F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1
F tool/mkvsix.tcl 52a4c613707ac34ae9c226e5ccc69cb948556105 F tool/mkvsix.tcl 52a4c613707ac34ae9c226e5ccc69cb948556105
@@ -1252,7 +1252,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P d4f82af0a4a9db222e3405cff05c41157e7bd5d9 7a97826f33460f3b4f3890c9cf97116c3355eeda P 315243e49d30abd0eb31e3795ecf492aee179e4b cf48eb608af9102a8def2a5b7f5f7b348548116f
R 9a054ca44b6e0d7ecf483bae22df2dab R 3c78b315e0de46f71ce8985baa898853
U drh U drh
Z 6ad5f73c282563e802f6faa1901969e7 Z c5bac6e43352272a84a70be7a0122952

View File

@@ -1 +1 @@
315243e49d30abd0eb31e3795ecf492aee179e4b 86e39123c1bca457672bc63eff00a823745077e5

View File

@@ -1395,7 +1395,7 @@ int main(int argc, char **argv){
maybeClose(g.pLog); maybeClose(g.pLog);
maybeClose(g.pErrLog); maybeClose(g.pErrLog);
if( iClient==0 ){ if( iClient==0 ){
printf("Summary: %d errors in %d tests\n", g.nError, g.nTest); printf("Summary: %d errors out of %d tests\n", g.nError, g.nTest);
} }
return g.nError>0; return g.nError>0;
} }

View File

@@ -6865,8 +6865,8 @@ static int balance_nonroot(
/* Do not allow any cells smaller than 4 bytes. If a smaller cell /* Do not allow any cells smaller than 4 bytes. If a smaller cell
** does exist, pad it with 0x00 bytes. */ ** does exist, pad it with 0x00 bytes. */
assert( szCell[nCell]==3 ); assert( szCell[nCell]==3 );
assert( apCell[nCell]==&pTemp[iSpace1-3] ); assert( apCell[nCell]==&aSpace1[iSpace1-3] );
pTemp[iSpace1++] = 0x00; aSpace1[iSpace1++] = 0x00;
szCell[nCell] = 4; szCell[nCell] = 4;
} }
} }
@@ -9146,4 +9146,4 @@ int sqlite3BtreeIsReadonly(Btree *p){
/* /*
** Return the size of the header added to each page by this module. ** Return the size of the header added to each page by this module.
*/ */
int sqlite3HeaderSizeBtree(void){ return sizeof(MemPage); } int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(MemPage)); }

View File

@@ -1713,6 +1713,19 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
pTab->iPKey = -1; pTab->iPKey = -1;
}else{ }else{
pPk = sqlite3PrimaryKeyIndex(pTab); pPk = sqlite3PrimaryKeyIndex(pTab);
/*
** Remove all redundant columns from the PRIMARY KEY. For example, change
** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later
** code assumes the PRIMARY KEY contains no repeated columns.
*/
for(i=j=1; i<pPk->nKeyCol; i++){
if( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) ){
pPk->nColumn--;
}else{
pPk->aiColumn[j++] = pPk->aiColumn[i];
}
}
pPk->nKeyCol = j;
} }
pPk->isCovering = 1; pPk->isCovering = 1;
assert( pPk!=0 ); assert( pPk!=0 );

View File

@@ -62,7 +62,7 @@ int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
** I/O active are written using this function. These messages ** I/O active are written using this function. These messages
** are intended for debugging activity only. ** are intended for debugging activity only.
*/ */
void (*sqlite3IoTrace)(const char*, ...) = 0; /* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0;
#endif #endif
/* /*
@@ -271,6 +271,13 @@ int sqlite3_initialize(void){
** when this routine is invoked, then this routine is a harmless no-op. ** when this routine is invoked, then this routine is a harmless no-op.
*/ */
int sqlite3_shutdown(void){ int sqlite3_shutdown(void){
#ifdef SQLITE_OMIT_WSD
int rc = sqlite3_wsd_init(4096, 24);
if( rc!=SQLITE_OK ){
return rc;
}
#endif
if( sqlite3GlobalConfig.isInit ){ if( sqlite3GlobalConfig.isInit ){
#ifdef SQLITE_EXTRA_SHUTDOWN #ifdef SQLITE_EXTRA_SHUTDOWN
void SQLITE_EXTRA_SHUTDOWN(void); void SQLITE_EXTRA_SHUTDOWN(void);

View File

@@ -3709,24 +3709,27 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
}while( err==EINTR ); }while( err==EINTR );
if( err ) return SQLITE_IOERR_WRITE; if( err ) return SQLITE_IOERR_WRITE;
#else #else
/* If the OS does not have posix_fallocate(), fake it. First use /* If the OS does not have posix_fallocate(), fake it. Write a
** ftruncate() to set the file size, then write a single byte to ** single byte to the last byte in each block that falls entirely
** the last byte in each block within the extended region. This ** within the extended region. Then, if required, a single byte
** is the same technique used by glibc to implement posix_fallocate() ** at offset (nSize-1), to set the size of the file correctly.
** on systems that do not have a real fallocate() system call. ** This is a similar technique to that used by glibc on systems
** that do not have a real fallocate() call.
*/ */
int nBlk = buf.st_blksize; /* File-system block size */ int nBlk = buf.st_blksize; /* File-system block size */
i64 iWrite; /* Next offset to write to */ i64 iWrite; /* Next offset to write to */
if( robust_ftruncate(pFile->h, nSize) ){
pFile->lastErrno = errno;
return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath);
}
iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1;
while( iWrite<nSize ){ assert( iWrite>=buf.st_size );
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); int nWrite = seekAndWrite(pFile, iWrite, "", 1);
if( nWrite!=1 ) return SQLITE_IOERR_WRITE; if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
iWrite += nBlk; }
if( nSize%nBlk ){
int nWrite = seekAndWrite(pFile, nSize-1, "", 1);
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
} }
#endif #endif
} }

View File

@@ -647,6 +647,7 @@ struct Pager {
u8 doNotSpill; /* Do not spill the cache when non-zero */ u8 doNotSpill; /* Do not spill the cache when non-zero */
u8 subjInMemory; /* True to use in-memory sub-journals */ u8 subjInMemory; /* True to use in-memory sub-journals */
u8 bUseFetch; /* True to use xFetch() */ u8 bUseFetch; /* True to use xFetch() */
u8 hasBeenUsed; /* True if any content previously read from this pager*/
Pgno dbSize; /* Number of pages in the database */ Pgno dbSize; /* Number of pages in the database */
Pgno dbOrigSize; /* dbSize before the current transaction */ Pgno dbOrigSize; /* dbSize before the current transaction */
Pgno dbFileSize; /* Number of pages in the database file */ Pgno dbFileSize; /* Number of pages in the database file */
@@ -3897,7 +3898,7 @@ static int pagerAcquireMapPage(
PgHdr **ppPage /* OUT: Acquired page object */ PgHdr **ppPage /* OUT: Acquired page object */
){ ){
PgHdr *p; /* Memory mapped page to return */ PgHdr *p; /* Memory mapped page to return */
if( pPager->pMmapFreelist ){ if( pPager->pMmapFreelist ){
*ppPage = p = pPager->pMmapFreelist; *ppPage = p = pPager->pMmapFreelist;
pPager->pMmapFreelist = p->pDirty; pPager->pMmapFreelist = p->pDirty;
@@ -5128,16 +5129,12 @@ int sqlite3PagerSharedLock(Pager *pPager){
); );
} }
if( !pPager->tempFile && ( if( !pPager->tempFile && pPager->hasBeenUsed ){
pPager->pBackup /* The shared-lock has just been acquired then check to
|| sqlite3PcachePagecount(pPager->pPCache)>0 ** see if the database has been modified. If the database has changed,
|| USEFETCH(pPager) ** flush the cache. The pPager->hasBeenUsed flag prevents this from
)){ ** occurring on the very first access to a file, in order to save a
/* The shared-lock has just been acquired on the database file ** single unnecessary sqlite3OsRead() call at the start-up.
** and there are already pages in the cache (from a previous
** read or write transaction). Check to see if the database
** has been modified. If the database has changed, flush the
** cache.
** **
** Database changes is detected by looking at 15 bytes beginning ** Database changes is detected by looking at 15 bytes beginning
** at offset 24 into the file. The first 4 of these 16 bytes are ** at offset 24 into the file. The first 4 of these 16 bytes are
@@ -5302,6 +5299,7 @@ int sqlite3PagerAcquire(
if( pgno==0 ){ if( pgno==0 ){
return SQLITE_CORRUPT_BKPT; return SQLITE_CORRUPT_BKPT;
} }
pPager->hasBeenUsed = 1;
/* If the pager is in the error state, return an error immediately. /* If the pager is in the error state, return an error immediately.
** Otherwise, request the page from the PCache layer. */ ** Otherwise, request the page from the PCache layer. */
@@ -5451,6 +5449,7 @@ DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
assert( pgno!=0 ); assert( pgno!=0 );
assert( pPager->pPCache!=0 ); assert( pPager->pPCache!=0 );
pPage = sqlite3PcacheFetch(pPager->pPCache, pgno, 0); pPage = sqlite3PcacheFetch(pPager->pPCache, pgno, 0);
assert( pPage==0 || pPager->hasBeenUsed );
return sqlite3PcacheFetchFinish(pPager->pPCache, pgno, pPage); return sqlite3PcacheFetchFinish(pPager->pPCache, pgno, pPage);
} }

View File

@@ -196,7 +196,8 @@ int sqlite3PcacheSetPageSize(PCache *pCache, int szPage){
if( pCache->szPage ){ if( pCache->szPage ){
sqlite3_pcache *pNew; sqlite3_pcache *pNew;
pNew = sqlite3GlobalConfig.pcache2.xCreate( pNew = sqlite3GlobalConfig.pcache2.xCreate(
szPage, pCache->szExtra + sizeof(PgHdr), pCache->bPurgeable szPage, pCache->szExtra + ROUND8(sizeof(PgHdr)),
pCache->bPurgeable
); );
if( pNew==0 ) return SQLITE_NOMEM; if( pNew==0 ) return SQLITE_NOMEM;
sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache)); sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache));
@@ -655,7 +656,7 @@ void sqlite3PcacheShrink(PCache *pCache){
** Return the size of the header added by this middleware layer ** Return the size of the header added by this middleware layer
** in the page-cache hierarchy. ** in the page-cache hierarchy.
*/ */
int sqlite3HeaderSizePcache(void){ return sizeof(PgHdr); } int sqlite3HeaderSizePcache(void){ return ROUND8(sizeof(PgHdr)); }
#if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG) #if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG)

View File

@@ -296,7 +296,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache){
pPg = 0; pPg = 0;
} }
#else #else
pPg = pcache1Alloc(sizeof(PgHdr1) + pCache->szPage + pCache->szExtra); pPg = pcache1Alloc(ROUND8(sizeof(PgHdr1)) + pCache->szPage + pCache->szExtra);
p = (PgHdr1 *)&((u8 *)pPg)[pCache->szPage]; p = (PgHdr1 *)&((u8 *)pPg)[pCache->szPage];
#endif #endif
pcache1EnterMutex(pCache->pGroup); pcache1EnterMutex(pCache->pGroup);
@@ -984,7 +984,7 @@ void sqlite3PCacheSetDefault(void){
/* /*
** Return the size of the header on each page of this PCACHE implementation. ** Return the size of the header on each page of this PCACHE implementation.
*/ */
int sqlite3HeaderSizePcache1(void){ return sizeof(PgHdr1); } int sqlite3HeaderSizePcache1(void){ return ROUND8(sizeof(PgHdr1)); }
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/* /*

View File

@@ -1565,7 +1565,7 @@ struct sqlite3_mem_methods {
** 8-byte aligned ** 8-byte aligned
** memory, the size of each page buffer (sz), and the number of pages (N). ** memory, the size of each page buffer (sz), and the number of pages (N).
** The sz argument should be the size of the largest database page ** The sz argument should be the size of the largest database page
** (a power of two between 512 and 32768) plus some extra bytes for each ** (a power of two between 512 and 65536) plus some extra bytes for each
** page header. ^The number of extra bytes needed by the page header ** page header. ^The number of extra bytes needed by the page header
** can be determined using the [SQLITE_CONFIG_PCACHE_HDRSZ] option ** can be determined using the [SQLITE_CONFIG_PCACHE_HDRSZ] option
** to [sqlite3_config()]. ** to [sqlite3_config()].

View File

@@ -3670,7 +3670,7 @@ static int test_prepare_v2(
assert(rc==SQLITE_OK || pStmt==0); assert(rc==SQLITE_OK || pStmt==0);
Tcl_ResetResult(interp); Tcl_ResetResult(interp);
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
if( zTail && objc>=5 ){ if( rc==SQLITE_OK && zTail && objc>=5 ){
if( bytes>=0 ){ if( bytes>=0 ){
bytes = bytes - (int)(zTail-zSql); bytes = bytes - (int)(zTail-zSql);
} }

View File

@@ -1132,12 +1132,12 @@ void sqlite3VdbeSorterClose(sqlite3 *db, VdbeCursor *pCsr){
*/ */
static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){ static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
int rc = sqlite3OsTruncate(pFd, nByte); void *p = 0;
if( rc==SQLITE_OK ){ int chunksize = 4*1024;
void *p = 0; sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_CHUNK_SIZE, &chunksize);
sqlite3OsFetch(pFd, 0, (int)nByte, &p); sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
sqlite3OsUnfetch(pFd, 0, p); sqlite3OsFetch(pFd, 0, (int)nByte, &p);
} sqlite3OsUnfetch(pFd, 0, p);
} }
} }
#else #else

View File

@@ -2412,7 +2412,7 @@ int sqlite3WalFindFrame(
for(iKey=walHash(pgno); aHash[iKey]; iKey=walNextHash(iKey)){ for(iKey=walHash(pgno); aHash[iKey]; iKey=walNextHash(iKey)){
u32 iFrame = aHash[iKey] + iZero; u32 iFrame = aHash[iKey] + iZero;
if( iFrame<=iLast && aPgno[aHash[iKey]]==pgno ){ if( iFrame<=iLast && aPgno[aHash[iKey]]==pgno ){
/* assert( iFrame>iRead ); -- not true if there is corruption */ assert( iFrame>iRead || CORRUPT_DB );
iRead = iFrame; iRead = iFrame;
} }
if( (nCollide--)==0 ){ if( (nCollide--)==0 ){

View File

@@ -66,6 +66,7 @@ foreach {tn code} {
eval $code eval $code
reset_db reset_db
execsql { PRAGMA auto_vacuum = 0 }
do_execsql_test 1.$tn.0 { PRAGMA journal_mode = WAL } {wal} do_execsql_test 1.$tn.0 { PRAGMA journal_mode = WAL } {wal}
do_execsql_test 1.$tn.1 { CREATE TABLE t1(a, b) } do_execsql_test 1.$tn.1 { CREATE TABLE t1(a, b) }
set shmfd [open "test.db-shm" rb] set shmfd [open "test.db-shm" rb]

View File

@@ -247,6 +247,7 @@ foreach {tn script} {
do_test $tn.3.2.1 { do_test $tn.3.2.1 {
db2 eval { db2 eval {
PRAGMA auto_vacuum = 0;
PRAGMA journal_mode = WAL; PRAGMA journal_mode = WAL;
CREATE TABLE t1(x, y); CREATE TABLE t1(x, y);
INSERT INTO t1 VALUES(1,2); INSERT INTO t1 VALUES(1,2);
@@ -706,6 +707,7 @@ sqlite3 db2 test.db
do_test 6.1 { do_test 6.1 {
execsql { execsql {
PRAGMA auto_vacuum = 0;
PRAGMA journal_mode = WAL; PRAGMA journal_mode = WAL;
CREATE TABLE t1(a, b); CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(1, 2);

View File

@@ -101,6 +101,8 @@ set sql $zSql
# This loop runs for ~20 seconds. # This loop runs for ~20 seconds.
# #
set iStart [clock_seconds] set iStart [clock_seconds]
set nOp 0
set nAttempt 0
while { ([clock_seconds]-$iStart) < $nSecond } { while { ([clock_seconds]-$iStart) < $nSecond } {
# Each transaction does 3 operations. Each operation is either a read # Each transaction does 3 operations. Each operation is either a read
@@ -128,6 +130,7 @@ set sql $zSql
# Execute the SQL transaction. # Execute the SQL transaction.
# #
incr nAttempt
set rc [catch { execsql_blocking $::DB " set rc [catch { execsql_blocking $::DB "
BEGIN; BEGIN;
$SQL(1); $SQL(1);
@@ -154,13 +157,14 @@ set sql $zSql
# returned "1". Otherwise, the invariant was false, indicating that # returned "1". Otherwise, the invariant was false, indicating that
# some malfunction has occurred. # some malfunction has occurred.
foreach r $msg { if {$r != 1} { puts "Invariant check failed: $msg" } } foreach r $msg { if {$r != 1} { puts "Invariant check failed: $msg" } }
incr nOp
} }
} }
# Close the database connection and return 0. # Close the database connection and return 0.
# #
sqlite3_close $::DB sqlite3_close $::DB
expr 0 list $nOp $nAttempt
} }
foreach {iTest xStep xPrepare} { foreach {iTest xStep xPrepare} {
@@ -204,7 +208,9 @@ foreach {iTest xStep xPrepare} {
for {set ii 0} {$ii < $nThread} {incr ii} { for {set ii 0} {$ii < $nThread} {incr ii} {
do_test notify2-$iTest.2.$ii { do_test notify2-$iTest.2.$ii {
if {![info exists finished($ii)]} { vwait finished($ii) } if {![info exists finished($ii)]} { vwait finished($ii) }
set finished($ii) incr anSuccess($xStep) [lindex $finished($ii) 0]
incr anAttempt($xStep) [lindex $finished($ii) 1]
expr 0
} {0} } {0}
} }
@@ -225,17 +231,36 @@ foreach {iTest xStep xPrepare} {
} }
# The following tests checks to make sure sqlite3_blocking_step() is # The following tests checks to make sure sqlite3_blocking_step() is
# faster than sqlite3_step(). blocking_step() is always faster on # faster than sqlite3_step(). "Faster" in this case means uses fewer
# multi-core and is usually faster on single-core. But sometimes, by # CPU cycles. This is not always the same as faster in wall-clock time
# chance, step() will be faster on a single core, in which case the # for this type of test. The number of CPU cycles per transaction is
# roughly proportional to the number of attempts made (i.e. one plus the
# number of SQLITE_BUSY or SQLITE_LOCKED errors that require the transaction
# to be retried). So this test just measures that a greater percentage of
# transactions attempted using blocking_step() succeed.
#
# The blocking_step() function is almost always faster on multi-core and is
# usually faster on single-core. But sometimes, by chance, step() will be
# faster on a single core, in which case the
# following test will fail. # following test will fail.
# #
puts "The following test seeks to demonstrate that the sqlite3_unlock_notify()" puts "The following test seeks to demonstrate that the sqlite3_unlock_notify()"
puts "interface helps multi-core systems to run faster. This test sometimes" puts "interface helps multi-core systems to run more efficiently. This test"
puts "fails on single-core machines." puts "sometimes fails on single-core machines."
puts [array get anWrite] puts [array get anWrite]
do_test notify2-3 { do_test notify2-3 {
expr {$anWrite(sqlite3_blocking_step) > $anWrite(sqlite3_step)} set blocking [expr {
double($anSuccess(sqlite3_blocking_step)) /
double($anAttempt(sqlite3_blocking_step))
}]
set non [expr {
double($anSuccess(sqlite3_step)) /
double($anAttempt(sqlite3_step))
}]
puts -nonewline [format " blocking: %.1f%% non-blocking %.1f%% ..." \
[expr $blocking*100.0] [expr $non*100.0]]
expr {$blocking > $non}
} {1} } {1}
sqlite3_enable_shared_cache $::enable_shared_cache sqlite3_enable_shared_cache $::enable_shared_cache

View File

@@ -144,11 +144,15 @@ test_suite "veryquick" -prefix "" -description {
] ]
test_suite "mmap" -prefix "mm-" -description { test_suite "mmap" -prefix "mm-" -description {
Similar to veryquick. Except with memory mapping disabled. Similar to veryquick. Except with memory mapping enabled.
} -presql { } -presql {
pragma mmap_size = 268435456; pragma mmap_size = 268435456;
} -files [ } -files [
test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test # 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_suite "valgrind" -prefix "" -description { test_suite "valgrind" -prefix "" -description {
@@ -693,7 +697,7 @@ test_suite "inmemory_journal" -description {
zerodamage.test zerodamage.test
# WAL mode is different. # WAL mode is different.
wal* tkt-2d1a5c67d.test backcompat.test wal* tkt-2d1a5c67d.test backcompat.test e_wal*
}] }]
ifcapable mem3 { ifcapable mem3 {

View File

@@ -32,8 +32,8 @@ do_execsql_test pragma3-102 {
# EVIDENCE-OF: R-27726-60934 The "PRAGMA data_version" command provides # EVIDENCE-OF: R-27726-60934 The "PRAGMA data_version" command provides
# an indication that the database file has been modified. # an indication that the database file has been modified.
# #
# EVIDENCE-OF: R-25838-33704 The "PRAGMA data_version" value is # EVIDENCE-OF: R-47505-58569 The "PRAGMA data_version" value is
# unchanced for commits made on the same database connection. # unchanged for commits made on the same database connection.
# #
do_execsql_test pragma3-110 { do_execsql_test pragma3-110 {
PRAGMA data_version; PRAGMA data_version;
@@ -64,6 +64,7 @@ do_execsql_test pragma3-130 {
COMMIT; COMMIT;
SELECT * FROM t1; SELECT * FROM t1;
PRAGMA data_version; PRAGMA data_version;
PRAGMA shrink_memory;
} {1 1 1 100 200 300 400 500 1} } {1 1 1 100 200 300 400 500 1}
# EVIDENCE-OF: R-63005-41812 The integer values returned by two # EVIDENCE-OF: R-63005-41812 The integer values returned by two
@@ -216,7 +217,12 @@ ifcapable shared_cache {
# Make sure this also works in WAL mode # Make sure this also works in WAL mode
# #
# This will not work with the in-memory journal permutation, as opening
# [db2] switches the journal mode back to "memory"
#
ifcapable wal { ifcapable wal {
if {[permutation]!="inmemory_journal"} {
sqlite3 db test.db sqlite3 db test.db
db eval {PRAGMA journal_mode=WAL} db eval {PRAGMA journal_mode=WAL}
sqlite3 db2 test.db sqlite3 db2 test.db
@@ -242,5 +248,6 @@ ifcapable wal {
} {3 111 222} } {3 111 222}
db2 close db2 close
} }
}
finish_test finish_test

View File

@@ -1,14 +0,0 @@
########################################################
TOP=/home/drh/sqlite/sqlite
TCL_FLAGS=-I/home/drh/tcltk/86linux
LIBTCL=/home/drh/tcltk/86linux/libtcl8.6.a -lm -ldl -lpthread
BCC = gcc
TCC = gcc -ansi -g $(CFLAGS)
NAWK = awk
AR = ar cr
RANLIB = ranlib
THREADLIB = -lpthread -ldl -lz
include $(TOP)/main.mk
########################################################

View File

@@ -1,60 +1,31 @@
#!/usr/bin/tclsh
set rcsid {$Id: $} #
# Documentation for this script. This may be output to stderr # Documentation for this script. This may be output to stderr
# if the script is invoked incorrectly. See the [process_options] # if the script is invoked incorrectly. See the [process_options]
# proc below. # proc below.
# #
set ::USAGE_MESSAGE { set ::USAGE_MESSAGE {
This Tcl script is used to test the various configurations required This Tcl script is used to test the various configurations required
before releasing a new version. Supported command line options (all before releasing a new version. Supported command line options (all
optional) are: optional) are:
-makefile PATH-TO-MAKEFILE (default "releasetest.mk") --srcdir TOP-OF-SQLITE-TREE (see below)
-platform PLATFORM (see below) --platform PLATFORM (see below)
-quick BOOLEAN (default "0") --config CONFIGNAME (Run only CONFIGNAME)
-config CONFIGNAME (Run only CONFIGNAME) --quick (Run "veryquick.test" only)
--buildonly (Just build testfixture - do not run)
--dryrun (Print what would have happened)
--info (Show diagnostic info)
The default value for -makefile is "./releasetest.mk". The default value for --srcdir is the parent of the directory holding
this script.
The script determines the default value for -platform using the The script determines the default value for --platform using the
$tcl_platform(os) and $tcl_platform(machine) variables. Supported $tcl_platform(os) and $tcl_platform(machine) variables. Supported
platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386". platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386".
If the -quick option is set to true, then the "veryquick.test" script Every test begins with a fresh run of the configure script at the top
is run for all compilation configurations. Otherwise, sometimes "all.test" of the SQLite source tree.
is run, sometimes "veryquick.test".
Almost any SQLite makefile (except those generated by configure - see below)
should work. The following properties are required:
* The makefile should support the "fulltest" target.
* The makefile should support the variable "OPTS" as a way to pass
options from the make command line to lemon and the C compiler.
More precisely, the following invocation must be supported:
make -f $::MAKEFILE fulltest OPTS="-DSQLITE_SECURE_DELETE=1 -DSQLITE_DEBUG=1"
Makefiles generated by the sqlite configure program cannot be used as
they do not respect the OPTS variable.
Example Makefile contents:
########################################################
TOP=/home/dan/work/sqlite/sqlite
TCL_FLAGS=-I/home/dan/tcl/include
LIBTCL=-L/home/dan/tcl/lib -ltcl
BCC = gcc
TCC = gcc -ansi -g $(CFLAGS)
NAWK = awk
AR = ar cr
RANLIB = ranlib
THREADLIB = -lpthread -ldl
include $(TOP)/main.mk
########################################################
} }
array set ::Configs { array set ::Configs {
@@ -94,7 +65,6 @@ array set ::Configs {
-DSQLITE_SECURE_DELETE=1 -DSQLITE_SECURE_DELETE=1
-DSQLITE_SOUNDEX=1 -DSQLITE_SOUNDEX=1
-DSQLITE_ENABLE_ATOMIC_WRITE=1 -DSQLITE_ENABLE_ATOMIC_WRITE=1
-DSQLITE_ENABLE_IOTRACE=1
-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
-DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
} }
@@ -161,7 +131,7 @@ array set ::Configs {
-DSQLITE_DEFAULT_CACHE_SIZE=1000 -DSQLITE_DEFAULT_CACHE_SIZE=1000
-DSQLITE_MAX_LENGTH=2147483645 -DSQLITE_MAX_LENGTH=2147483645
-DSQLITE_MAX_VARIABLE_NUMBER=500000 -DSQLITE_MAX_VARIABLE_NUMBER=500000
-DSQLITE_DEBUG=1 -DSQLITE_DEBUG=1
-DSQLITE_PREFER_PROXY_LOCKING=1 -DSQLITE_PREFER_PROXY_LOCKING=1
} }
"Extra-Robustness" { "Extra-Robustness" {
@@ -188,7 +158,7 @@ array set ::Configs {
array set ::Platforms { array set ::Platforms {
Linux-x86_64 { Linux-x86_64 {
"Check-Symbols" checksymbols "Check-Symbols" checksymbols
"Debug-One" test "Debug-One" "mptest test"
"Secure-Delete" test "Secure-Delete" test
"Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test"
"Update-Delete-Limit" test "Update-Delete-Limit" test
@@ -208,9 +178,12 @@ array set ::Platforms {
"Default" "threadtest fulltest" "Default" "threadtest fulltest"
} }
Darwin-i386 { Darwin-i386 {
"Locking-Style" test "Locking-Style" "mptest test"
"OS-X" "threadtest fulltest" "OS-X" "threadtest fulltest"
} }
"Windows NT-intel" {
"Default" "mptest fulltestonly"
}
} }
@@ -227,14 +200,44 @@ foreach {key value} [array get ::Platforms] {
} }
} }
# Open the file $logfile and look for a report on the number of errors
# and the number of test cases run. Add these values to the global
# $::NERRCASE and $::NTESTCASE variables.
#
# If any errors occur, then write into $errmsgVar the text of an appropriate
# one-line error message to show on the output.
#
proc count_tests_and_errors {logfile rcVar errmsgVar} {
if {$::DRYRUN} return
upvar 1 $rcVar rc $errmsgVar errmsg
set fd [open $logfile rb]
set seen 0
while {![eof $fd]} {
set line [gets $fd]
if {[regexp {(\d+) errors out of (\d+) tests} $line all nerr ntest]} {
incr ::NERRCASE $nerr
incr ::NTESTCASE $ntest
set seen 1
if {$nerr>0} {
set rc 1
set errmsg $line
}
}
}
close $fd
if {!$seen} {
set rc 1
set errmsg "Test did not complete"
}
}
proc run_test_suite {name testtarget config} { proc run_test_suite {name testtarget config} {
# Tcl variable $opts is used to build up the value used to set the
# Tcl variable $opts is used to build up the value used to set the
# OPTS Makefile variable. Variable $cflags holds the value for # OPTS Makefile variable. Variable $cflags holds the value for
# CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but
# CFLAGS is only passed to gcc. # CFLAGS is only passed to gcc.
# #
set cflags "" set cflags "-g"
set opts "" set opts ""
foreach arg $config { foreach arg $config {
if {[string match -D* $arg]} { if {[string match -D* $arg]} {
@@ -258,30 +261,72 @@ proc run_test_suite {name testtarget config} {
append opts " -DSQLITE_OS_UNIX=1" append opts " -DSQLITE_OS_UNIX=1"
} }
# Run the test. dryrun file mkdir $dir
# if {!$::DRYRUN} {
set makefile [file normalize $::MAKEFILE] set title ${name}($testtarget)
file mkdir $dir set n [string length $title]
puts -nonewline "Testing configuration \"$name\" (logfile=$dir/test.log)..." puts -nonewline "${title}[string repeat . [expr {54-$n}]]"
flush stdout flush stdout
}
set makecmd [concat \ set tm1 [clock seconds]
[list exec make -C $dir -f $makefile clean] \ set origdir [pwd]
$testtarget \ dryrun cd $dir
[list CFLAGS=$cflags OPTS=$opts >& $dir/test.log] \ set errmsg {}
] set rc [catch [configureCommand]]
if {!$rc} {
set tm1 [clock seconds] set rc [catch [makeCommand $testtarget $cflags $opts]]
set rc [catch $makecmd] count_tests_and_errors test.log rc errmsg
}
set tm2 [clock seconds] set tm2 [clock seconds]
dryrun cd $origdir
set minutes [expr {($tm2-$tm1)/60}] if {!$::DRYRUN} {
set seconds [expr {($tm2-$tm1)%60}] set hours [expr {($tm2-$tm2)/3600}]
puts -nonewline [format " (%d:%.2d) " $minutes $seconds] set minutes [expr {(($tm2-$tm1)/60)%60}]
if {$rc} { set seconds [expr {($tm2-$tm1)%60}]
puts "FAILED." set tm [format (%02d:%02d:%02d) $hours $minutes $seconds]
if {$rc} {
puts " FAIL $tm"
incr ::NERR
if {$errmsg!=""} {puts " $errmsg"}
} else {
puts " Ok $tm"
}
}
}
# 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]
if {$::tcl_platform(platform)=="windows"} {
lappend result sh
}
lappend result $::SRCDIR/configure -enable-load-extension >& 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]
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).
#
proc dryrun {args} {
if {$::DRYRUN} {
puts $args
} else { } else {
puts "Ok." uplevel 1 $args
} }
} }
@@ -292,16 +337,21 @@ proc run_test_suite {name testtarget config} {
# option. # option.
# #
proc process_options {argv} { proc process_options {argv} {
set ::MAKEFILE releasetest.mk ;# Default value set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]]
set ::QUICK 0 ;# Default value set ::QUICK 0
set ::BUILDONLY 0
set ::DRYRUN 0
set ::EXEC exec
set config {} set config {}
set platform $::tcl_platform(os)-$::tcl_platform(machine) set platform $::tcl_platform(os)-$::tcl_platform(machine)
for {set i 0} {$i < [llength $argv]} {incr i} { for {set i 0} {$i < [llength $argv]} {incr i} {
switch -- [lindex $argv $i] { set x [lindex $argv $i]
-makefile { if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]}
switch -- $x {
-srcdir {
incr i incr i
set ::MAKEFILE [lindex $argv $i] set ::SRCDIR [file normalize [lindex $argv $i]]
} }
-platform { -platform {
@@ -310,15 +360,41 @@ proc process_options {argv} {
} }
-quick { -quick {
incr i set ::QUICK 1
set ::QUICK [lindex $argv $i]
} }
-config { -config {
incr i incr i
set config [lindex $argv $i] set config [lindex $argv $i]
} }
-buildonly {
set ::BUILDONLY 1
}
-dryrun {
set ::DRYRUN 1
}
-info {
puts "Command-line Options:"
puts " --srcdir $::SRCDIR"
puts " --platform [list $platform]"
puts " --config [list $config]"
if {$::QUICK} {puts " --quick"}
if {$::BUILDONLY} {puts " --buildonly"}
if {$::DRYRUN} {puts " --dryrun"}
puts "\nAvailable --platform options:"
foreach y [lsort [array names ::Platforms]] {
puts " [list $y]"
}
puts "\nAvailable --config options:"
foreach y [lsort [array names ::Configs]] {
puts " [list $y]"
}
exit
}
default { default {
puts stderr "" puts stderr ""
puts stderr [string trim $::USAGE_MESSAGE] puts stderr [string trim $::USAGE_MESSAGE]
@@ -327,8 +403,6 @@ proc process_options {argv} {
} }
} }
set ::MAKEFILE [file normalize $::MAKEFILE]
if {0==[info exists ::Platforms($platform)]} { if {0==[info exists ::Platforms($platform)]} {
puts "Unknown platform: $platform" puts "Unknown platform: $platform"
puts -nonewline "Set the -platform option to " puts -nonewline "Set the -platform option to "
@@ -347,8 +421,13 @@ proc process_options {argv} {
} else { } else {
set ::CONFIGLIST $::Platforms($platform) set ::CONFIGLIST $::Platforms($platform)
} }
puts "Running the following configurations for $platform:" puts "Running the following test configurations for $platform:"
puts " [string trim $::CONFIGLIST]" puts " [string trim $::CONFIGLIST]"
puts -nonewline "Flags:"
if {$::DRYRUN} {puts -nonewline " --dryrun"}
if {$::BUILDONLY} {puts -nonewline " --buildonly"}
if {$::QUICK} {puts -nonewline " --quick"}
puts ""
} }
# Main routine. # Main routine.
@@ -357,30 +436,48 @@ proc main {argv} {
# Process any command line options. # Process any command line options.
process_options $argv process_options $argv
puts [string repeat * 70]
set ::NERR 0
set ::NTEST 0
set ::NTESTCASE 0
set ::NERRCASE 0
set STARTTIME [clock seconds]
foreach {zConfig target} $::CONFIGLIST { foreach {zConfig target} $::CONFIGLIST {
if {$::QUICK} {set target test} if {$::QUICK} {set target test}
if {$::BUILDONLY} {set target testfixture}
set config_options $::Configs($zConfig) set config_options $::Configs($zConfig)
incr NTEST
run_test_suite $zConfig $target $config_options run_test_suite $zConfig $target $config_options
# If the configuration included the SQLITE_DEBUG option, then remove # If the configuration included the SQLITE_DEBUG option, then remove
# it and run veryquick.test. If it did not include the SQLITE_DEBUG option # it and run veryquick.test. If it did not include the SQLITE_DEBUG option
# add it and run veryquick.test. # add it and run veryquick.test.
if {$target!="checksymbols"} { if {$target!="checksymbols" && !$::BUILDONLY} {
set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*]
set xtarget $target
regsub -all {fulltest[a-z]+} $xtarget test xtarget
if {$debug_idx < 0} { if {$debug_idx < 0} {
run_test_suite "${zConfig}_debug" test [ incr NTEST
concat $config_options -DSQLITE_DEBUG=1 append config_options " -DSQLITE_DEBUG=1"
] run_test_suite "${zConfig}_debug" $xtarget $config_options
} else { } else {
run_test_suite "${zConfig}_ndebug" test [ incr NTEST
lreplace $config_options $debug_idx $debug_idx regsub { *-DSQLITE_MEMDEBUG[^ ]* *} $config_options { } config_options
] regsub { *-DSQLITE_DEBUG[^ ]* *} $config_options { } config_options
run_test_suite "${zConfig}_ndebug" $xtarget $config_options
} }
} }
} }
set elapsetime [expr {[clock seconds]-$STARTTIME}]
set hr [expr {$elapsetime/3600}]
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"
} }
main $argv main $argv

View File

@@ -1,41 +1,41 @@
/* /*
** 2010-07-22
**
** 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.
**
*************************************************************************
**
** The code in this file runs a few multi-threaded test cases using the ** The code in this file runs a few multi-threaded test cases using the
** SQLite library. It can be compiled to an executable on unix using the ** SQLite library. It can be compiled to an executable on unix using the
** following command: ** following command:
** **
** gcc -O2 threadtest3.c sqlite3.c -ldl -lpthread -lm ** gcc -O2 threadtest3.c sqlite3.c -ldl -lpthread -lm
** **
** Then run the compiled program. The exit status is non-zero if any tests ** Even though threadtest3.c is the only C source code file mentioned on
** failed (hopefully there is also some output to stdout to clarify what went ** the compiler command-line, #include macros are used to pull in additional
** wrong). ** C code files named "tt3_*.c".
** **
** There are three parts to the code in this file, in the following order: ** After compiling, run this program with an optional argument telling
** which test to run. All tests are run if no argument is given. The
** argument can be a glob pattern to match multiple tests. Examples:
** **
** 1. Code for the SQL aggregate function md5sum() copied from ** ./a.out -- Run all tests
** tclsqlite.c in the SQLite distribution. The names of all the ** ./a.out walthread3 -- Run the "walthread3" test
** types and functions in this section begin with "MD5" or "md5". ** ./a.out 'wal*' -- Run all of the wal* tests
** ./a.out --help -- List all available tests
** **
** 2. A set of utility functions that may be used to implement ** The exit status is non-zero if any test fails.
** multi-threaded test cases. These are all called by test code
** via macros that help with error reporting. The macros are defined
** immediately below this comment.
**
** 3. The test code itself. And a main() routine to drive the test
** code.
*/ */
/************************************************************************* /*
** Start of test code/infrastructure interface macros. ** The "Set Error Line" macro.
**
** The following macros constitute the interface between the test
** programs and the test infrastructure. Test infrastructure code
** does not itself use any of these macros. Test code should not
** call any of the macroname_x() functions directly.
**
** See the header comments above the corresponding macroname_x()
** function for a description of each interface.
*/ */
#define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__))
/* Database functions */ /* Database functions */
#define opendb(w,x,y,z) (SEL(w), opendb_x(w,x,y,z)) #define opendb(w,x,y,z) (SEL(w), opendb_x(w,x,y,z))
@@ -391,9 +391,9 @@ static void md5finalize(sqlite3_context *context){
sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
} }
/************************************************************************* /*
** End of copied md5sum() code. ** End of copied md5sum() code.
*/ **************************************************************************/
typedef sqlite3_int64 i64; typedef sqlite3_int64 i64;
@@ -448,7 +448,8 @@ static void free_err(Error *p){
static void print_err(Error *p){ static void print_err(Error *p){
if( p->rc!=SQLITE_OK ){ if( p->rc!=SQLITE_OK ){
printf("Error: (%d) \"%s\" at line %d\n", p->rc, p->zErr, p->iLine); printf("Error: (%d) \"%s\" at line %d\n", p->rc, p->zErr, p->iLine);
nGlobalErr++; if( sqlite3_strglob("* - no such table: *",p->zErr)!=0 ) nGlobalErr++;
fflush(stdout);
} }
} }
@@ -785,6 +786,7 @@ static void join_all_threads_x(
if( pErr->rc==SQLITE_OK ) system_error(pErr, rc); if( pErr->rc==SQLITE_OK ) system_error(pErr, rc);
}else{ }else{
printf("Thread %d says: %s\n", p->iTid, (ret==0 ? "..." : (char *)ret)); printf("Thread %d says: %s\n", p->iTid, (ret==0 ? "..." : (char *)ret));
fflush(stdout);
} }
sqlite3_free(p); sqlite3_free(p);
} }
@@ -898,11 +900,6 @@ static int timetostop_x(
return ret; return ret;
} }
/*
** The "Set Error Line" macro.
*/
#define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__))
/************************************************************************* /*************************************************************************
************************************************************************** **************************************************************************
@@ -1427,9 +1424,9 @@ static void dynamic_triggers(int nMs){
int main(int argc, char **argv){ int main(int argc, char **argv){
struct ThreadTest { struct ThreadTest {
void (*xTest)(int); void (*xTest)(int); /* Routine for running this test */
const char *zTest; const char *zTest; /* Name of this test */
int nMs; int nMs; /* How long to run this test, in milliseconds */
} aTest[] = { } aTest[] = {
{ walthread1, "walthread1", 20000 }, { walthread1, "walthread1", 20000 },
{ walthread2, "walthread2", 20000 }, { walthread2, "walthread2", 20000 },
@@ -1452,7 +1449,7 @@ int main(int argc, char **argv){
}; };
int i; int i;
int bTestfound = 0; int nTestfound = 0;
sqlite3_config(SQLITE_CONFIG_MULTITHREAD); sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
sqlite3_config(SQLITE_CONFIG_MULTITHREAD); sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
@@ -1468,12 +1465,13 @@ int main(int argc, char **argv){
} }
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000); printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
fflush(stdout);
aTest[i].xTest(aTest[i].nMs); aTest[i].xTest(aTest[i].nMs);
bTestfound++; nTestfound++;
} }
if( bTestfound==0 ) goto usage; if( nTestfound==0 ) goto usage;
printf("Total of %d errors across all tests\n", nGlobalErr); printf("%d errors out of %d tests\n", nGlobalErr, nTestfound);
return (nGlobalErr>0 ? 255 : 0); return (nGlobalErr>0 ? 255 : 0);
usage: usage:
@@ -1485,5 +1483,3 @@ int main(int argc, char **argv){
return 254; return 254;
} }

View File

@@ -1,5 +1,5 @@
/* /*
** 2001 September 15 ** 2011-02-02
** **
** The author disclaims copyright to this source code. In place of ** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing: ** a legal notice, here is a blessing:
@@ -146,5 +146,3 @@ static void checkpoint_starvation_2(int nMs){
} }
print_and_free_err(&err); print_and_free_err(&err);
} }

View File

@@ -363,9 +363,10 @@ foreach {testprefix do_wal_checkpoint} {
code2 $do_wal_checkpoint code2 $do_wal_checkpoint
code3 $do_wal_checkpoint code3 $do_wal_checkpoint
do_test 3.$tn.1 { do_test 4.$tn.1 {
sql1 { sql1 {
PRAGMA page_size = 1024; PRAGMA page_size = 1024;
PRAGMA auto_vacuum = 0;
PRAGMA journal_mode = WAL; PRAGMA journal_mode = WAL;
PRAGMA synchronous = normal; PRAGMA synchronous = normal;
CREATE TABLE t1(x, y); CREATE TABLE t1(x, y);
@@ -376,14 +377,14 @@ foreach {testprefix do_wal_checkpoint} {
file size test.db-wal file size test.db-wal
} [wal_file_size 8 1024] } [wal_file_size 8 1024]
do_test 3.$tn.2 { do_wal_checkpoint db -mode truncate } {0 0 0} do_test 4.$tn.2 { do_wal_checkpoint db -mode truncate } {0 0 0}
do_test 3.$tn.3 { file size test.db-wal } 0 do_test 4.$tn.3 { file size test.db-wal } 0
do_test 3.$tn.4 { do_test 4.$tn.4 {
sql2 { SELECT * FROM t1 } sql2 { SELECT * FROM t1 }
} {1 2 3 4} } {1 2 3 4}
do_test 3.$tn.5 { do_test 4.$tn.5 {
sql2 { INSERT INTO t1 VALUES('a', 'b') } sql2 { INSERT INTO t1 VALUES('a', 'b') }
file size test.db-wal file size test.db-wal
} [wal_file_size 2 1024] } [wal_file_size 2 1024]

41
test/without_rowid6.test Normal file
View File

@@ -0,0 +1,41 @@
# 2014-12-28
#
# 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.
#
#***********************************************************************
#
# Verify that WITHOUT ROWID tables work correctly when the PRIMARY KEY
# has redundant columns.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
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);
WITH RECURSIVE
c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<1000)
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-110 {
SELECT c FROM t1 WHERE a=123;
} {x123y}
do_execsql_test without_rowid6-120 {
SELECT c FROM t1 WHERE b=1123;
} {x123y}
do_execsql_test without_rowid6-130 {
SELECT c FROM t1 ORDER BY a DESC LIMIT 5;
} {x1000y x999y x998y x997y x996y}
do_execsql_test without_rowid6-140 {
SELECT c FROM t1 ORDER BY b LIMIT 5;
} {x1y x2y x3y x4y x5y}
finish_test

View File

@@ -214,7 +214,7 @@ proc copy_file {filename} {
} }
} elseif {[regexp {^(SQLITE_EXTERN )?void \(\*sqlite3IoTrace\)} $line]} { } elseif {[regexp {^(SQLITE_EXTERN )?void \(\*sqlite3IoTrace\)} $line]} {
regsub {^SQLITE_EXTERN } $line {} line regsub {^SQLITE_EXTERN } $line {} line
puts $out "SQLITE_PRIVATE $line" puts $out $line
} elseif {[regexp {^void \(\*sqlite3Os} $line]} { } elseif {[regexp {^void \(\*sqlite3Os} $line]} {
puts $out "SQLITE_PRIVATE $line" puts $out "SQLITE_PRIVATE $line"
} else { } else {