Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac536e613a | |||
| 5ef09bf918 | |||
| 8c8dddc904 | |||
| 72ea29d7ae | |||
| ea06a271a4 | |||
| 92a8277149 | |||
| a295d1521a | |||
| 855ed4a3b4 | |||
| df12f1c69b | |||
| dc27851e21 | |||
| d797a9b5cb | |||
| 28a6a1168b | |||
| 2f5bfd959a | |||
| 15427279c8 | |||
| 9802947fd8 | |||
| 7a7f688979 | |||
| 90e5dda217 | |||
| 7be53fe441 | |||
| 5fcc1ba4e7 | |||
| 48c06f32ca | |||
| c18ed977e8 | |||
| f7ce4291a9 | |||
| 9a8941fc83 | |||
| af19f173d3 | |||
| ab37277367 | |||
| 333e6ca9a5 | |||
| f3b1ed0fc2 | |||
| 2c8fd12f42 | |||
| adfa22e118 | |||
| 50358adfaa | |||
| dcfb9652fd | |||
| 053378dfa8 | |||
| 41d2e66ef3 | |||
| 415afddaae | |||
| e1818ec740 |
+1
-1
@@ -1156,7 +1156,7 @@ THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
|
||||
$(TOP)/test/tt3_lookaside1.c
|
||||
|
||||
threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
|
||||
$(LTLINK) $(TOP)/test/threadtest3.c sqlite3.lo -o $@ $(TLIBS)
|
||||
$(LTLINK) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.lo -o $@ $(TLIBS)
|
||||
|
||||
threadtest: threadtest3$(TEXE)
|
||||
./threadtest3$(TEXE)
|
||||
|
||||
@@ -795,8 +795,8 @@ THREADTEST3_SRC = $(TOP)/test/threadtest3.c \
|
||||
$(TOP)/test/tt3_stress.c \
|
||||
$(TOP)/test/tt3_lookaside1.c
|
||||
|
||||
threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC)
|
||||
$(TCCX) $(TOP)/test/threadtest3.c sqlite3.o -o $@ $(THREADLIB)
|
||||
threadtest3$(EXE): sqlite3.o $(THREADTEST3_SRC) $(TOP)/src/test_multiplex.c
|
||||
$(TCCX) $(TOP)/test/threadtest3.c $(TOP)/src/test_multiplex.c sqlite3.o -o $@ $(THREADLIB)
|
||||
|
||||
threadtest: threadtest3$(EXE)
|
||||
./threadtest3$(EXE)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
C Add\sexperimental\ssupport\sfor\sthe\s'test_fs'\stest\smodule\son\sWin32.
|
||||
D 2015-11-30T23:29:07.971
|
||||
F Makefile.in 23d9a63484a383fc64951b25ef44067930f98dc6
|
||||
C Move\spointer\srange\scomparisons\sinto\sa\smacro,\swhere\sthey\scan\sbe\sdealt\swith\nin\sa\smore\sportable\sway.
|
||||
D 2015-12-10T15:09:17.462
|
||||
F Makefile.in 28bcd6149e050dff35d4dcfd97e890cd387a499d
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc e8fdca1cb89a1b58b5f4d3a130ea9a3d28cb314d
|
||||
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
|
||||
@@ -263,7 +263,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
|
||||
F main.mk 9001039f432baeba1074e2d1885f3dfd572b8636
|
||||
F main.mk ed77cbb97848c8dae1ab928245432f74b0580162
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
@@ -282,20 +282,20 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
|
||||
F src/backup.c 2869a76c03eb393ee795416e2387005553df72bc
|
||||
F src/bitvec.c 1a78d450a17c5016710eec900bedfc5729bf9bdf
|
||||
F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
|
||||
F src/btree.c d3bdd8462a86492e2ebc9aca4a0168429017de25
|
||||
F src/btree.c 450950ce366159c3215736ae43d1062e7c06f741
|
||||
F src/btree.h 2d76dee44704c47eed323356a758662724b674a0
|
||||
F src/btreeInt.h 3ab435ed27adea54d040584b0bcc488ee7db1e38
|
||||
F src/build.c e83da4d004a4e050c01acbb821ff7a7b1019c29b
|
||||
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
|
||||
F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
|
||||
F src/ctime.c 509ef9c64d1321f42448f111da86400b1799218a
|
||||
F src/ctime.c 60e135af364d777a9ab41c97e5e89cd224da6198
|
||||
F src/date.c fb1c99172017dcc8e237339132c91a21a0788584
|
||||
F src/dbstat.c ffd63fc8ba7541476ced189b95e95d7f2bc63f78
|
||||
F src/delete.c 00af9f08a15ddc5cba5962d3d3e5bf2d67b2e7da
|
||||
F src/expr.c cb1a419508e5b27769a91e00e36e94724e7b1d51
|
||||
F src/expr.c ccb93d7b7e1ac5d187c9b153bae145933f93ee5c
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c 31900763094a3736a5fc887469202eb579fef2d0
|
||||
F src/func.c 5790a898a0c53e6787020ec268425d415e7e03c9
|
||||
F src/func.c fe50a9ab977acc0bb0fcd46741e0071fa388888e
|
||||
F src/global.c 508e4087f7b41d688e4762dcf4d4fe28cfbc87f9
|
||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||
@@ -303,9 +303,9 @@ F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
|
||||
F src/insert.c e1d20ae8979e25519c2670233718676bedcfedc9
|
||||
F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
|
||||
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
|
||||
F src/loadext.c 18586e45a215325f15096821e9c082035d4fb810
|
||||
F src/main.c 3f2828fce1e45c3ad096c69eee1e96962c7281c5
|
||||
F src/malloc.c 337bbe9c7d436ef9b7d06b5dd10bbfc8f3025972
|
||||
F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b
|
||||
F src/main.c a950e48920e8c0f0ff82b2b2ccfe11aa89ca11d4
|
||||
F src/malloc.c 8f787669e79de26efc42272b5797bc00fff527c6
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b
|
||||
F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3
|
||||
@@ -323,7 +323,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
|
||||
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
||||
F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e
|
||||
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||
F src/os_unix.c 88d9fd1da4f3d26c64ef954fb32cce583605eba0
|
||||
F src/os_unix.c 0ca6d8710366fbb01a275160f018334cd347cbda
|
||||
F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811
|
||||
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
|
||||
F src/pager.c f92aacd5216d8815136c9e0190041783c602641a
|
||||
@@ -335,21 +335,21 @@ F src/pcache1.c 46a110be31a8d9f9b41431733836822ca0dd27ab
|
||||
F src/pragma.c f3e7147299ca05ef4304a36f1fd6e002729c72c6
|
||||
F src/pragma.h 3d94aebbebd2089899fecc01909bf2608b39507d
|
||||
F src/prepare.c 82e5db1013846a819f198336fed72c44c974e7b1
|
||||
F src/printf.c ca05561795ad6c2fa47acdd007702586282f7feb
|
||||
F src/printf.c af589a27b7d40f6f4f704e9eea99f02f18ad6d32
|
||||
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
|
||||
F src/resolve.c f4c897ca76ca6d5e0b3f0499c627392ffe657c8e
|
||||
F src/resolve.c a83b41104e6ff69855d03cd0aaa09e93927ec39f
|
||||
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
||||
F src/select.c e10586c750d87211caa8f4b239e2bfa6a2049e5b
|
||||
F src/shell.c 2796237990d42e6a5a7beafee65ef70cc8767d21
|
||||
F src/sqlite.h.in 5bd83191711d3dc85030326daa9e8e5226a495e7
|
||||
F src/select.c f8fded11fc443a9f5a73cc5db069d06b34460e2f
|
||||
F src/shell.c abbc74ea43dbf2f306ea18282d666683fb5efab2
|
||||
F src/sqlite.h.in 1248a78548024bdc8ef5893faa0ff9552b4cceb4
|
||||
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
|
||||
F src/sqlite3ext.h 41ef50b0418a7c5ad1337bb80db5a7928dee764f
|
||||
F src/sqliteInt.h 64256d193a16a147d9f6317cc4e095fdd3e0a2e9
|
||||
F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
|
||||
F src/sqliteInt.h d9b64d12231789a5fae72e380da5544ad1a34d9f
|
||||
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
|
||||
F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
|
||||
F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
|
||||
F src/tclsqlite.c d9439b6a910985b7fff43ba6756bcef00de22649
|
||||
F src/test1.c 4004bcc1b3b361a9137acd1d875599ecbdd6f961
|
||||
F src/test1.c 90c4e80c7f4b0ad82c6dbe699c8f430b641769f5
|
||||
F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b
|
||||
F src/test3.c a8887dabbbee3059af338f20d290084a63ed1b0f
|
||||
F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
|
||||
@@ -363,10 +363,10 @@ F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
|
||||
F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
|
||||
F src/test_blob.c e5a7a81d61a780da79101aeb1e60d300af169e07
|
||||
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
|
||||
F src/test_config.c f2824de39f59d8d621e2d6ec5cc67006d000b2eb
|
||||
F src/test_config.c 48850687dd5abc8260e23835632511054ccae172
|
||||
F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
|
||||
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
|
||||
F src/test_fs.c aab47ac456316502faa265daadf9ac832fea12b9
|
||||
F src/test_fs.c 993c7eab65bed6add4bb48cca29775e963f710cf
|
||||
F src/test_func.c 0d9c25956152adefee8881c6fadc8354793764d0
|
||||
F src/test_hexio.c abfdecb6fa58c354623978efceb088ca18e379cd
|
||||
F src/test_init.c 66b33120ffe9cd853b5a905ec850d51151337b32
|
||||
@@ -374,8 +374,8 @@ F src/test_intarray.c 870124b95ec4c645d4eb84f15efb7133528fb1a5
|
||||
F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202
|
||||
F src/test_journal.c 5360fbe1d1e4416ca36290562fd5a2e3f70f32aa
|
||||
F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4
|
||||
F src/test_malloc.c 8e1c2112fa4f543b46c990a8872f9e6d37938744
|
||||
F src/test_multiplex.c 9fefd23f6cc3fa9bf0748a5e453167e7b9f193ce
|
||||
F src/test_malloc.c 96df9381a1ff1f6d3805ff7231b9baf1386aaabf
|
||||
F src/test_multiplex.c 6a088d8d9d4aad4bec45dd8878af11b15900702d
|
||||
F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3
|
||||
F src/test_mutex.c dbdfaff8580071f2212a0deae3325a93a737819c
|
||||
F src/test_onefile.c 38f7cbe79d5bafe95bde683cc3a53b8ca16daf10
|
||||
@@ -399,28 +399,28 @@ F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c bbfb74450643cb5372a43ad4f6cffd7e9dfcecb0
|
||||
F src/tokenize.c 5606871a377f390af7040ec3c12e0d183512d785
|
||||
F src/treeview.c 78842e90c1f71269e7a73a1d4221b6fe360bab66
|
||||
F src/trigger.c 322f23aad694e8f31d384dcfa386d52a48d3c52f
|
||||
F src/trigger.c de3ed31ad3218a20d7d7e18bf1b3b734e78bda66
|
||||
F src/update.c 17332f9fe818cbc0444c36a811800af8498af4c3
|
||||
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
|
||||
F src/util.c e802e8e311a0d6c48cd1b3e89db164f6f0248d70
|
||||
F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
|
||||
F src/vdbe.c b56b2fc9b2f2d0a99d1dbd02d47efaacec253a4c
|
||||
F src/vdbe.c 4d75375fa8bf911aa76ab8383d6f7eea0dec0fda
|
||||
F src/vdbe.h efb7a8c1459e31f3ea4377824c6a7e4cb5068637
|
||||
F src/vdbeInt.h 75c2e82ee3357e9210c06474f8d9bdf12c81105d
|
||||
F src/vdbeapi.c 020681b943e77766b32ae1cddf86d7831b7374ca
|
||||
F src/vdbeaux.c 9a234c9aaab4ad725daf94667cfed441a437c52d
|
||||
F src/vdbeaux.c e07b2c8d14064f2094d20d002a2a1082913bbd2a
|
||||
F src/vdbeblob.c fdc4a81605ae7a35ae94a55bd768b66d6be16f15
|
||||
F src/vdbemem.c fdd1578e47bea61390d472de53c565781d81e045
|
||||
F src/vdbesort.c a7ec02da4494c59dfd071126dd3726be5a11459d
|
||||
F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0
|
||||
F src/vtab.c 2a8b44aa372c33f6154208e7a7f6c44254549806
|
||||
F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
|
||||
F src/wal.c 18b0ed49830cf04fe2d68224b41838a73ac6cd24
|
||||
F src/wal.c 1569802364cd192bbd5c4a8ea3fd6de593edecbd
|
||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
|
||||
F src/where.c 9c04982ba9ecfc7751c670ed5a3bddc81d7eb74c
|
||||
F src/whereInt.h 6afc0d70cf6213e58e8fbe10b6e50d1aa16f122f
|
||||
F src/wherecode.c 4c96182e7b25e4be54008dee2da5b9c2f8480b9b
|
||||
F src/where.c b18edbb9e5afabb77f4f27550c471c5c824e0fe7
|
||||
F src/whereInt.h e20801d89e34de1912bb6a3babb30c390da27add
|
||||
F src/wherecode.c dfbfe198e418b01f208b489e088edd230c91a4e7
|
||||
F src/whereexpr.c eebba8340c90de73b3d3bbe8c43b84559b8e6e2c
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
|
||||
@@ -435,7 +435,7 @@ F test/alter4.test c461150723ac957f3b2214aa0b11552cd72023ec
|
||||
F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
F test/analyze.test 3eb35a4af972f98422e5dc0586501b17d103d321
|
||||
F test/analyze3.test 0f0ee6135b293a0e5af471a8423b80b688469d71
|
||||
F test/analyze3.test 1dccda46a6c374018af617fba00bfe297a61d442
|
||||
F test/analyze4.test eff2df19b8dd84529966420f29ea52edc6b56213
|
||||
F test/analyze5.test 765c4e284aa69ca172772aa940946f55629bc8c4
|
||||
F test/analyze6.test f1c552ce39cca4ec922a7e4e0e5d0203d6b3281f
|
||||
@@ -508,7 +508,7 @@ F test/cacheflush.test a755c93482ce2e20c04825304bef27e7b7ea0111
|
||||
F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738
|
||||
F test/capi3.test bf6f0308bbbba1e770dac13aa08e5c2ac61c7324
|
||||
F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
|
||||
F test/capi3c.test fdc0d67a2cb8e8fc400d5b7735e330161ea057a2
|
||||
F test/capi3c.test 06f6261f9e9b4ef6f76afcd9900f3665408af1c8
|
||||
F test/capi3d.test 485048dc5cd07bc68011e4917ad035ad6047ab82
|
||||
F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe
|
||||
F test/cast.test 4c275cbdc8202d6f9c54a3596701719868ac7dc3
|
||||
@@ -610,7 +610,7 @@ F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608
|
||||
F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664
|
||||
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
|
||||
F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473
|
||||
F test/enc3.test 90683ad0e6ea587b9d5542ca93568af9a9858c40
|
||||
F test/enc3.test 6807f7a7740a00361ca8d0ccd66bc60c8dc5f2b6
|
||||
F test/enc4.test c8f1ce3618508fd0909945beb8b8831feef2c020
|
||||
F test/eqp.test 85873fa5816c48915c82c4e74cb5c35a5b48160f
|
||||
F test/errmsg.test f31592a594b44ee121371d25ddd5d63497bb3401
|
||||
@@ -829,9 +829,9 @@ F test/json102.test bf3fe7a706d30936a76a0f7a0375e1e8e73aff5a
|
||||
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
|
||||
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
|
||||
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
|
||||
F test/like.test 4f2a71d36a536233727f71995fef900756705e56
|
||||
F test/like.test edcf6d0a055816fd793eab92454597c1be91f720
|
||||
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
|
||||
F test/like3.test 7b0525a39e4f25c4fd113de7e2e28eb712dcdedf
|
||||
F test/like3.test 3608a2042b6f922f900fbfd5d3ce4e7eca57f7c4
|
||||
F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
|
||||
F test/loadext.test 648cb95f324d1775c54a55c12271b2d1156b633b
|
||||
F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
|
||||
@@ -934,7 +934,7 @@ F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test 4ea119731c62d2f7d0aa86dd5b184cbb61ca411b
|
||||
F test/pragma.test a44253f911e7d50127d4a08f927f47c861a4c772
|
||||
F test/pragma2.test 00065068eeab2d15ea55465ec0f1e0a70e2c369e
|
||||
F test/pragma2.test a9400a7289605280576098b97f5cde3f204075c0
|
||||
F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
|
||||
F test/printf.test b3ff34e73d59124140eaf89f7672e21bc2ca5fcc
|
||||
F test/printf2.test 0b61566dd1c0f0b802f59dffa228c5dc5aa6b054
|
||||
@@ -1054,7 +1054,7 @@ F test/superlock.test 1cde669f68d2dd37d6c9bd35eee1d95491ae3fc2
|
||||
F test/symlink.test cbf6cb8c6c4b63a39e9f0f6b0d5c99e249dbc102
|
||||
F test/sync.test a34cd43e98b7fb84eabbf38f7ed8f7349b3f3d85
|
||||
F test/syscall.test 2aa9e111b79fb385681ff8940124def6f8faab87
|
||||
F test/sysfault.test fa776e60bf46bdd3ae69f0b73e46ee3977a58ae6
|
||||
F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04
|
||||
F test/tabfunc01.test cc33684f9480fcf1fd5ce287ac28d22971cad1cc
|
||||
F test/table.test b708f3e5fa2542fa51dfab21fc07b36ea445cb2f
|
||||
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
|
||||
@@ -1074,7 +1074,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
|
||||
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
|
||||
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
|
||||
F test/threadtest2.c a70a8e94bef23339d34226eb9521015ef99f4df8
|
||||
F test/threadtest3.c 0707c28e0954acbef654f91675e14f3573cf9a10
|
||||
F test/threadtest3.c 7ca82330041456afa52e4968196bb0867371f91b
|
||||
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
|
||||
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
|
||||
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
|
||||
@@ -1276,7 +1276,7 @@ F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292
|
||||
F test/vtabD.test 05b3f1d77117271671089e48719524b676842e96
|
||||
F test/vtabE.test d5024aa42754962f6bb0afd261681686488e7afe
|
||||
F test/vtabF.test fd5ad376f5a34fe0891df1f3cddb4fe7c3eb077e
|
||||
F test/vtabH.test 2803a8773d1017ac93bbec6900fc7c35bb56c1c3
|
||||
F test/vtabH.test f77296bbf55675b72817cc10fbbcb236ac986abf
|
||||
F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f
|
||||
F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
|
||||
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
|
||||
@@ -1314,8 +1314,8 @@ F test/where3.test 1ad55ba900bd7747f98b6082e65bd3e442c5004e
|
||||
F test/where4.test 4a371bfcc607f41d233701bdec33ac2972908ba8
|
||||
F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
|
||||
F test/where6.test 5da5a98cec820d488e82708301b96cb8c18a258b
|
||||
F test/where7.test 5a4b0abc207d71da4deecd734ad8579e8dd40aa8
|
||||
F test/where8.test 2eafe74e01cc10355985874e1ff868ac03dbae5e
|
||||
F test/where7.test f520bcec2c3d12dc4615623b06b2aec7c2d67e94
|
||||
F test/where8.test 98eedca0d375fb400b8377269c4b4686582dfb45
|
||||
F test/where8m.test da346596e19d54f0aba35ebade032a7c47d79739
|
||||
F test/where9.test 729c3ba9b47e8f9f1aab96bae7dad2a524f1d1a2
|
||||
F test/whereA.test 4d253178d135ec46d1671e440cd8f2b916aa6e6b
|
||||
@@ -1348,9 +1348,9 @@ F test/wordcount.c 2a0a6c0d0e8e8bbbac1f06d72a6791828c37c0cf
|
||||
F test/zeroblob.test 3857870fe681b8185654414a9bccfde80b62a0fa
|
||||
F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac
|
||||
F tool/GetFile.cs a15e08acb5dd7539b75ba23501581d7c2b462cb5
|
||||
F tool/GetTclKit.bat 8606413d3035c05373a0d7fae82ebf59ae9e16c3
|
||||
F tool/GetTclKit.bat 629d87562e0487c386db630033931d12d62e6372
|
||||
F tool/addopcodes.tcl 4ca9c3ef196f08da30add5d07ce0c9458dc8c633
|
||||
F tool/build-all-msvc.bat e42141ca3c3812315432f9813ef9eb78aa8d99c9 x
|
||||
F tool/build-all-msvc.bat 204a039f985d5a4f4f9df3a3aa594fd17848c37e x
|
||||
F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367
|
||||
F tool/cg_anno.tcl 692ce4b8693d59e3a3de77ca97f4139ecfa641b0 x
|
||||
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
|
||||
@@ -1408,10 +1408,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P ecad75d69e0d5c83dd3584d363e557e84b65f7f2
|
||||
R b2c7ca19fb46e255338240c0ac77a2e4
|
||||
T *branch * testFsWin32
|
||||
T *sym-testFsWin32 *
|
||||
T -sym-trunk *
|
||||
U mistachkin
|
||||
Z b75cf97131a1f035edfb9c37c590fcf6
|
||||
P 6a5dfe85b519b920ce8c842057767a8793d92236
|
||||
R a58d43459fedbad83f2fea42e9df49aa
|
||||
U drh
|
||||
Z 0494ab55e74ae33c389abc3bd2b83951
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
f3ffb3aeea95712e92919fd5071741327add9643
|
||||
ad3124c834b080aaaf24934d6f08b3601ac3ae53
|
||||
+1
-2
@@ -7521,8 +7521,7 @@ static int balance_nonroot(
|
||||
** overflow cell), we can skip updating the pointer map entries. */
|
||||
if( iOld>=nNew
|
||||
|| pNew->pgno!=aPgno[iOld]
|
||||
|| pCell<aOld
|
||||
|| pCell>=&aOld[usableSize]
|
||||
|| !SQLITE_WITHIN(pCell,aOld,&aOld[usableSize])
|
||||
){
|
||||
if( !leafCorrection ){
|
||||
ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc);
|
||||
|
||||
@@ -63,6 +63,9 @@ static const char * const azCompileOpt[] = {
|
||||
#if SQLITE_DISABLE_LFS
|
||||
"DISABLE_LFS",
|
||||
#endif
|
||||
#if SQLITE_ENABLE_8_3_NAMES
|
||||
"ENABLE_8_3_NAMES",
|
||||
#endif
|
||||
#if SQLITE_ENABLE_API_ARMOR
|
||||
"ENABLE_API_ARMOR",
|
||||
#endif
|
||||
@@ -158,6 +161,9 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_INT64_TYPE
|
||||
"INT64_TYPE",
|
||||
#endif
|
||||
#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
"LIKE_DOESNT_MATCH_BLOBS",
|
||||
#endif
|
||||
#if SQLITE_LOCK_TRACE
|
||||
"LOCK_TRACE",
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -853,6 +853,7 @@ static int dupedExprSize(Expr *p, int flags){
|
||||
*/
|
||||
static Expr *exprDup(sqlite3 *db, Expr *p, int flags, u8 **pzBuffer){
|
||||
Expr *pNew = 0; /* Value to return */
|
||||
assert( flags==0 || flags==EXPRDUP_REDUCE );
|
||||
if( p ){
|
||||
const int isReduced = (flags&EXPRDUP_REDUCE);
|
||||
u8 *zAlloc;
|
||||
@@ -889,7 +890,9 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int flags, u8 **pzBuffer){
|
||||
}else{
|
||||
int nSize = exprStructSize(p);
|
||||
memcpy(zAlloc, p, nSize);
|
||||
memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
|
||||
if( nSize<EXPR_FULLSIZE ){
|
||||
memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */
|
||||
@@ -979,6 +982,7 @@ static With *withDup(sqlite3 *db, With *p){
|
||||
** part of the in-memory representation of the database schema.
|
||||
*/
|
||||
Expr *sqlite3ExprDup(sqlite3 *db, Expr *p, int flags){
|
||||
assert( flags==0 || flags==EXPRDUP_REDUCE );
|
||||
return exprDup(db, p, flags, 0);
|
||||
}
|
||||
ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){
|
||||
|
||||
+11
@@ -802,6 +802,17 @@ static void likeFunc(
|
||||
int nPat;
|
||||
sqlite3 *db = sqlite3_context_db_handle(context);
|
||||
|
||||
#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
if( sqlite3_value_type(argv[0])==SQLITE_BLOB
|
||||
|| sqlite3_value_type(argv[1])==SQLITE_BLOB
|
||||
){
|
||||
#ifdef SQLITE_TEST
|
||||
sqlite3_like_count++;
|
||||
#endif
|
||||
sqlite3_result_int(context, 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
zB = sqlite3_value_text(argv[0]);
|
||||
zA = sqlite3_value_text(argv[1]);
|
||||
|
||||
|
||||
+5
-1
@@ -410,7 +410,11 @@ static const sqlite3_api_routines sqlite3Apis = {
|
||||
sqlite3_bind_zeroblob64,
|
||||
/* Version 3.9.0 and later */
|
||||
sqlite3_value_subtype,
|
||||
sqlite3_result_subtype
|
||||
sqlite3_result_subtype,
|
||||
/* Version 3.10.0 and later */
|
||||
sqlite3_status64,
|
||||
sqlite3_strlike,
|
||||
sqlite3_db_cacheflush
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
+4
-3
@@ -445,9 +445,10 @@ int sqlite3_config(int op, ...){
|
||||
break;
|
||||
}
|
||||
case SQLITE_CONFIG_PAGECACHE: {
|
||||
/* EVIDENCE-OF: R-31408-40510 There are three arguments to
|
||||
** SQLITE_CONFIG_PAGECACHE: A pointer to 8-byte aligned memory, the size
|
||||
** of each page buffer (sz), and the number of pages (N). */
|
||||
/* EVIDENCE-OF: R-18761-36601 There are three arguments to
|
||||
** SQLITE_CONFIG_PAGECACHE: A pointer to 8-byte aligned memory (pMem),
|
||||
** the size of each page cache line (sz), and the number of cache lines
|
||||
** (N). */
|
||||
sqlite3GlobalConfig.pPage = va_arg(ap, void*);
|
||||
sqlite3GlobalConfig.szPage = va_arg(ap, int);
|
||||
sqlite3GlobalConfig.nPage = va_arg(ap, int);
|
||||
|
||||
+2
-2
@@ -358,7 +358,7 @@ void sqlite3ScratchFree(void *p){
|
||||
scratchAllocOut--;
|
||||
#endif
|
||||
|
||||
if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){
|
||||
if( SQLITE_WITHIN(p, sqlite3GlobalConfig.pScratch, mem0.pScratchEnd) ){
|
||||
/* Release memory from the SQLITE_CONFIG_SCRATCH allocation */
|
||||
ScratchFreeslot *pSlot;
|
||||
pSlot = (ScratchFreeslot*)p;
|
||||
@@ -394,7 +394,7 @@ void sqlite3ScratchFree(void *p){
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_LOOKASIDE
|
||||
static int isLookaside(sqlite3 *db, void *p){
|
||||
return p>=db->lookaside.pStart && p<db->lookaside.pEnd;
|
||||
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pEnd);
|
||||
}
|
||||
#else
|
||||
#define isLookaside(A,B) 0
|
||||
|
||||
+48
-60
@@ -258,7 +258,6 @@ static pid_t randomnessPid = 0;
|
||||
#define UNIXFILE_DELETE 0x20 /* Delete on close */
|
||||
#define UNIXFILE_URI 0x40 /* Filename might have query parameters */
|
||||
#define UNIXFILE_NOLOCK 0x80 /* Do no file locking */
|
||||
#define UNIXFILE_BLOCK 0x0100 /* Next SHM lock might block */
|
||||
|
||||
/*
|
||||
** Include code that is common to all os_*.c files
|
||||
@@ -1407,9 +1406,7 @@ static int unixFileLock(unixFile *pFile, struct flock *pLock){
|
||||
unixInodeInfo *pInode = pFile->pInode;
|
||||
assert( unixMutexHeld() );
|
||||
assert( pInode!=0 );
|
||||
if( ((pFile->ctrlFlags & UNIXFILE_EXCL)!=0 || pInode->bProcessLock)
|
||||
&& ((pFile->ctrlFlags & UNIXFILE_RDONLY)==0)
|
||||
){
|
||||
if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){
|
||||
if( pInode->bProcessLock==0 ){
|
||||
struct flock lock;
|
||||
assert( pInode->nLock==0 );
|
||||
@@ -3086,13 +3083,9 @@ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){
|
||||
SimulateIOError( got = -1 );
|
||||
#else
|
||||
newOffset = lseek(id->h, offset, SEEK_SET);
|
||||
SimulateIOError( newOffset-- );
|
||||
if( newOffset!=offset ){
|
||||
if( newOffset == -1 ){
|
||||
storeLastErrno((unixFile*)id, errno);
|
||||
}else{
|
||||
storeLastErrno((unixFile*)id, 0);
|
||||
}
|
||||
SimulateIOError( newOffset = -1 );
|
||||
if( newOffset<0 ){
|
||||
storeLastErrno((unixFile*)id, errno);
|
||||
return -1;
|
||||
}
|
||||
got = osRead(id->h, pBuf, cnt);
|
||||
@@ -3191,6 +3184,7 @@ static int seekAndWriteFd(
|
||||
|
||||
assert( nBuf==(nBuf&0x1ffff) );
|
||||
assert( fd>2 );
|
||||
assert( piErrno!=0 );
|
||||
nBuf &= 0x1ffff;
|
||||
TIMER_START;
|
||||
|
||||
@@ -3201,11 +3195,10 @@ static int seekAndWriteFd(
|
||||
#else
|
||||
do{
|
||||
i64 iSeek = lseek(fd, iOff, SEEK_SET);
|
||||
SimulateIOError( iSeek-- );
|
||||
|
||||
if( iSeek!=iOff ){
|
||||
if( piErrno ) *piErrno = (iSeek==-1 ? errno : 0);
|
||||
return -1;
|
||||
SimulateIOError( iSeek = -1 );
|
||||
if( iSeek<0 ){
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
rc = osWrite(fd, pBuf, nBuf);
|
||||
}while( rc<0 && errno==EINTR );
|
||||
@@ -3214,7 +3207,7 @@ static int seekAndWriteFd(
|
||||
TIMER_END;
|
||||
OSTRACE(("WRITE %-3d %5d %7lld %llu\n", fd, rc, iOff, TIMER_ELAPSED));
|
||||
|
||||
if( rc<0 && piErrno ) *piErrno = errno;
|
||||
if( rc<0 ) *piErrno = errno;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -3398,10 +3391,15 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
|
||||
#endif
|
||||
|
||||
/* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
|
||||
** no-op
|
||||
** no-op. But go ahead and call fstat() to validate the file
|
||||
** descriptor as we need a method to provoke a failure during
|
||||
** coverate testing.
|
||||
*/
|
||||
#ifdef SQLITE_NO_SYNC
|
||||
rc = SQLITE_OK;
|
||||
{
|
||||
struct stat buf;
|
||||
rc = osFstat(fd, &buf);
|
||||
}
|
||||
#elif HAVE_FULLFSYNC
|
||||
if( fullSync ){
|
||||
rc = osFcntl(fd, F_FULLFSYNC, 0);
|
||||
@@ -3467,13 +3465,16 @@ static int openDirectory(const char *zFilename, int *pFd){
|
||||
char zDirname[MAX_PATHNAME+1];
|
||||
|
||||
sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename);
|
||||
for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--);
|
||||
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--);
|
||||
if( ii>0 ){
|
||||
zDirname[ii] = '\0';
|
||||
fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0);
|
||||
if( fd>=0 ){
|
||||
OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname));
|
||||
}
|
||||
}else{
|
||||
if( zDirname[0]!='/' ) zDirname[0] = '.';
|
||||
zDirname[1] = 0;
|
||||
}
|
||||
fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0);
|
||||
if( fd>=0 ){
|
||||
OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname));
|
||||
}
|
||||
*pFd = fd;
|
||||
if( fd>=0 ) return SQLITE_OK;
|
||||
@@ -3666,18 +3667,14 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
|
||||
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;
|
||||
iWrite = (buf.st_size/nBlk)*nBlk + nBlk - 1;
|
||||
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 ){
|
||||
for(/*no-op*/; iWrite<nSize+nBlk-1; iWrite+=nBlk ){
|
||||
if( iWrite>=nSize ) iWrite = nSize - 1;
|
||||
nWrite = seekAndWrite(pFile, iWrite, "", 1);
|
||||
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
|
||||
}
|
||||
if( nWrite==0 || (nSize%nBlk) ){
|
||||
nWrite = seekAndWrite(pFile, nSize-1, "", 1);
|
||||
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -3725,10 +3722,6 @@ static int unixGetTempname(int nBuf, char *zBuf);
|
||||
static int unixFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
switch( op ){
|
||||
case SQLITE_FCNTL_WAL_BLOCK: {
|
||||
/* pFile->ctrlFlags |= UNIXFILE_BLOCK; // Deferred feature */
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_LOCKSTATE: {
|
||||
*(int*)pArg = pFile->eFileLock;
|
||||
return SQLITE_OK;
|
||||
@@ -4055,10 +4048,9 @@ static int unixShmSystemLock(
|
||||
assert( n==1 || lockType!=F_RDLCK );
|
||||
|
||||
/* Locks are within range */
|
||||
assert( n>=1 && n<SQLITE_SHM_NLOCK );
|
||||
assert( n>=1 && n<=SQLITE_SHM_NLOCK );
|
||||
|
||||
if( pShmNode->h>=0 ){
|
||||
int lkType;
|
||||
/* Initialize the locking parameters */
|
||||
memset(&f, 0, sizeof(f));
|
||||
f.l_type = lockType;
|
||||
@@ -4066,10 +4058,8 @@ static int unixShmSystemLock(
|
||||
f.l_start = ofst;
|
||||
f.l_len = n;
|
||||
|
||||
lkType = (pFile->ctrlFlags & UNIXFILE_BLOCK)!=0 ? F_SETLKW : F_SETLK;
|
||||
rc = osFcntl(pShmNode->h, lkType, &f);
|
||||
rc = osFcntl(pShmNode->h, F_SETLK, &f);
|
||||
rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY;
|
||||
pFile->ctrlFlags &= ~UNIXFILE_BLOCK;
|
||||
}
|
||||
|
||||
/* Update the global lock state and do debug tracing */
|
||||
@@ -4136,7 +4126,7 @@ static int unixShmRegionPerMap(void){
|
||||
static void unixShmPurge(unixFile *pFd){
|
||||
unixShmNode *p = pFd->pInode->pShmNode;
|
||||
assert( unixMutexHeld() );
|
||||
if( p && p->nRef==0 ){
|
||||
if( p && ALWAYS(p->nRef==0) ){
|
||||
int nShmPerMap = unixShmRegionPerMap();
|
||||
int i;
|
||||
assert( p->pInode==pFd->pInode );
|
||||
@@ -4223,7 +4213,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
|
||||
** a new *-shm file is created, an attempt will be made to create it
|
||||
** with the same permissions.
|
||||
*/
|
||||
if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){
|
||||
if( osFstat(pDbFd->h, &sStat) ){
|
||||
rc = SQLITE_IOERR_FSTAT;
|
||||
goto shm_open_err;
|
||||
}
|
||||
@@ -4410,7 +4400,8 @@ static int unixShmMap(
|
||||
/* Write to the last byte of each newly allocated or extended page */
|
||||
assert( (nByte % pgsz)==0 );
|
||||
for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
|
||||
if( seekAndWriteFd(pShmNode->h, iPg*pgsz + pgsz-1, "", 1, 0)!=1 ){
|
||||
int x = 0;
|
||||
if( seekAndWriteFd(pShmNode->h, iPg*pgsz + pgsz-1, "", 1, &x)!=1 ){
|
||||
const char *zFile = pShmNode->zFilename;
|
||||
rc = unixLogError(SQLITE_IOERR_SHMSIZE, "write", zFile);
|
||||
goto shmpage_out;
|
||||
@@ -4778,17 +4769,14 @@ static void unixRemapfile(
|
||||
** recreated as a result of outstanding references) or an SQLite error
|
||||
** code otherwise.
|
||||
*/
|
||||
static int unixMapfile(unixFile *pFd, i64 nByte){
|
||||
i64 nMap = nByte;
|
||||
int rc;
|
||||
|
||||
static int unixMapfile(unixFile *pFd, i64 nMap){
|
||||
assert( nMap>=0 || pFd->nFetchOut==0 );
|
||||
assert( nMap>0 || (pFd->mmapSize==0 && pFd->pMapRegion==0) );
|
||||
if( pFd->nFetchOut>0 ) return SQLITE_OK;
|
||||
|
||||
if( nMap<0 ){
|
||||
struct stat statbuf; /* Low-level file information */
|
||||
rc = osFstat(pFd->h, &statbuf);
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( osFstat(pFd->h, &statbuf) ){
|
||||
return SQLITE_IOERR_FSTAT;
|
||||
}
|
||||
nMap = statbuf.st_size;
|
||||
@@ -4797,12 +4785,9 @@ static int unixMapfile(unixFile *pFd, i64 nByte){
|
||||
nMap = pFd->mmapSizeMax;
|
||||
}
|
||||
|
||||
assert( nMap>0 || (pFd->mmapSize==0 && pFd->pMapRegion==0) );
|
||||
if( nMap!=pFd->mmapSize ){
|
||||
if( nMap>0 ){
|
||||
unixRemapfile(pFd, nMap);
|
||||
}else{
|
||||
unixUnmapfile(pFd);
|
||||
}
|
||||
unixRemapfile(pFd, nMap);
|
||||
}
|
||||
|
||||
return SQLITE_OK;
|
||||
@@ -5539,16 +5524,19 @@ static int findCreateFileMode(
|
||||
** used by the test_multiplex.c module.
|
||||
*/
|
||||
nDb = sqlite3Strlen30(zPath) - 1;
|
||||
#ifdef SQLITE_ENABLE_8_3_NAMES
|
||||
while( nDb>0 && sqlite3Isalnum(zPath[nDb]) ) nDb--;
|
||||
if( nDb==0 || zPath[nDb]!='-' ) return SQLITE_OK;
|
||||
#else
|
||||
while( zPath[nDb]!='-' ){
|
||||
#ifndef SQLITE_ENABLE_8_3_NAMES
|
||||
/* In the normal case (8+3 filenames disabled) the journal filename
|
||||
** is guaranteed to contain a '-' character. */
|
||||
assert( nDb>0 );
|
||||
assert( zPath[nDb]!='\n' );
|
||||
assert( sqlite3Isalnum(zPath[nDb]) );
|
||||
#else
|
||||
/* If 8+3 names are possible, then the journal file might not contain
|
||||
** a '-' character. So check for that case and return early. */
|
||||
if( nDb==0 || zPath[nDb]=='.' ) return SQLITE_OK;
|
||||
#endif
|
||||
nDb--;
|
||||
}
|
||||
#endif
|
||||
memcpy(zDb, zPath, nDb);
|
||||
zDb[nDb] = '\0';
|
||||
|
||||
|
||||
+13
-4
@@ -766,8 +766,9 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
|
||||
setStrAccumError(p, STRACCUM_TOOBIG);
|
||||
return N;
|
||||
}else{
|
||||
char *zOld = (p->zText==p->zBase ? 0 : p->zText);
|
||||
char *zOld = p->bMalloced ? p->zText : 0;
|
||||
i64 szNew = p->nChar;
|
||||
assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
|
||||
szNew += N + 1;
|
||||
if( szNew+p->nChar<=p->mxAlloc ){
|
||||
/* Force exponential buffer size growth as long as it does not overflow,
|
||||
@@ -788,9 +789,10 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
|
||||
}
|
||||
if( zNew ){
|
||||
assert( p->zText!=0 || p->nChar==0 );
|
||||
if( zOld==0 && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
|
||||
if( !p->bMalloced && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
|
||||
p->zText = zNew;
|
||||
p->nAlloc = sqlite3DbMallocSize(p->db, zNew);
|
||||
p->bMalloced = 1;
|
||||
}else{
|
||||
sqlite3StrAccumReset(p);
|
||||
setStrAccumError(p, STRACCUM_NOMEM);
|
||||
@@ -808,6 +810,7 @@ void sqlite3AppendChar(StrAccum *p, int N, char c){
|
||||
if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){
|
||||
return;
|
||||
}
|
||||
assert( (p->zText==p->zBase)==(p->bMalloced==0) );
|
||||
while( (N--)>0 ) p->zText[p->nChar++] = c;
|
||||
}
|
||||
|
||||
@@ -825,6 +828,7 @@ static void SQLITE_NOINLINE enlargeAndAppend(StrAccum *p, const char *z, int N){
|
||||
memcpy(&p->zText[p->nChar], z, N);
|
||||
p->nChar += N;
|
||||
}
|
||||
assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -860,11 +864,13 @@ void sqlite3StrAccumAppendAll(StrAccum *p, const char *z){
|
||||
*/
|
||||
char *sqlite3StrAccumFinish(StrAccum *p){
|
||||
if( p->zText ){
|
||||
assert( (p->zText==p->zBase)==(p->bMalloced==0) );
|
||||
p->zText[p->nChar] = 0;
|
||||
if( p->mxAlloc>0 && p->zText==p->zBase ){
|
||||
if( p->mxAlloc>0 && p->bMalloced==0 ){
|
||||
p->zText = sqlite3DbMallocRaw(p->db, p->nChar+1 );
|
||||
if( p->zText ){
|
||||
memcpy(p->zText, p->zBase, p->nChar+1);
|
||||
p->bMalloced = 1;
|
||||
}else{
|
||||
setStrAccumError(p, STRACCUM_NOMEM);
|
||||
}
|
||||
@@ -877,8 +883,10 @@ char *sqlite3StrAccumFinish(StrAccum *p){
|
||||
** Reset an StrAccum string. Reclaim all malloced memory.
|
||||
*/
|
||||
void sqlite3StrAccumReset(StrAccum *p){
|
||||
if( p->zText!=p->zBase ){
|
||||
assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
|
||||
if( p->bMalloced ){
|
||||
sqlite3DbFree(p->db, p->zText);
|
||||
p->bMalloced = 0;
|
||||
}
|
||||
p->zText = 0;
|
||||
}
|
||||
@@ -904,6 +912,7 @@ void sqlite3StrAccumInit(StrAccum *p, sqlite3 *db, char *zBase, int n, int mx){
|
||||
p->nAlloc = n;
|
||||
p->mxAlloc = mx;
|
||||
p->accError = 0;
|
||||
p->bMalloced = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-2
@@ -328,7 +328,6 @@ static int lookupName(
|
||||
}
|
||||
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){
|
||||
/* IMP: R-51414-32910 */
|
||||
/* IMP: R-44911-55124 */
|
||||
iCol = -1;
|
||||
}
|
||||
if( iCol<pTab->nCol ){
|
||||
@@ -363,7 +362,7 @@ static int lookupName(
|
||||
&& VisibleRowid(pMatch->pTab)
|
||||
){
|
||||
cnt = 1;
|
||||
pExpr->iColumn = -1; /* IMP: R-44911-55124 */
|
||||
pExpr->iColumn = -1;
|
||||
pExpr->affinity = SQLITE_AFF_INTEGER;
|
||||
}
|
||||
|
||||
|
||||
+9
-6
@@ -1340,7 +1340,8 @@ static const char *columnTypeImpl(
|
||||
char const *zOrigCol = 0;
|
||||
#endif
|
||||
|
||||
if( NEVER(pExpr==0) || pNC->pSrcList==0 ) return 0;
|
||||
assert( pExpr!=0 );
|
||||
assert( pNC->pSrcList!=0 );
|
||||
switch( pExpr->op ){
|
||||
case TK_AGG_COLUMN:
|
||||
case TK_COLUMN: {
|
||||
@@ -1528,7 +1529,9 @@ static void generateColumnNames(
|
||||
}
|
||||
#endif
|
||||
|
||||
if( pParse->colNamesSet || NEVER(v==0) || db->mallocFailed ) return;
|
||||
if( pParse->colNamesSet || db->mallocFailed ) return;
|
||||
assert( v!=0 );
|
||||
assert( pTabList!=0 );
|
||||
pParse->colNamesSet = 1;
|
||||
fullNames = (db->flags & SQLITE_FullColNames)!=0;
|
||||
shortNames = (db->flags & SQLITE_ShortColNames)!=0;
|
||||
@@ -1540,7 +1543,7 @@ static void generateColumnNames(
|
||||
if( pEList->a[i].zName ){
|
||||
char *zName = pEList->a[i].zName;
|
||||
sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT);
|
||||
}else if( (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) && pTabList ){
|
||||
}else if( p->op==TK_COLUMN || p->op==TK_AGG_COLUMN ){
|
||||
Table *pTab;
|
||||
char *zCol;
|
||||
int iCol = p->iColumn;
|
||||
@@ -2369,7 +2372,7 @@ static int multiSelect(
|
||||
if( dest.eDest==SRT_Output ){
|
||||
Select *pFirst = p;
|
||||
while( pFirst->pPrior ) pFirst = pFirst->pPrior;
|
||||
generateColumnNames(pParse, 0, pFirst->pEList);
|
||||
generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList);
|
||||
}
|
||||
iBreak = sqlite3VdbeMakeLabel(v);
|
||||
iCont = sqlite3VdbeMakeLabel(v);
|
||||
@@ -2444,7 +2447,7 @@ static int multiSelect(
|
||||
if( dest.eDest==SRT_Output ){
|
||||
Select *pFirst = p;
|
||||
while( pFirst->pPrior ) pFirst = pFirst->pPrior;
|
||||
generateColumnNames(pParse, 0, pFirst->pEList);
|
||||
generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList);
|
||||
}
|
||||
iBreak = sqlite3VdbeMakeLabel(v);
|
||||
iCont = sqlite3VdbeMakeLabel(v);
|
||||
@@ -3059,7 +3062,7 @@ static int multiSelectOrderBy(
|
||||
if( pDest->eDest==SRT_Output ){
|
||||
Select *pFirst = pPrior;
|
||||
while( pFirst->pPrior ) pFirst = pFirst->pPrior;
|
||||
generateColumnNames(pParse, 0, pFirst->pEList);
|
||||
generateColumnNames(pParse, pFirst->pSrc, pFirst->pEList);
|
||||
}
|
||||
|
||||
/* Reassembly the compound query so that it will be freed correctly
|
||||
|
||||
+14
@@ -525,6 +525,7 @@ struct ShellState {
|
||||
int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
|
||||
int statsOn; /* True to display memory stats before each finalize */
|
||||
int scanstatsOn; /* True to display scan stats before each finalize */
|
||||
int countChanges; /* True to display change counts */
|
||||
int backslashOn; /* Resolve C-style \x escapes in SQL input text */
|
||||
int outCount; /* Revert to stdout when reaching zero */
|
||||
int cnt; /* Number of records displayed so far */
|
||||
@@ -1785,6 +1786,7 @@ static char zHelp[] =
|
||||
".backup ?DB? FILE Backup DB (default \"main\") to FILE\n"
|
||||
".bail on|off Stop after hitting an error. Default OFF\n"
|
||||
".binary on|off Turn binary output on or off. Default OFF\n"
|
||||
".changes on|off Show number of rows changed by SQL\n"
|
||||
".clone NEWDB Clone data into NEWDB from the existing database\n"
|
||||
".databases List names and files of attached databases\n"
|
||||
".dbinfo ?DB? Show status information about the database\n"
|
||||
@@ -2757,6 +2759,15 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
test_breakpoint();
|
||||
}else
|
||||
|
||||
if( c=='c' && n>=3 && strncmp(azArg[0], "changes", n)==0 ){
|
||||
if( nArg==2 ){
|
||||
p->countChanges = booleanValue(azArg[1]);
|
||||
}else{
|
||||
fprintf(stderr, "Usage: .changes on|off\n");
|
||||
rc = 1;
|
||||
}
|
||||
}else
|
||||
|
||||
if( c=='c' && strncmp(azArg[0], "clone", n)==0 ){
|
||||
if( nArg==2 ){
|
||||
tryToClone(p, azArg[1]);
|
||||
@@ -4286,6 +4297,9 @@ static int process_input(ShellState *p, FILE *in){
|
||||
fprintf(stderr, "%s %s\n", zPrefix, sqlite3_errmsg(p->db));
|
||||
}
|
||||
errCnt++;
|
||||
}else if( p->countChanges ){
|
||||
fprintf(p->out, "changes: %3d total_changes: %d\n",
|
||||
sqlite3_changes(p->db), sqlite3_total_changes(p->db));
|
||||
}
|
||||
nSql = 0;
|
||||
if( p->outCount ){
|
||||
|
||||
+1
-1
@@ -887,7 +887,7 @@ struct sqlite3_io_methods {
|
||||
** [VFSes] currently in use. ^(The argument X in
|
||||
** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
|
||||
** of type "[sqlite3_vfs] **". This opcodes will set *X
|
||||
** to a pointer to the top-level VFS.^)
|
||||
** to a pointer to the top-level VFS.)^
|
||||
** ^When there are multiple VFS shims in the stack, this opcode finds the
|
||||
** upper-most shim only.
|
||||
**
|
||||
|
||||
@@ -276,7 +276,9 @@ struct sqlite3_api_routines {
|
||||
unsigned int (*value_subtype)(sqlite3_value*);
|
||||
void (*result_subtype)(sqlite3_context*,unsigned int);
|
||||
/* Version 3.10.0 and later */
|
||||
int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int);
|
||||
int (*strlike)(const char*,const char*,unsigned int);
|
||||
int (*db_cacheflush)(sqlite3*);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -517,7 +519,9 @@ struct sqlite3_api_routines {
|
||||
#define sqlite3_value_subtype sqlite3_api->value_subtype
|
||||
#define sqlite3_result_subtype sqlite3_api->result_subtype
|
||||
/* Version 3.10.0 and later */
|
||||
#define sqlite3_status64 sqlite3_api->status64
|
||||
#define sqlite3_strlike sqlite3_api->strlike
|
||||
#define sqlite3_db_cacheflush sqlite3_api->db_cacheflush
|
||||
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
||||
|
||||
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
|
||||
@@ -173,6 +173,21 @@
|
||||
# define SQLITE_PTR_TO_INT(X) ((int)(X))
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to
|
||||
** something between S (inclusive) and E (exclusive).
|
||||
**
|
||||
** In other words, S is a buffer and E is a pointer to the first byte after
|
||||
** the end of buffer S. This macro returns true if P points to something
|
||||
** contained within the buffer S.
|
||||
*/
|
||||
#if defined(HAVE_STDINT_H)
|
||||
# define SQLITE_WITHIN(P,S,E) \
|
||||
((uintptr_t)(P)>=(uintptr_h)(S) && (uintptr_t)(P)<(uintptr_t)(E))
|
||||
#else
|
||||
# define SQLITE_WITHIN(P,S,E) ((P)>=(S) && (P)<(E))
|
||||
#endif
|
||||
|
||||
/*
|
||||
** A macro to hint to the compiler that a function should not be
|
||||
** inlined.
|
||||
@@ -2952,6 +2967,7 @@ struct StrAccum {
|
||||
int nAlloc; /* Amount of space allocated in zText */
|
||||
int mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
|
||||
u8 accError; /* STRACCUM_NOMEM or STRACCUM_TOOBIG */
|
||||
u8 bMalloced; /* zText points to allocated space */
|
||||
};
|
||||
#define STRACCUM_NOMEM 1
|
||||
#define STRACCUM_TOOBIG 2
|
||||
|
||||
+2
-2
@@ -5906,13 +5906,13 @@ static int test_sqlite3_log(
|
||||
Tcl_DecrRefCount(logcallback.pObj);
|
||||
logcallback.pObj = 0;
|
||||
logcallback.pInterp = 0;
|
||||
sqlite3_config(SQLITE_CONFIG_LOG, 0, 0);
|
||||
sqlite3_config(SQLITE_CONFIG_LOG, (void*)0, (void*)0);
|
||||
}
|
||||
if( objc>1 ){
|
||||
logcallback.pObj = objv[1];
|
||||
Tcl_IncrRefCount(logcallback.pObj);
|
||||
logcallback.pInterp = interp;
|
||||
sqlite3_config(SQLITE_CONFIG_LOG, xLogcallback, 0);
|
||||
sqlite3_config(SQLITE_CONFIG_LOG, xLogcallback, (void*)0);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -185,6 +185,12 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options", "json1", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
Tcl_SetVar2(interp, "sqlite_options", "like_match_blobs", "0", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "like_match_blobs", "1", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_OMIT_ATTACH
|
||||
Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
|
||||
+4
-1
@@ -202,7 +202,10 @@ static int fsdirBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
|
||||
*/
|
||||
static int fsdirOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
|
||||
FsdirCsr *pCur;
|
||||
pCur = (FsdirCsr*)sqlite3_malloc(sizeof(FsdirCsr));
|
||||
/* Allocate an extra 256 bytes because it is undefined how big dirent.d_name
|
||||
** is and we need enough space. Linux provides plenty already, but
|
||||
** Solaris only provides one byte. */
|
||||
pCur = (FsdirCsr*)sqlite3_malloc(sizeof(FsdirCsr)+256);
|
||||
if( pCur==0 ) return SQLITE_NOMEM;
|
||||
memset(pCur, 0, sizeof(FsdirCsr));
|
||||
*ppCursor = &pCur->base;
|
||||
|
||||
+2
-1
@@ -222,7 +222,8 @@ static int faultsimInstall(int install){
|
||||
assert( memcmp(&m2, &memfault.m, sizeof(m2))==0 );
|
||||
|
||||
rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &memfault.m);
|
||||
sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, 0, 0);
|
||||
sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS,
|
||||
(void*)0, (void*)0);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
|
||||
+6
-11
@@ -189,8 +189,11 @@ static struct {
|
||||
int isInitialized;
|
||||
|
||||
/* For run-time access any of the other global data structures in this
|
||||
** shim, the following mutex must be held.
|
||||
*/
|
||||
** shim, the following mutex must be held. In practice, all this mutex
|
||||
** protects is add/remove operations to/from the linked list of group objects
|
||||
** starting at pGroups below. More specifically, it protects the value of
|
||||
** pGroups itself, and the pNext/pPrev fields of each multiplexGroup
|
||||
** structure. */
|
||||
sqlite3_mutex *pMutex;
|
||||
|
||||
/* List of multiplexGroup objects.
|
||||
@@ -758,11 +761,8 @@ static int multiplexRead(
|
||||
multiplexConn *p = (multiplexConn*)pConn;
|
||||
multiplexGroup *pGroup = p->pGroup;
|
||||
int rc = SQLITE_OK;
|
||||
int nMutex = 0;
|
||||
multiplexEnter(); nMutex++;
|
||||
if( !pGroup->bEnabled ){
|
||||
sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL, 0);
|
||||
multiplexLeave(); nMutex--;
|
||||
if( pSubOpen==0 ){
|
||||
rc = SQLITE_IOERR_READ;
|
||||
}else{
|
||||
@@ -772,9 +772,7 @@ static int multiplexRead(
|
||||
while( iAmt > 0 ){
|
||||
int i = (int)(iOfst / pGroup->szChunk);
|
||||
sqlite3_file *pSubOpen;
|
||||
if( nMutex==0 ){ multiplexEnter(); nMutex++; }
|
||||
pSubOpen = multiplexSubOpen(pGroup, i, &rc, NULL, 1);
|
||||
multiplexLeave(); nMutex--;
|
||||
if( pSubOpen ){
|
||||
int extra = ((int)(iOfst % pGroup->szChunk) + iAmt) - pGroup->szChunk;
|
||||
if( extra<0 ) extra = 0;
|
||||
@@ -791,8 +789,7 @@ static int multiplexRead(
|
||||
}
|
||||
}
|
||||
}
|
||||
assert( nMutex==0 || nMutex==1 );
|
||||
if( nMutex ) multiplexLeave();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -809,7 +806,6 @@ static int multiplexWrite(
|
||||
multiplexConn *p = (multiplexConn*)pConn;
|
||||
multiplexGroup *pGroup = p->pGroup;
|
||||
int rc = SQLITE_OK;
|
||||
multiplexEnter();
|
||||
if( !pGroup->bEnabled ){
|
||||
sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL, 0);
|
||||
if( pSubOpen==0 ){
|
||||
@@ -834,7 +830,6 @@ static int multiplexWrite(
|
||||
}
|
||||
}
|
||||
}
|
||||
multiplexLeave();
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
+4
-23
@@ -559,31 +559,12 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
|
||||
*/
|
||||
assert( pTable!=0 );
|
||||
if( (v = sqlite3GetVdbe(pParse))!=0 ){
|
||||
int base;
|
||||
static const int iLn = VDBE_OFFSET_LINENO(2);
|
||||
static const VdbeOpList dropTrigger[] = {
|
||||
{ OP_Rewind, 0, ADDR(9), 0},
|
||||
{ OP_String8, 0, 1, 0}, /* 1 */
|
||||
{ OP_Column, 0, 1, 2},
|
||||
{ OP_Ne, 2, ADDR(8), 1},
|
||||
{ OP_String8, 0, 1, 0}, /* 4: "trigger" */
|
||||
{ OP_Column, 0, 0, 2},
|
||||
{ OP_Ne, 2, ADDR(8), 1},
|
||||
{ OP_Delete, 0, 0, 0},
|
||||
{ OP_Next, 0, ADDR(1), 0}, /* 8 */
|
||||
};
|
||||
|
||||
sqlite3BeginWriteOperation(pParse, 0, iDb);
|
||||
sqlite3OpenMasterTable(pParse, iDb);
|
||||
base = sqlite3VdbeAddOpList(v, ArraySize(dropTrigger), dropTrigger, iLn);
|
||||
sqlite3VdbeChangeP4(v, base+1, pTrigger->zName, P4_TRANSIENT);
|
||||
sqlite3VdbeChangeP4(v, base+4, "trigger", P4_STATIC);
|
||||
sqlite3NestedParse(pParse,
|
||||
"DELETE FROM %Q.%s WHERE name=%Q AND type='trigger'",
|
||||
db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pTrigger->zName
|
||||
);
|
||||
sqlite3ChangeCookie(pParse, iDb);
|
||||
sqlite3VdbeAddOp2(v, OP_Close, 0, 0);
|
||||
sqlite3VdbeAddOp4(v, OP_DropTrigger, iDb, 0, 0, pTrigger->zName, 0);
|
||||
if( pParse->nMem<3 ){
|
||||
pParse->nMem = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1088,6 +1088,7 @@ case OP_String: { /* out2 */
|
||||
pOut->n = pOp->p1;
|
||||
pOut->enc = encoding;
|
||||
UPDATE_MAX_BLOBSIZE(pOut);
|
||||
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
if( pOp->p5 ){
|
||||
assert( pOp->p3>0 );
|
||||
assert( pOp->p3<=(p->nMem-p->nCursor) );
|
||||
@@ -1095,6 +1096,7 @@ case OP_String: { /* out2 */
|
||||
assert( pIn3->flags & MEM_Int );
|
||||
if( pIn3->u.i ) pOut->flags = MEM_Blob|MEM_Static|MEM_Term;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+37
-40
@@ -349,7 +349,7 @@ int sqlite3VdbeMakeLabel(Vdbe *v){
|
||||
if( p->aLabel ){
|
||||
p->aLabel[i] = -1;
|
||||
}
|
||||
return -1-i;
|
||||
return ADDR(i);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -359,7 +359,7 @@ int sqlite3VdbeMakeLabel(Vdbe *v){
|
||||
*/
|
||||
void sqlite3VdbeResolveLabel(Vdbe *v, int x){
|
||||
Parse *p = v->pParse;
|
||||
int j = -1-x;
|
||||
int j = ADDR(x);
|
||||
assert( v->magic==VDBE_MAGIC_INIT );
|
||||
assert( j<p->nLabel );
|
||||
assert( j>=0 );
|
||||
@@ -586,8 +586,8 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
|
||||
|
||||
pOp->opflags = sqlite3OpcodeProperty[opcode];
|
||||
if( (pOp->opflags & OPFLG_JUMP)!=0 && pOp->p2<0 ){
|
||||
assert( -1-pOp->p2<pParse->nLabel );
|
||||
pOp->p2 = aLabel[-1-pOp->p2];
|
||||
assert( ADDR(pOp->p2)<pParse->nLabel );
|
||||
pOp->p2 = aLabel[ADDR(pOp->p2)];
|
||||
}
|
||||
}
|
||||
sqlite3DbFree(p->db, pParse->aLabel);
|
||||
@@ -644,15 +644,10 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp, int iLineno){
|
||||
addr = p->nOp;
|
||||
pOut = &p->aOp[addr];
|
||||
for(i=0; i<nOp; i++, aOp++, pOut++){
|
||||
int p2 = aOp->p2;
|
||||
pOut->opcode = aOp->opcode;
|
||||
pOut->p1 = aOp->p1;
|
||||
if( p2<0 ){
|
||||
assert( sqlite3OpcodeProperty[pOut->opcode] & OPFLG_JUMP );
|
||||
pOut->p2 = addr + ADDR(p2);
|
||||
}else{
|
||||
pOut->p2 = p2;
|
||||
}
|
||||
pOut->p2 = aOp->p2;
|
||||
assert( aOp->p2>=0 );
|
||||
pOut->p3 = aOp->p3;
|
||||
pOut->p4type = P4_NOTUSED;
|
||||
pOut->p4.p = 0;
|
||||
@@ -1725,30 +1720,31 @@ void sqlite3VdbeIOTraceSql(Vdbe *p){
|
||||
**
|
||||
** nByte is the number of bytes of space needed.
|
||||
**
|
||||
** *ppFrom points to available space and pEnd points to the end of the
|
||||
** available space. When space is allocated, *ppFrom is advanced past
|
||||
** the end of the allocated space.
|
||||
** pFrom points to *pnFrom bytes of available space. New space is allocated
|
||||
** from the end of the pFrom buffer and *pnFrom is decremented.
|
||||
**
|
||||
** *pnByte is a counter of the number of bytes of space that have failed
|
||||
** to allocate. If there is insufficient space in *ppFrom to satisfy the
|
||||
** request, then increment *pnByte by the amount of the request.
|
||||
** *pnNeeded is a counter of the number of bytes of space that have failed
|
||||
** to allocate. If there is insufficient space in pFrom to satisfy the
|
||||
** request, then increment *pnNeeded by the amount of the request.
|
||||
*/
|
||||
static void *allocSpace(
|
||||
void *pBuf, /* Where return pointer will be stored */
|
||||
int nByte, /* Number of bytes to allocate */
|
||||
u8 **ppFrom, /* IN/OUT: Allocate from *ppFrom */
|
||||
u8 *pEnd, /* Pointer to 1 byte past the end of *ppFrom buffer */
|
||||
int *pnByte /* If allocation cannot be made, increment *pnByte */
|
||||
u8 *pFrom, /* Memory available for allocation */
|
||||
int *pnFrom, /* IN/OUT: Space available at pFrom */
|
||||
int *pnNeeded /* If allocation cannot be made, increment *pnByte */
|
||||
){
|
||||
assert( EIGHT_BYTE_ALIGNMENT(*ppFrom) );
|
||||
if( pBuf ) return pBuf;
|
||||
nByte = ROUND8(nByte);
|
||||
if( &(*ppFrom)[nByte] <= pEnd ){
|
||||
pBuf = (void*)*ppFrom;
|
||||
*ppFrom += nByte;
|
||||
}else{
|
||||
*pnByte += nByte;
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pFrom) );
|
||||
if( pBuf==0 ){
|
||||
nByte = ROUND8(nByte);
|
||||
if( nByte <= *pnFrom ){
|
||||
*pnFrom -= nByte;
|
||||
pBuf = &pFrom[*pnFrom];
|
||||
}else{
|
||||
*pnNeeded += nByte;
|
||||
}
|
||||
}
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pBuf) );
|
||||
return pBuf;
|
||||
}
|
||||
|
||||
@@ -1821,8 +1817,8 @@ void sqlite3VdbeMakeReady(
|
||||
int nArg; /* Number of arguments in subprograms */
|
||||
int nOnce; /* Number of OP_Once instructions */
|
||||
int n; /* Loop counter */
|
||||
int nFree; /* Available free space */
|
||||
u8 *zCsr; /* Memory available for allocation */
|
||||
u8 *zEnd; /* First byte past allocated memory */
|
||||
int nByte; /* How much extra memory is needed */
|
||||
|
||||
assert( p!=0 );
|
||||
@@ -1854,14 +1850,15 @@ void sqlite3VdbeMakeReady(
|
||||
** an array to marshal SQL function arguments in.
|
||||
*/
|
||||
zCsr = (u8*)&p->aOp[p->nOp]; /* Memory avaliable for allocation */
|
||||
zEnd = (u8*)&p->aOp[pParse->nOpAlloc]; /* First byte past end of zCsr[] */
|
||||
assert( pParse->nOpAlloc*sizeof(Op) <= 0x7fffff00 );
|
||||
nFree = (pParse->nOpAlloc - p->nOp)*sizeof(p->aOp[0]); /* Available space */
|
||||
|
||||
resolveP2Values(p, &nArg);
|
||||
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
|
||||
if( pParse->explain && nMem<10 ){
|
||||
nMem = 10;
|
||||
}
|
||||
memset(zCsr, 0, zEnd-zCsr);
|
||||
memset(zCsr, 0, nFree);
|
||||
zCsr += (zCsr - (u8*)0)&7;
|
||||
assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
|
||||
p->expired = 0;
|
||||
@@ -1878,21 +1875,21 @@ void sqlite3VdbeMakeReady(
|
||||
*/
|
||||
do {
|
||||
nByte = 0;
|
||||
p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
|
||||
p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
|
||||
p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte);
|
||||
p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte);
|
||||
p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), zCsr, &nFree, &nByte);
|
||||
p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), zCsr, &nFree, &nByte);
|
||||
p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), zCsr, &nFree, &nByte);
|
||||
p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), zCsr, &nFree, &nByte);
|
||||
p->apCsr = allocSpace(p->apCsr, nCursor*sizeof(VdbeCursor*),
|
||||
&zCsr, zEnd, &nByte);
|
||||
p->aOnceFlag = allocSpace(p->aOnceFlag, nOnce, &zCsr, zEnd, &nByte);
|
||||
zCsr, &nFree, &nByte);
|
||||
p->aOnceFlag = allocSpace(p->aOnceFlag, nOnce, zCsr, &nFree, &nByte);
|
||||
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
|
||||
p->anExec = allocSpace(p->anExec, p->nOp*sizeof(i64), &zCsr, zEnd, &nByte);
|
||||
p->anExec = allocSpace(p->anExec, p->nOp*sizeof(i64), zCsr, &nFree, &nByte);
|
||||
#endif
|
||||
if( nByte ){
|
||||
p->pFree = sqlite3DbMallocZero(db, nByte);
|
||||
}
|
||||
zCsr = p->pFree;
|
||||
zEnd = &zCsr[nByte];
|
||||
nFree = nByte;
|
||||
}while( nByte && !db->mallocFailed );
|
||||
|
||||
p->nCursor = nCursor;
|
||||
@@ -3235,7 +3232,7 @@ u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){
|
||||
assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0)
|
||||
== (int)sqlite3VdbeSerialTypeLen(serial_type) );
|
||||
len = pMem->n;
|
||||
memcpy(buf, pMem->z, len);
|
||||
if( len>0 ) memcpy(buf, pMem->z, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
@@ -789,10 +789,9 @@ static void walUnlockShared(Wal *pWal, int lockIdx){
|
||||
SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED);
|
||||
WALTRACE(("WAL%p: release SHARED-%s\n", pWal, walLockName(lockIdx)));
|
||||
}
|
||||
static int walLockExclusive(Wal *pWal, int lockIdx, int n, int fBlock){
|
||||
static int walLockExclusive(Wal *pWal, int lockIdx, int n){
|
||||
int rc;
|
||||
if( pWal->exclusiveMode ) return SQLITE_OK;
|
||||
if( fBlock ) sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_WAL_BLOCK, 0);
|
||||
rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, n,
|
||||
SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE);
|
||||
WALTRACE(("WAL%p: acquire EXCLUSIVE-%s cnt=%d %s\n", pWal,
|
||||
@@ -1078,7 +1077,7 @@ static int walIndexRecover(Wal *pWal){
|
||||
assert( pWal->writeLock );
|
||||
iLock = WAL_ALL_BUT_WRITE + pWal->ckptLock;
|
||||
nLock = SQLITE_SHM_NLOCK - iLock;
|
||||
rc = walLockExclusive(pWal, iLock, nLock, 0);
|
||||
rc = walLockExclusive(pWal, iLock, nLock);
|
||||
if( rc ){
|
||||
return rc;
|
||||
}
|
||||
@@ -1616,7 +1615,7 @@ static int walBusyLock(
|
||||
){
|
||||
int rc;
|
||||
do {
|
||||
rc = walLockExclusive(pWal, lockIdx, n, 0);
|
||||
rc = walLockExclusive(pWal, lockIdx, n);
|
||||
}while( xBusy && rc==SQLITE_BUSY && xBusy(pBusyArg) );
|
||||
return rc;
|
||||
}
|
||||
@@ -2057,7 +2056,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){
|
||||
walUnlockShared(pWal, WAL_WRITE_LOCK);
|
||||
rc = SQLITE_READONLY_RECOVERY;
|
||||
}
|
||||
}else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1, 1)) ){
|
||||
}else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){
|
||||
pWal->writeLock = 1;
|
||||
if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){
|
||||
badHdr = walIndexTryHdr(pWal, pChanged);
|
||||
@@ -2263,7 +2262,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){
|
||||
&& (mxReadMark<pWal->hdr.mxFrame || mxI==0)
|
||||
){
|
||||
for(i=1; i<WAL_NREADER; i++){
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(i), 1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(i), 1);
|
||||
if( rc==SQLITE_OK ){
|
||||
mxReadMark = pInfo->aReadMark[i] = pWal->hdr.mxFrame;
|
||||
mxI = i;
|
||||
@@ -2537,7 +2536,7 @@ int sqlite3WalBeginWriteTransaction(Wal *pWal){
|
||||
/* Only one writer allowed at a time. Get the write lock. Return
|
||||
** SQLITE_BUSY if unable.
|
||||
*/
|
||||
rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1);
|
||||
if( rc ){
|
||||
return rc;
|
||||
}
|
||||
@@ -2682,7 +2681,7 @@ static int walRestartLog(Wal *pWal){
|
||||
if( pInfo->nBackfill>0 ){
|
||||
u32 salt1;
|
||||
sqlite3_randomness(4, &salt1);
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
|
||||
if( rc==SQLITE_OK ){
|
||||
/* If all readers are using WAL_READ_LOCK(0) (in other words if no
|
||||
** readers are currently using the WAL), then the transactions
|
||||
@@ -3007,7 +3006,7 @@ int sqlite3WalCheckpoint(
|
||||
|
||||
/* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive
|
||||
** "checkpoint" lock on the database file. */
|
||||
rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1, 0);
|
||||
rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1);
|
||||
if( rc ){
|
||||
/* EVIDENCE-OF: R-10421-19736 If any other process is running a
|
||||
** checkpoint operation at the same time, the lock cannot be obtained and
|
||||
|
||||
@@ -4492,6 +4492,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
sqlite3VdbeJumpHere(v, pLevel->addrSkip);
|
||||
sqlite3VdbeJumpHere(v, pLevel->addrSkip-2);
|
||||
}
|
||||
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
if( pLevel->addrLikeRep ){
|
||||
int op;
|
||||
if( sqlite3VdbeGetOp(v, pLevel->addrLikeRep-1)->p1 ){
|
||||
@@ -4502,6 +4503,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
sqlite3VdbeAddOp2(v, op, pLevel->iLikeRepCntr, pLevel->addrLikeRep);
|
||||
VdbeCoverage(v);
|
||||
}
|
||||
#endif
|
||||
if( pLevel->iLeftJoin ){
|
||||
addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); VdbeCoverage(v);
|
||||
assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0
|
||||
|
||||
@@ -69,8 +69,10 @@ struct WhereLevel {
|
||||
int addrCont; /* Jump here to continue with the next loop cycle */
|
||||
int addrFirst; /* First instruction of interior of the loop */
|
||||
int addrBody; /* Beginning of the body of this loop */
|
||||
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
int iLikeRepCntr; /* LIKE range processing counter register */
|
||||
int addrLikeRep; /* LIKE range processing address */
|
||||
#endif
|
||||
u8 iFrom; /* Which entry in the FROM clause */
|
||||
u8 op, p3, p5; /* Opcode, P3 & P5 of the opcode that ends the loop */
|
||||
int p1, p2; /* Operands of the opcode used to ends the loop */
|
||||
|
||||
@@ -561,6 +561,7 @@ static int codeAllEqualityTerms(
|
||||
return regBase;
|
||||
}
|
||||
|
||||
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
/*
|
||||
** If the most recently coded instruction is a constant range contraint
|
||||
** that originated from the LIKE optimization, then change the P3 to be
|
||||
@@ -572,6 +573,10 @@ static int codeAllEqualityTerms(
|
||||
** The OP_String opcodes on the second pass convert the upper and lower
|
||||
** bound string contants to blobs. This routine makes the necessary changes
|
||||
** to the OP_String opcodes for that to happen.
|
||||
**
|
||||
** Except, of course, if SQLITE_LIKE_DOESNT_MATCH_BLOBS is defined, then
|
||||
** only the one pass through the string space is required, so this routine
|
||||
** becomes a no-op.
|
||||
*/
|
||||
static void whereLikeOptimizationStringFixup(
|
||||
Vdbe *v, /* prepared statement under construction */
|
||||
@@ -589,6 +594,9 @@ static void whereLikeOptimizationStringFixup(
|
||||
pOp->p5 = 1;
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define whereLikeOptimizationStringFixup(A,B,C)
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_ENABLE_CURSOR_HINTS
|
||||
/*
|
||||
@@ -1075,6 +1083,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
if( pLoop->wsFlags & WHERE_TOP_LIMIT ){
|
||||
pRangeEnd = pLoop->aLTerm[j++];
|
||||
nExtraReg = 1;
|
||||
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
if( (pRangeEnd->wtFlags & TERM_LIKEOPT)!=0 ){
|
||||
assert( pRangeStart!=0 ); /* LIKE opt constraints */
|
||||
assert( pRangeStart->wtFlags & TERM_LIKEOPT ); /* occur in pairs */
|
||||
@@ -1087,6 +1096,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
VdbeComment((v, "LIKE loop counter"));
|
||||
pLevel->addrLikeRep = sqlite3VdbeCurrentAddr(v);
|
||||
}
|
||||
#endif
|
||||
if( pRangeStart==0
|
||||
&& (j = pIdx->aiColumn[nEq])>=0
|
||||
&& pIdx->pTable->aCol[j].notNull==0
|
||||
@@ -1590,9 +1600,13 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
continue;
|
||||
}
|
||||
if( pTerm->wtFlags & TERM_LIKECOND ){
|
||||
#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||
continue;
|
||||
#else
|
||||
assert( pLevel->iLikeRepCntr>0 );
|
||||
skipLikeAddr = sqlite3VdbeAddOp1(v, OP_IfNot, pLevel->iLikeRepCntr);
|
||||
VdbeCoverage(v);
|
||||
#endif
|
||||
}
|
||||
sqlite3ExprIfFalse(pParse, pE, addrCont, SQLITE_JUMPIFNULL);
|
||||
if( skipLikeAddr ) sqlite3VdbeJumpHere(v, skipLikeAddr);
|
||||
|
||||
+14
-6
@@ -283,9 +283,17 @@ do_eqp_test analyze3-2.3 {
|
||||
SELECT count(a) FROM t1 WHERE b LIKE '%a'
|
||||
} {0 0 0 {SCAN TABLE t1}}
|
||||
|
||||
# Return the first argument if like_match_blobs is true (the default)
|
||||
# or the second argument if not
|
||||
#
|
||||
proc ilmb {a b} {
|
||||
ifcapable like_match_blobs {return $a}
|
||||
return $b
|
||||
}
|
||||
|
||||
do_test analyze3-2.4 {
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE 'a%' }
|
||||
} {102 0 100}
|
||||
} [list [ilmb 102 101] 0 100]
|
||||
do_test analyze3-2.5 {
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE '%a' }
|
||||
} {999 999 100}
|
||||
@@ -293,7 +301,7 @@ do_test analyze3-2.5 {
|
||||
do_test analyze3-2.6 {
|
||||
set like "a%"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {102 0 100}
|
||||
} [list [ilmb 102 101] 0 100]
|
||||
do_test analyze3-2.7 {
|
||||
set like "%a"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
@@ -301,19 +309,19 @@ do_test analyze3-2.7 {
|
||||
do_test analyze3-2.8 {
|
||||
set like "a"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {102 0 0}
|
||||
} [list [ilmb 102 101] 0 0]
|
||||
do_test analyze3-2.9 {
|
||||
set like "ab"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {12 0 0}
|
||||
} [list [ilmb 12 11] 0 0]
|
||||
do_test analyze3-2.10 {
|
||||
set like "abc"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {3 0 1}
|
||||
} [list [ilmb 3 2] 0 1]
|
||||
do_test analyze3-2.11 {
|
||||
set like "a_c"
|
||||
sf_execsql { SELECT count(*) FROM t1 WHERE b LIKE $like }
|
||||
} {102 0 10}
|
||||
} [list [ilmb 102 101] 0 10]
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix capi3c
|
||||
|
||||
# Do not use a codec for tests in this file, as the database file is
|
||||
# manipulated directly using tcl scripts (using the [hexio_write] command).
|
||||
@@ -1375,4 +1376,26 @@ do_test capi3c-24.3 {
|
||||
decltype {SELECT (SELECT x FROM (SELECT t5.a AS x)) FROM t5}
|
||||
} {INTEGER}
|
||||
|
||||
|
||||
# Further tests of sqlite3_column_decltype():
|
||||
#
|
||||
do_execsql_test 25.0 {
|
||||
CREATE TABLE t11(a VARCHAR(10), b INTEGER);
|
||||
CREATE TABLE t12(a VARCHAR(15), b FLOAT);
|
||||
}
|
||||
|
||||
foreach {tn sql} {
|
||||
1 "SELECT * FROM t11 UNION ALL SELECT * FROM t12"
|
||||
2 "SELECT * FROM t11 UNION SELECT * FROM t12"
|
||||
3 "SELECT * FROM t11 EXCEPT SELECT * FROM t12"
|
||||
4 "SELECT * FROM t11 INTERSECT SELECT * FROM t12"
|
||||
|
||||
5 "SELECT * FROM t11 UNION ALL SELECT * FROM t12 ORDER BY 1"
|
||||
6 "SELECT * FROM t11 UNION SELECT * FROM t12 ORDER BY 1"
|
||||
7 "SELECT * FROM t11 EXCEPT SELECT * FROM t12 ORDER BY 1"
|
||||
8 "SELECT * FROM t11 INTERSECT SELECT * FROM t12 ORDER BY 1"
|
||||
} {
|
||||
do_test 25.$tn { decltype $sql } {VARCHAR(10) INTEGER}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
+3
-2
@@ -62,7 +62,7 @@ ifcapable {bloblit && utf16} {
|
||||
execsql {
|
||||
CREATE TABLE t2(a);
|
||||
INSERT INTO t2 VALUES(x'61006200630064006500');
|
||||
SELECT CAST(a AS text) FROM t2 WHERE a LIKE 'abc%';
|
||||
SELECT CAST(a AS text) FROM t2 WHERE CAST(a AS text) LIKE 'abc%';
|
||||
}
|
||||
} {abcde}
|
||||
do_test enc3-2.3 {
|
||||
@@ -72,7 +72,8 @@ ifcapable {bloblit && utf16} {
|
||||
} {abcde}
|
||||
do_test enc3-2.4 {
|
||||
execsql {
|
||||
SELECT rowid FROM t2 WHERE a LIKE x'610062002500';
|
||||
SELECT rowid FROM t2
|
||||
WHERE CAST(a AS text) LIKE CAST(x'610062002500' AS text);
|
||||
}
|
||||
} {1}
|
||||
}
|
||||
|
||||
+26
-10
@@ -745,11 +745,19 @@ ifcapable like_opt&&!icu {
|
||||
SELECT a FROM t10 WHERE e LIKE '12%' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 5 like 6}
|
||||
do_test like-10.5 {
|
||||
count {
|
||||
SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 4 like 0}
|
||||
ifcapable like_match_blobs {
|
||||
do_test like-10.5a {
|
||||
count {
|
||||
SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 4 like 0}
|
||||
} else {
|
||||
do_test like-10.5b {
|
||||
count {
|
||||
SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 3 like 0}
|
||||
}
|
||||
do_test like-10.6 {
|
||||
count {
|
||||
SELECT a FROM t10 WHERE a LIKE '12%' ORDER BY +a;
|
||||
@@ -786,11 +794,19 @@ ifcapable like_opt&&!icu {
|
||||
SELECT a FROM t10b WHERE e GLOB '12*' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 5 like 6}
|
||||
do_test like-10.14 {
|
||||
count {
|
||||
SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 4 like 0}
|
||||
ifcapable like_match_blobs {
|
||||
do_test like-10.14 {
|
||||
count {
|
||||
SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 4 like 0}
|
||||
} else {
|
||||
do_test like-10.14 {
|
||||
count {
|
||||
SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY +a;
|
||||
}
|
||||
} {12 123 scan 3 like 0}
|
||||
}
|
||||
do_test like-10.15 {
|
||||
count {
|
||||
SELECT a FROM t10b WHERE a GLOB '12*' ORDER BY +a;
|
||||
|
||||
+5
-2
@@ -29,6 +29,11 @@
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !like_match_blobs {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
do_execsql_test like3-1.1 {
|
||||
PRAGMA encoding=UTF8;
|
||||
CREATE TABLE t1(a,b TEXT COLLATE nocase);
|
||||
@@ -107,6 +112,4 @@ do_execsql_test like3-4.2ck {
|
||||
SELECT quote(x) FROM t4 WHERE x LIKE 'ab%' ORDER BY +x ASC;
|
||||
} {'abc' 'abd' 'abe' X'616263' X'616264' X'616265'}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
+7
-2
@@ -125,8 +125,8 @@ ifcapable attach {
|
||||
|
||||
# Default setting of PRAGMA cache_spill is always ON
|
||||
#
|
||||
# EVIDENCE-OF: R-51036-62828 PRAGMA cache_spill; PRAGMA
|
||||
# cache_spill=boolean;
|
||||
# EVIDENCE-OF: R-63549-59887 PRAGMA cache_spill; PRAGMA
|
||||
# cache_spill=boolean; PRAGMA schema.cache_spill=N;
|
||||
#
|
||||
# EVIDENCE-OF: R-23955-02765 Cache_spill is enabled by default
|
||||
#
|
||||
@@ -190,6 +190,11 @@ do_test pragma2-4.5.1 {
|
||||
PRAGMA lock_status;
|
||||
}
|
||||
} {0 main reserved temp unknown} ;# No cache spill, so no exclusive lock
|
||||
|
||||
|
||||
# EVIDENCE-OF: R-34657-61226 The "PRAGMA cache_spill=N" form of this
|
||||
# pragma sets a minimum cache size threshold required for spilling to
|
||||
# occur.
|
||||
do_test pragma2-4.5.2 {
|
||||
db eval {
|
||||
ROLLBACK;
|
||||
|
||||
@@ -226,6 +226,7 @@ do_faultsim_test 3 -faults vfsfault-* -prep {
|
||||
faultsim_delete_and_reopen
|
||||
file_control_chunksize_test db main 8192
|
||||
execsql {
|
||||
PRAGMA synchronous=OFF;
|
||||
CREATE TABLE t1(a, b);
|
||||
BEGIN;
|
||||
SELECT * FROM t1;
|
||||
|
||||
+32
-2
@@ -88,6 +88,13 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "test_multiplex.h"
|
||||
|
||||
/* Required to link test_multiplex.c */
|
||||
#ifndef SQLITE_OMIT_WSD
|
||||
int sqlite3PendingByte = 0x40000000;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This code implements the MD5 message-digest algorithm.
|
||||
* The algorithm is due to Ron Rivest. This code was
|
||||
@@ -1460,13 +1467,36 @@ int main(int argc, char **argv){
|
||||
argc = 2;
|
||||
argv = substArgv;
|
||||
}
|
||||
|
||||
/* Loop through the command-line arguments to ensure that each argument
|
||||
** selects at least one test. If not, assume there is a typo on the
|
||||
** command-line and bail out with the usage message. */
|
||||
for(iArg=1; iArg<argc; iArg++){
|
||||
const char *zArg = argv[iArg];
|
||||
if( zArg[0]=='-' ){
|
||||
if( sqlite3_stricmp(zArg, "-multiplexor")==0 ){
|
||||
/* Install the multiplexor VFS as the default */
|
||||
int rc = sqlite3_multiplex_initialize(0, 1);
|
||||
if( rc!=SQLITE_OK ){
|
||||
fprintf(stderr, "Failed to install multiplexor VFS (%d)\n", rc);
|
||||
return 253;
|
||||
}
|
||||
}
|
||||
else {
|
||||
goto usage;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
|
||||
if( sqlite3_strglob(argv[iArg],aTest[i].zTest)==0 ) break;
|
||||
if( sqlite3_strglob(zArg, aTest[i].zTest)==0 ) break;
|
||||
}
|
||||
if( i>=sizeof(aTest)/sizeof(aTest[0]) ) goto usage;
|
||||
}
|
||||
|
||||
for(iArg=1; iArg<argc; iArg++){
|
||||
if( argv[iArg][0]=='-' ) continue;
|
||||
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
|
||||
char const *z = aTest[i].zTest;
|
||||
if( sqlite3_strglob(argv[iArg],z)==0 ){
|
||||
@@ -1483,7 +1513,7 @@ int main(int argc, char **argv){
|
||||
return (nGlobalErr>0 ? 255 : 0);
|
||||
|
||||
usage:
|
||||
printf("Usage: %s [testname|testprefix*]...\n", argv[0]);
|
||||
printf("Usage: %s [-multiplexor] [testname|testprefix*]...\n", argv[0]);
|
||||
printf("Available tests are:\n");
|
||||
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
|
||||
printf(" %s\n", aTest[i].zTest);
|
||||
|
||||
+1
-3
@@ -125,7 +125,7 @@ if {1} {
|
||||
}
|
||||
return $res
|
||||
} else {
|
||||
return [exec ls -U /]
|
||||
return [string map {/ {}} [glob /*]]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,5 +214,3 @@ if {1} {
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,18 @@ do_test where7-1.1 {
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {1 2 3 4 2 3 4 5 3 4 6 8 4 5 10 15 5 10 100 1000}
|
||||
do_execsql_test where7-1.1.1 {
|
||||
CREATE TABLE t(a);
|
||||
CREATE INDEX ta ON t(a);
|
||||
INSERT INTO t(a) VALUES(1),(2);
|
||||
SELECT * FROM t ORDER BY a;
|
||||
SELECT * FROM t WHERE a<2 OR a<3 ORDER BY a;
|
||||
PRAGMA count_changes=ON;
|
||||
DELETE FROM t WHERE a<2 OR a<3;
|
||||
SELECT * FROM t;
|
||||
PRAGMA count_changes=OFF;
|
||||
DROP TABLE t;
|
||||
} {1 2 1 2 2}
|
||||
do_test where7-1.2 {
|
||||
count_steps {
|
||||
SELECT a FROM t1 WHERE b=3 OR c=6 ORDER BY a
|
||||
|
||||
+15
-7
@@ -64,13 +64,21 @@ do_test where8-1.3 {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b = 'two' }
|
||||
} {IX X II 0 0 6}
|
||||
|
||||
do_test where8-1.4 {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' }
|
||||
} {IX X III II 0 0 10}
|
||||
|
||||
do_test where8-1.5 {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' }
|
||||
} {IX X V IV 0 0 10}
|
||||
ifcapable like_match_blobs {
|
||||
do_test where8-1.4a {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' }
|
||||
} {IX X III II 0 0 10}
|
||||
do_test where8-1.5a {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' }
|
||||
} {IX X V IV 0 0 10}
|
||||
} else {
|
||||
do_test where8-1.4b {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' }
|
||||
} {IX X III II 0 0 9}
|
||||
do_test where8-1.5 {
|
||||
execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' }
|
||||
} {IX X V IV 0 0 9}
|
||||
}
|
||||
|
||||
do_test where8-1.6 {
|
||||
execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY rowid }
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ IF NOT DEFINED TEMP (
|
||||
%_VECHO% Temp = '%TEMP%'
|
||||
|
||||
IF NOT DEFINED TCLKIT_URI (
|
||||
SET TCLKIT_URI=http://tclsh.com/
|
||||
SET TCLKIT_URI=https://tclsh.com/
|
||||
)
|
||||
|
||||
%_VECHO% TclKitUri = '%TCLKIT_URI%'
|
||||
|
||||
@@ -320,7 +320,7 @@ REM
|
||||
IF DEFINED UCRTVersion (
|
||||
SET NUCRTVER=%UCRTVersion%
|
||||
) ELSE (
|
||||
SET NUCRTVER=10.0.10240.0
|
||||
SET NUCRTVER=10.0.10586.0
|
||||
)
|
||||
|
||||
REM
|
||||
|
||||
Reference in New Issue
Block a user