Merge latest trunk changes into this branch.
FossilOrigin-Name: 6a00a34e198408d69d638a25763f64b8a5beec61a60affb4d344426a2e232d72
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
C Merge\slatest\strunk\schanges\sinto\sthis\sbranch.
|
||||
D 2018-07-10T15:45:54.355
|
||||
D 2018-07-12T19:28:43.961
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F Makefile.in 0a3a6c81e6fcb969ff9106e882f0a08547014ba463cb6beca4c4efaecc924ee6
|
||||
@@ -434,7 +434,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c 6beb476095a4cfeb95ebedb2e5e17894d1687b24fddd5b8761a4de120e0392c6
|
||||
F src/analyze.c 41f0b8d638fc2a7309477904ac38e535f2aabea3256da3251e529730e099df77
|
||||
F src/analyze.c 91b5e7c0f4a08dbb1f7a24b24e7ab49be8b0a2fd1906a35add62a855d1c0ceb9
|
||||
F src/attach.c 4bd5b92633671d3e8ce431153ebb1893b50335818423b5373f3f27969f79769a
|
||||
F src/auth.c a38f3c63c974787ecf75e3213f8cac6568b9a7af7591fb0372ec0517dd16dca8
|
||||
F src/backup.c 78d3cecfbe28230a3a9a1793e2ead609f469be43e8f486ca996006be551857ab
|
||||
@@ -451,7 +451,7 @@ F src/date.c ebe1dc7c8a347117bb02570f1a931c62dd78f4a2b1b516f4837d45b7d6426957
|
||||
F src/dbpage.c 4aa7f26198934dbd002e69418220eae3dbc71b010bbac32bd78faf86b52ce6c3
|
||||
F src/dbstat.c edabb82611143727511a45ca0859b8cd037851ebe756ae3db289859dd18b6f91
|
||||
F src/delete.c 4c8c7604277a2041647f96b78f4b9a47858e9217e4fb333d35e7b5ab32c5b57f
|
||||
F src/expr.c 0abe1e6931ea3527549993d66a4e010231059c79a62cd9ed51c6ca5cc5b87c30
|
||||
F src/expr.c bb148f4c45b6e53b5b58a912974253547e8862685cb001fbdfaef0ab24812e6f
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c b1da9ef8dc834603bb0d28972378a7ce65897847f9a1e89ab800bbdf24c788ee
|
||||
F src/func.c 7c288b4ce309b5a8b8473514b88e1f8e69a80134509a8c0db8e39c858e367e7f
|
||||
@@ -460,10 +460,10 @@ F src/hash.c a12580e143f10301ed5166ea4964ae2853d3905a511d4e0c44497245c7ce1f7a
|
||||
F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
|
||||
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
|
||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c bcacf6a0d277f8fa0e4f9ffecda544a2330ca4478f904cd89564c2dd86d0b16b
|
||||
F src/insert.c 8613af9c5ba1503bc68f4e9432c6c024e0fdafdc791575c50f380f73ec91189f
|
||||
F src/legacy.c 134ab3e3fae00a0f67a5187981d6935b24b337bcf0f4b3e5c9fa5763da95bf4e
|
||||
F src/loadext.c 6aae5739198d96c51ae6eb97c4a5b1744c22ed7a5a565a5399a717780d48a36b
|
||||
F src/main.c 176af447d71fc10e87d14ad155297bad2e8a68ca9b95153d726761b3f1e5595c
|
||||
F src/main.c 9473d98841e758c285d0a82791957550181769bab17a6d4437810805b1c937c0
|
||||
F src/malloc.c 07295435093ce354c6d9063ac05a2eeae28bd251d2e63c48b3d67c12c76f7e18
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de
|
||||
@@ -488,7 +488,7 @@ F src/os_win.c ac29c25cde4cfb4adacc59cdec4aa45698ca0e29164ea127859585ccd9faa354
|
||||
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
|
||||
F src/pager.c 5feea9c9e681f9150fd1735c003825b32185df0bfa517870d69d4bacd51c4104
|
||||
F src/pager.h abf96ba73094af7095f45495734f162642542d841ca563998795fc9447a01e1f
|
||||
F src/parse.y 2578339a1402c25ecfd270a8c9747424aea35f9d1280e3082757d05970a1b991
|
||||
F src/parse.y 70e577a1b8d580c840ddfef40191d76282d60b224fdbfaa39320c69bec2f4f2d
|
||||
F src/pcache.c 135ef0bc6fb2e3b7178d49ab5c9176254c8a691832c1bceb1156b2fbdd0869bd
|
||||
F src/pcache.h 072f94d29281cffd99e46c1539849f248c4b56ae7684c1f36626797fee375170
|
||||
F src/pcache1.c 716975564c15eb6679e97f734cec1bfd6c16ac3d4010f05f1f8e509fc7d19880
|
||||
@@ -499,17 +499,17 @@ F src/printf.c 7f6f3cba8e0c49c19e30a1ff4e9aeda6e06814dcbad4b664a69e1b6cb6e7e365
|
||||
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||
F src/resolve.c 797088662ed61102485e3070ba3b3f7828bd5ef6a588223ba6865d77d52f6cea
|
||||
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
|
||||
F src/select.c c06d56c1d5931456b2507ac8cf8205e83492a309b685e3978953f0b0156af191
|
||||
F src/select.c 2e9661d4424f43ccf595c4a7b4acdf32db523c0f6b31cbd62e6e5a2f43118981
|
||||
F src/shell.c.in f1c79c537117ee61317a5ed85cdbcb854998cd690eb34ab803779358a2ace780
|
||||
F src/sqlite.h.in 3818a7a023edbca14c433d85ca098e423120b403c89db7179a7dd47748054f31
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 9887b27e69c01e79c2cbe74ef73bf01af5b5703d6a7f0a4371e386d7249cb1c7
|
||||
F src/sqliteInt.h 1cea90fe375c3c4bff5d68161bbfaeab79952e86689996382c128af774f7f1bd
|
||||
F src/sqliteInt.h 339bc14a899e31eb4c983c07e96ee9f0356fa0d76dcf2df893e2d0f72bdaf3cb
|
||||
F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b
|
||||
F src/status.c 46e7aec11f79dad50965a5ca5fa9de009f7d6bde08be2156f1538a0a296d4d0e
|
||||
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
|
||||
F src/tclsqlite.c 916a92de77ec5cbe27818ca194d8cf0c58aa7ad5b87527098f6aa5a6068800ce
|
||||
F src/test1.c dac8c86fe74879f91931665e786b17cbd90f318423e5f4500e68ab0644655f6b
|
||||
F src/test1.c 62a59bb973b1c1aba82d259c8358f6c7fed66b5e81a6361549d810a8f74ad110
|
||||
F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5
|
||||
F src/test3.c 61798bb0d38b915067a8c8e03f5a534b431181f802659a6616f9b4ff7d872644
|
||||
F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6
|
||||
@@ -563,15 +563,15 @@ F src/test_window.c 0d19b33e7a262d3b55e85bc0fb84a70f503686cbd769939176162fe866ce
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 01e96d1b639c3eb0b9ef90616e766d453935c554f1f7aa86b6db937b79554b97
|
||||
F src/treeview.c 2d0fa21befa82f5c1ec419d20ea73dd845faffeb27ee1df9828e742985c35729
|
||||
F src/treeview.c 462346b82a892316a62291791c77e3dd5f1927745fe4a44b846ab4fd16eb28c3
|
||||
F src/trigger.c 4ace6d1d5ba9a89822deb287317f33c810440526eafe185c2d8a48c31df1e995
|
||||
F src/update.c 46dc24c6158446aaab45caee09b6d99327cb479268b83ffeb5b701823da3b67b
|
||||
F src/update.c 7b7c768dc415a8d2eb9fd2cea8b524cb29cf354f319700e22f94f262d3f507cb
|
||||
F src/upsert.c 47edd408cc73f8d3c00a140550d1ad180b407c146285947969dd09874802bf88
|
||||
F src/utf.c 810fbfebe12359f10bc2a011520a6e10879ab2a163bcb26c74768eab82ea62a5
|
||||
F src/util.c d9eb0a6c4aae1b00a7369eadd7ca0bbe946cb4c953b6751aa20d357c2f482157
|
||||
F src/vacuum.c 4879e47105cea12bae7731d353cdee6cba6834e83f1f649483c34719750656ed
|
||||
F src/vdbe.c 5040613bad982c0e93e8bcf54e19b9b953ca59e7a752e7f4f1741232e4f7948d
|
||||
F src/vdbe.h 9c8c245fa3785266c269ab02c135c836ff49a307612186686bcdae500f409945
|
||||
F src/vdbe.c c8b095bcd8f6626d763b11468b49d3f12e7e0e5dd14e0e44a773088bc1b4542c
|
||||
F src/vdbe.h d93abdc8bc9295e0a256e582c19f548c545dc498319d108bbc9dd29de31c48a2
|
||||
F src/vdbeInt.h 6b5cbd338dc9aaad343fb11b455e47463b0474d9f79710f50e647158941146e0
|
||||
F src/vdbeapi.c af4a3de00d1851bcbc55b85dfbe52849aa2b1e17b4a5a1f3d9c257df7af361ff
|
||||
F src/vdbeaux.c 82a912312d2c0fea4d03016634b674944fbf04e2d58eb1e23d33b93fb3e32c07
|
||||
@@ -584,11 +584,11 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c a49089219d0421ad172918ec8d7a3c637ee6f1c56026e45f0678073d9e346097
|
||||
F src/wal.h 1713fefe4587678c295bbeb91c4e7442998ad74f19249869ce49dda9e8ce5d53
|
||||
F src/walker.c ba7225773931760cf60bf22f34d0cce2588df7ce5ce0f215a52eb88234b55ac4
|
||||
F src/where.c 0bcbf9e191ca07f9ea2008aa80e70ded46bcdffd26560c83397da501f00aece6
|
||||
F src/where.c cd6710e24d3d5c29d6890df93865c22d896453907eb83988c505a3098e90179f
|
||||
F src/whereInt.h b90ef9b9707ef750eab2a7a080c48fb4900315033274689def32d0cf5a81ebe4
|
||||
F src/wherecode.c 3317f2b083a66d3e65a03edf316ade4ccb0a99c9956273282ebb579b95d4ba96
|
||||
F src/wherecode.c fe23a55294b4c94bf658d2a6eb7996170dd563bf33af4c3e5d71aff3483e4b08
|
||||
F src/whereexpr.c 571618c67a3eb5ce0f1158c2792c1aee9b4a4a264392fc4fb1b35467f80abf9a
|
||||
F src/window.c df2bc08168ec3d7509d4674b0e52f90f83011425e0d6519240cec051d16cbd62
|
||||
F src/window.c c61434ce7e35b7d76b3321dec39e10e79061c10eed1e3d7976c87dbdd77aefb5
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
|
||||
F test/affinity3.test 6a101af2fc945ce2912f6fe54dd646018551710d
|
||||
@@ -1161,7 +1161,7 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
|
||||
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test 5c2167e03dc55ff697e11bb3abf10c66ba452e4afb2dbd85a2b144048355300e
|
||||
F test/pg_common.tcl 3bf36b30d7b09e5896a1fb0268ace22f2ebfa91d07a422d8ffbf57551d9ce0dc
|
||||
F test/pg_common.tcl 301ac19c1a52fd55166d26db929b3b89165c634d52b5f8ad76ea8cb06960db30
|
||||
F test/pragma.test 7c8cfc328a1717a95663cf8edb06c52ddfeaf97bb0aee69ae7457132e8d39e7d
|
||||
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
|
||||
F test/pragma3.test 14c12bc5352b1e100e0b6b44f371053a81ccf8ed
|
||||
@@ -1187,7 +1187,7 @@ F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
|
||||
F test/regexp2.test 40e894223b3d6672655481493f1be12012f2b33c
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.tcl 769892f81050b3f59c66f274d478d855159b474ea27019dec82f1215c0b91ef7 x
|
||||
F test/resetdb.test 46abce317cb093f37c26c8ecebc518d24f84a627b9f3babde8e0b7904f45fcd8
|
||||
F test/resetdb.test c70ac9b8ceef3ccb094e22df19d5e7c283b1fb2f729c544c5c211aa58057f4aa
|
||||
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
|
||||
F test/rollback.test 06680159bc6746d0f26276e339e3ae2f951c64812468308838e0a3362d911eaa
|
||||
F test/rollback2.test bc868d57899dc6972e2b4483faae0e03365a0556941474eec487ae21d8d38bb6
|
||||
@@ -1236,7 +1236,7 @@ F test/select9.test aebc2bb0c3bc44606125033cbcaac2c8d1f33a95
|
||||
F test/selectA.test b8a590f6493cad5b0bb4dfe1709bf7dcda0b6c40bb4caf32d1e36a89eebc8fc5
|
||||
F test/selectB.test 954e4e49cf1f896d61794e440669e03a27ceea25
|
||||
F test/selectC.test e25243f8ca503e06f252eb0218976d07cfeceac3
|
||||
F test/selectD.test cfa9f27dbdbeaf2d021d26c79b6c790d8f26e5506d50117c7696d3e136d6d9e7
|
||||
F test/selectD.test fc20452847a01775710090383cfb4423275d2f745fed61f34fbf37573ac0d214
|
||||
F test/selectE.test a8730ca330fcf40ace158f134f4fe0eb00c7edbf
|
||||
F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3
|
||||
F test/selectG.test 089f7d3d7e6db91566f00b036cb353107a2cca6220eb1cb264085a836dae8840
|
||||
@@ -1268,7 +1268,7 @@ F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
|
||||
F test/shrink.test 1b4330b1fd9e818c04726d45cb28db73087535ce
|
||||
F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329
|
||||
F test/skipscan1.test 8ab5d2c7c5cd3fe7f172d366e6e74e887cb33cb4
|
||||
F test/skipscan1.test 3ea1cccca8f1b0e1cf3e73a63b43dd796f34d4aaee815e641f0d2ebb3fa448d4
|
||||
F test/skipscan2.test ef143c6e4a5ba4f19c1d1e3f517811f7942bdf2142736cc568feb34e0b5fb763
|
||||
F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5
|
||||
F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2
|
||||
@@ -1334,7 +1334,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
|
||||
F test/temptable2.test d2940417496e2b9548e01d09990763fbe88c316504033256d51493e1f1a5ce6a
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl aa7558f20fcf7dd9151325f849d9103bd450235093bc078073bf0f080991e3c4
|
||||
F test/tester.tcl d5138d226cc2aaacb6934cdd79acaa5edd17cad862482895b833bbf62c49aca0
|
||||
F test/thread001.test b61a29dd87cf669f5f6ac96124a7c97d71b0c80d9012746072055877055cf9ef
|
||||
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
|
||||
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
|
||||
@@ -1530,7 +1530,7 @@ F test/unixexcl.test d936ba2b06794018e136418addd59a2354eeae97
|
||||
F test/unordered.test ffeea7747d5ba962a8009a20b7e53d68cbae05b063604c68702c5998eb50c981
|
||||
F test/update.test 1148de8d913e9817717990603aadeca07aab9ddbb10a30f167cbfd8d3a3ccb60
|
||||
F test/update2.test 5e67667e1c54017d964e626db765cf8bedcf87483c184f4c575bdb8c1dd2313e
|
||||
F test/upsert1.test d587db593f131e112a98a05685c418e0eacc28df5905403e4ca04cd74c39a3fc
|
||||
F test/upsert1.test ecd8f69e20183f298464992762fee24750508b3cbefc5badba8a259a3fc887ec
|
||||
F test/upsert2.test 9c3cdbb1a890227f6504ce4b0e3de68f4cdfa16bb21d8641208a9239896c5a09
|
||||
F test/upsert3.test 88d7d590a1948a9cb6eac1b54b0642f67a9f35a1fc0f19b200e97d5d39e3179c
|
||||
F test/upsert4.test 25d2a1da92f149331ae0c51ca6e3eee78189577585eab92de149900d62994fa5
|
||||
@@ -1635,11 +1635,11 @@ F test/window1.test 7cb260079cd88d6d6177b0f592686f2bbbc2d10f4f415c8a37cd153eb83c
|
||||
F test/window2.tcl 9bfa842d8a62b0d36dc8c1b5972206393c43847433c6d75940b87fec93ce3143
|
||||
F test/window2.test 8e6d2a1b9f54dfebee1cde961c8590cd87b4db45c50f44947a211e1b63c2a05e
|
||||
F test/window3.tcl 577a3b1ff913208e5248c04dab9df17fd760ce159a752789e26d0cb4a5f91823
|
||||
F test/window3.test 87fb18021903fc4d1659b8b2092aea55d611a9606cfa7272686234e5197c4b31
|
||||
F test/window3.test e274b7f8952ca4ed25996e0e45c047192b066e0aaff2a822d4293c8c4f1d8d98
|
||||
F test/window4.tcl 871364059b7d320d556ec6ef804d604a4e8cc1547a3102c5d56067371bb200af
|
||||
F test/window4.test 323b118eb592932036388643ca6dcaead87f699bbea2984bbca49ba4ad6c2509
|
||||
F test/window5.test 8187f46597c90b73e8f96659e893353cbda337479cc582f7a488eab351ba08d3
|
||||
F test/window6.test 63a7176e01aef5cc202563bbd754a88131404bf1aa455d7232f29a4740e3ddde
|
||||
F test/window6.test 7574778c79cae89f1781df237bf9ff5063886deca91a36efc53934315f0e7612
|
||||
F test/windowfault.test 23abad97b72c6f609002255ddd41ef5c8922408f918f9b98ad6005ab316e482f
|
||||
F test/with1.test 58475190cd8caaeebea8cfeb2a264ec97a0c492b8ffe9ad20cefbb23df462f96
|
||||
F test/with2.test e0030e2f0267a910d6c0e4f46f2dfe941c1cc0d4f659ba69b3597728e7e8f1ab
|
||||
@@ -1757,7 +1757,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P d7299bfeb1eb031d6106b46139715047fe759d27b34b617ca43f2cd377b8188e 0f6ec605e131ab3d53b9df32af0a3207146a9abbd22dcabd6ef050b92f96735d
|
||||
R 0d6f4d8287e317704b4a5f08da2d9f1e
|
||||
P e9a3e8642e7acc8e63b35662ffae3a5a0da8d4f1ecefcb1db3110be19cbdab2b 650a3fe03d61068e06f3097878a777ca8ed713a769444cdb3f8be7d1e19a0b83
|
||||
R 766e1e062d052109c3dfecf240911193
|
||||
U dan
|
||||
Z f474088e9eb99b2bb00c76e557edc5ba
|
||||
Z a216610c9e8dd272a7214383e8ef9de2
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
e9a3e8642e7acc8e63b35662ffae3a5a0da8d4f1ecefcb1db3110be19cbdab2b
|
||||
6a00a34e198408d69d638a25763f64b8a5beec61a60affb4d344426a2e232d72
|
||||
+1
-4
@@ -1274,10 +1274,7 @@ static void analyzeOneTable(
|
||||
callStatGet(v, regStat4, STAT_GET_NLT, regLt);
|
||||
callStatGet(v, regStat4, STAT_GET_NDLT, regDLt);
|
||||
sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
|
||||
/* We know that the regSampleRowid row exists because it was read by
|
||||
** the previous loop. Thus the not-found jump of seekOp will never
|
||||
** be taken */
|
||||
VdbeCoverageNeverTaken(v);
|
||||
VdbeCoverage(v);
|
||||
#ifdef SQLITE_ENABLE_STAT3
|
||||
sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, 0, regSample);
|
||||
#else
|
||||
|
||||
+1
-1
@@ -1487,7 +1487,7 @@ Select *sqlite3SelectDup(sqlite3 *db, Select *pDup, int flags){
|
||||
pNew->pWin = 0;
|
||||
pNew->pWinDefn = sqlite3WindowListDup(db, p->pWinDefn);
|
||||
#endif
|
||||
sqlite3SelectSetName(pNew, p->zSelName);
|
||||
pNew->selId = p->selId;
|
||||
*pp = pNew;
|
||||
pp = &pNew->pPrior;
|
||||
pNext = pNew;
|
||||
|
||||
+4
-4
@@ -1632,6 +1632,10 @@ void sqlite3GenerateConstraintChecks(
|
||||
int addrUniqueOk; /* Jump here if the UNIQUE constraint is satisfied */
|
||||
|
||||
if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */
|
||||
if( bAffinityDone==0 ){
|
||||
sqlite3TableAffinity(v, pTab, regNewData+1);
|
||||
bAffinityDone = 1;
|
||||
}
|
||||
if( pUpIdx==pIdx ){
|
||||
addrUniqueOk = sAddr.upsertBtm;
|
||||
upsertBypass = sqlite3VdbeGoto(v, 0);
|
||||
@@ -1641,10 +1645,6 @@ void sqlite3GenerateConstraintChecks(
|
||||
addrUniqueOk = sqlite3VdbeMakeLabel(v);
|
||||
}
|
||||
VdbeNoopComment((v, "uniqueness check for %s", pIdx->zName));
|
||||
if( bAffinityDone==0 ){
|
||||
sqlite3TableAffinity(v, pTab, regNewData+1);
|
||||
bAffinityDone = 1;
|
||||
}
|
||||
iThisCur = iIdxCur+ix;
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -3974,7 +3974,8 @@ int sqlite3_test_control(int op, ...){
|
||||
*/
|
||||
case SQLITE_TESTCTRL_VDBE_COVERAGE: {
|
||||
#ifdef SQLITE_VDBE_COVERAGE
|
||||
typedef void (*branch_callback)(void*,int,u8,u8);
|
||||
typedef void (*branch_callback)(void*,unsigned int,
|
||||
unsigned char,unsigned char);
|
||||
sqlite3GlobalConfig.xVdbeBranch = va_arg(ap,branch_callback);
|
||||
sqlite3GlobalConfig.pVdbeBranchArg = va_arg(ap,void*);
|
||||
#endif
|
||||
|
||||
+1
-27
@@ -546,15 +546,12 @@ multiselect_op(A) ::= UNION(OP). {A = @OP; /*A-overwrites-OP*/}
|
||||
multiselect_op(A) ::= UNION ALL. {A = TK_ALL;}
|
||||
multiselect_op(A) ::= EXCEPT|INTERSECT(OP). {A = @OP; /*A-overwrites-OP*/}
|
||||
%endif SQLITE_OMIT_COMPOUND_SELECT
|
||||
oneselect(A) ::= SELECT(S) distinct(D) selcollist(W) from(X) where_opt(Y)
|
||||
oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y)
|
||||
groupby_opt(P) having_opt(Q)
|
||||
%ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
windowdefn_opt(R)
|
||||
%endif
|
||||
orderby_opt(Z) limit_opt(L). {
|
||||
#if SELECTTRACE_ENABLED
|
||||
Token s = S; /*A-overwrites-S*/
|
||||
#endif
|
||||
A = sqlite3SelectNew(pParse,W,X,Y,P,Q,Z,D,L);
|
||||
#ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
if( A ){
|
||||
@@ -563,29 +560,6 @@ oneselect(A) ::= SELECT(S) distinct(D) selcollist(W) from(X) where_opt(Y)
|
||||
sqlite3WindowListDelete(pParse->db, R);
|
||||
}
|
||||
#endif /* SQLITE_OMIT_WINDOWFUNC */
|
||||
#if SELECTTRACE_ENABLED
|
||||
/* Populate the Select.zSelName[] string that is used to help with
|
||||
** query planner debugging, to differentiate between multiple Select
|
||||
** objects in a complex query.
|
||||
**
|
||||
** If the SELECT keyword is immediately followed by a C-style comment
|
||||
** then extract the first few alphanumeric characters from within that
|
||||
** comment to be the zSelName value. Otherwise, the label is #N where
|
||||
** is an integer that is incremented with each SELECT statement seen.
|
||||
*/
|
||||
if( A!=0 ){
|
||||
const char *z = s.z+6;
|
||||
int i;
|
||||
sqlite3_snprintf(sizeof(A->zSelName), A->zSelName,"#%d",++pParse->nSelect);
|
||||
while( z[0]==' ' ) z++;
|
||||
if( z[0]=='/' && z[1]=='*' ){
|
||||
z += 2;
|
||||
while( z[0]==' ' ) z++;
|
||||
for(i=0; sqlite3Isalnum(z[i]); i++){}
|
||||
sqlite3_snprintf(sizeof(A->zSelName), A->zSelName, "%.*s", i, z);
|
||||
}
|
||||
}
|
||||
#endif /* SELECTRACE_ENABLED */
|
||||
}
|
||||
oneselect(A) ::= values(A).
|
||||
|
||||
|
||||
+9
-24
@@ -21,7 +21,7 @@
|
||||
/***/ int sqlite3SelectTrace = 0;
|
||||
# define SELECTTRACE(K,P,S,X) \
|
||||
if(sqlite3SelectTrace&(K)) \
|
||||
sqlite3DebugPrintf("%s/%d/%p: ",(S)->zSelName,(P)->addrExplain,(S)),\
|
||||
sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
|
||||
sqlite3DebugPrintf X
|
||||
#else
|
||||
# define SELECTTRACE(K,P,S,X)
|
||||
@@ -151,9 +151,7 @@ Select *sqlite3SelectNew(
|
||||
pNew->selFlags = selFlags;
|
||||
pNew->iLimit = 0;
|
||||
pNew->iOffset = 0;
|
||||
#if SELECTTRACE_ENABLED
|
||||
pNew->zSelName[0] = 0;
|
||||
#endif
|
||||
pNew->selId = ++pParse->nSelect;
|
||||
pNew->addrOpenEphm[0] = -1;
|
||||
pNew->addrOpenEphm[1] = -1;
|
||||
pNew->nSelectRow = 0;
|
||||
@@ -181,17 +179,6 @@ Select *sqlite3SelectNew(
|
||||
return pNew;
|
||||
}
|
||||
|
||||
#if SELECTTRACE_ENABLED
|
||||
/*
|
||||
** Set the name of a Select object
|
||||
*/
|
||||
void sqlite3SelectSetName(Select *p, const char *zName){
|
||||
if( p && zName ){
|
||||
sqlite3_snprintf(sizeof(p->zSelName), p->zSelName, "%s", zName);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Delete the given Select structure and all of its substructures.
|
||||
@@ -3838,8 +3825,8 @@ static int flattenSubquery(
|
||||
assert( (p->selFlags & SF_Recursive)==0 || pSub->pPrior==0 );
|
||||
|
||||
/***** If we reach this point, flattening is permitted. *****/
|
||||
SELECTTRACE(1,pParse,p,("flatten %s.%p from term %d\n",
|
||||
pSub->zSelName, pSub, iFrom));
|
||||
SELECTTRACE(1,pParse,p,("flatten %u.%p from term %d\n",
|
||||
pSub->selId, pSub, iFrom));
|
||||
|
||||
/* Authorize the subquery */
|
||||
pParse->zAuthContext = pSubitem->zName;
|
||||
@@ -3890,7 +3877,6 @@ static int flattenSubquery(
|
||||
p->pPrior = 0;
|
||||
p->pLimit = 0;
|
||||
pNew = sqlite3SelectDup(db, p, 0);
|
||||
sqlite3SelectSetName(pNew, pSub->zSelName);
|
||||
p->pLimit = pLimit;
|
||||
p->pOrderBy = pOrderBy;
|
||||
p->pSrc = pSrc;
|
||||
@@ -3903,7 +3889,7 @@ static int flattenSubquery(
|
||||
pNew->pNext = p;
|
||||
p->pPrior = pNew;
|
||||
SELECTTRACE(2,pParse,p,("compound-subquery flattener"
|
||||
" creates %s.%p as peer\n",pNew->zSelName, pNew));
|
||||
" creates %u as peer\n",pNew->selId));
|
||||
}
|
||||
if( db->mallocFailed ) return 1;
|
||||
}
|
||||
@@ -4623,7 +4609,7 @@ int sqlite3ExpandSubquery(Parse *pParse, struct SrcList_item *pFrom){
|
||||
if( pFrom->zAlias ){
|
||||
pTab->zName = sqlite3DbStrDup(pParse->db, pFrom->zAlias);
|
||||
}else{
|
||||
pTab->zName = sqlite3MPrintf(pParse->db, "subquery_%p", (void*)pTab);
|
||||
pTab->zName = sqlite3MPrintf(pParse->db, "subquery_%u", pSel->selId);
|
||||
}
|
||||
while( pSel->pPrior ){ pSel = pSel->pPrior; }
|
||||
sqlite3ColumnsFromExprList(pParse, pSel->pEList,&pTab->nCol,&pTab->aCol);
|
||||
@@ -4729,7 +4715,6 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
|
||||
assert( pFrom->pSelect==0 );
|
||||
pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
|
||||
sqlite3SelectSetName(pFrom->pSelect, pTab->zName);
|
||||
nCol = pTab->nCol;
|
||||
pTab->nCol = -1;
|
||||
sqlite3WalkSelect(pWalker, pFrom->pSelect);
|
||||
@@ -5721,7 +5706,7 @@ int sqlite3Select(
|
||||
VdbeComment((v, "%s", pItem->pTab->zName));
|
||||
pItem->addrFillSub = addrTop;
|
||||
sqlite3SelectDestInit(&dest, SRT_Coroutine, pItem->regReturn);
|
||||
ExplainQueryPlan((pParse, 1, "CO-ROUTINE 0x%p", pSub));
|
||||
ExplainQueryPlan((pParse, 1, "CO-ROUTINE %u", pSub->selId));
|
||||
sqlite3Select(pParse, pSub, &dest);
|
||||
pItem->pTab->nRowLogEst = pSub->nSelectRow;
|
||||
pItem->fg.viaCoroutine = 1;
|
||||
@@ -5760,7 +5745,7 @@ int sqlite3Select(
|
||||
pSub->nSelectRow = pPrior->pSelect->nSelectRow;
|
||||
}else{
|
||||
sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor);
|
||||
ExplainQueryPlan((pParse, 1, "MATERIALIZE 0x%p", pSub));
|
||||
ExplainQueryPlan((pParse, 1, "MATERIALIZE %u", pSub->selId));
|
||||
sqlite3Select(pParse, pSub, &dest);
|
||||
}
|
||||
pItem->pTab->nRowLogEst = pSub->nSelectRow;
|
||||
@@ -5940,7 +5925,7 @@ int sqlite3Select(
|
||||
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, iBreak);
|
||||
sqlite3VdbeResolveLabel(v, addrGosub);
|
||||
VdbeNoopComment((v, "SELECT inner-loop subroutine"));
|
||||
VdbeNoopComment((v, "inner-loop subroutine"));
|
||||
selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest, iCont, iBreak);
|
||||
sqlite3VdbeResolveLabel(v, iCont);
|
||||
sqlite3VdbeAddOp1(v, OP_Return, regGosub);
|
||||
|
||||
+5
-13
@@ -1584,6 +1584,7 @@ struct sqlite3 {
|
||||
/* TH3 expects the Stat34 ^^^^^^ value to be 0x0800. Don't change it */
|
||||
#define SQLITE_PushDown 0x1000 /* The push-down optimization */
|
||||
#define SQLITE_SimplifyJoin 0x2000 /* Convert LEFT JOIN to JOIN */
|
||||
#define SQLITE_SkipScan 0x4000 /* Skip-scans */
|
||||
#define SQLITE_AllOpts 0xffff /* All optimizations */
|
||||
|
||||
/*
|
||||
@@ -2809,9 +2810,7 @@ struct Select {
|
||||
LogEst nSelectRow; /* Estimated number of result rows */
|
||||
u32 selFlags; /* Various SF_* values */
|
||||
int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
|
||||
#if SELECTTRACE_ENABLED
|
||||
char zSelName[12]; /* Symbolic name of this SELECT use for debugging */
|
||||
#endif
|
||||
u32 selId; /* Unique identifier number for this SELECT */
|
||||
int addrOpenEphm[2]; /* OP_OpenEphem opcodes related to this select */
|
||||
SrcList *pSrc; /* The FROM clause */
|
||||
Expr *pWhere; /* The WHERE clause */
|
||||
@@ -3072,9 +3071,7 @@ struct Parse {
|
||||
int regRowid; /* Register holding rowid of CREATE TABLE entry */
|
||||
int regRoot; /* Register holding root page number for new objects */
|
||||
int nMaxArg; /* Max args passed to user function by sub-program */
|
||||
#if SELECTTRACE_ENABLED
|
||||
int nSelect; /* Number of SELECT statements seen */
|
||||
#endif
|
||||
int nSelect; /* Number of SELECT stmts. Counter for Select.selId */
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
int nTableLock; /* Number of locks in aTableLock */
|
||||
TableLock *aTableLock; /* Required table locks for shared-cache mode */
|
||||
@@ -3388,7 +3385,7 @@ struct Sqlite3Config {
|
||||
/* The following callback (if not NULL) is invoked on every VDBE branch
|
||||
** operation. Set the callback using SQLITE_TESTCTRL_VDBE_COVERAGE.
|
||||
*/
|
||||
void (*xVdbeBranch)(void*,int iSrcLine,u8 eThis,u8 eMx); /* Callback */
|
||||
void (*xVdbeBranch)(void*,unsigned iSrcLine,u8 eThis,u8 eMx); /* Callback */
|
||||
void *pVdbeBranchArg; /* 1st argument */
|
||||
#endif
|
||||
#ifndef SQLITE_UNTESTABLE
|
||||
@@ -3520,7 +3517,7 @@ struct Window {
|
||||
Window *pNextWin; /* Next window function belonging to this SELECT */
|
||||
Expr *pFilter; /* The FILTER expression */
|
||||
FuncDef *pFunc; /* The function */
|
||||
int iEphCsr; /* Temp table used by this window */
|
||||
int iEphCsr; /* Partition buffer or Peer buffer */
|
||||
int regAccum;
|
||||
int regResult;
|
||||
int csrApp; /* Function cursor (used by min/max) */
|
||||
@@ -4025,11 +4022,6 @@ ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int);
|
||||
SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int);
|
||||
IdList *sqlite3IdListDup(sqlite3*,IdList*);
|
||||
Select *sqlite3SelectDup(sqlite3*,Select*,int);
|
||||
#if SELECTTRACE_ENABLED
|
||||
void sqlite3SelectSetName(Select*,const char*);
|
||||
#else
|
||||
# define sqlite3SelectSetName(A,B)
|
||||
#endif
|
||||
void sqlite3InsertBuiltinFuncs(FuncDef*,int);
|
||||
FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,u8,u8);
|
||||
void sqlite3RegisterBuiltinFunctions(void);
|
||||
|
||||
@@ -6954,6 +6954,7 @@ static int SQLITE_TCLAPI optimization_control(
|
||||
{ "omit-noop-join", SQLITE_OmitNoopJoin },
|
||||
{ "stat3", SQLITE_Stat34 },
|
||||
{ "stat4", SQLITE_Stat34 },
|
||||
{ "skip-scan", SQLITE_SkipScan },
|
||||
};
|
||||
|
||||
if( objc!=4 ){
|
||||
|
||||
+2
-10
@@ -139,21 +139,13 @@ void sqlite3TreeViewSelect(TreeView *pView, const Select *p, u8 moreToFollow){
|
||||
sqlite3TreeViewPush(pView, 1);
|
||||
}
|
||||
do{
|
||||
#if SELECTTRACE_ENABLED
|
||||
sqlite3TreeViewLine(pView,
|
||||
"SELECT%s%s (%s/%p) selFlags=0x%x nSelectRow=%d",
|
||||
"SELECT%s%s (%u/%p) selFlags=0x%x nSelectRow=%d",
|
||||
((p->selFlags & SF_Distinct) ? " DISTINCT" : ""),
|
||||
((p->selFlags & SF_Aggregate) ? " agg_flag" : ""),
|
||||
p->zSelName, p, p->selFlags,
|
||||
p->selId, p, p->selFlags,
|
||||
(int)p->nSelectRow
|
||||
);
|
||||
#else
|
||||
sqlite3TreeViewLine(pView, "SELECT%s%s (0x%p) selFlags=0x%x nSelectRow=%d",
|
||||
((p->selFlags & SF_Distinct) ? " DISTINCT" : ""),
|
||||
((p->selFlags & SF_Aggregate) ? " agg_flag" : ""), p, p->selFlags,
|
||||
(int)p->nSelectRow
|
||||
);
|
||||
#endif
|
||||
if( cnt++ ) sqlite3TreeViewPop(pView);
|
||||
if( p->pPrior ){
|
||||
n = 1000;
|
||||
|
||||
+1
-1
@@ -523,7 +523,7 @@ void sqlite3Update(
|
||||
if( !isView && aiCurOnePass[0]!=iDataCur && aiCurOnePass[1]!=iDataCur ){
|
||||
assert( pPk );
|
||||
sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey,nKey);
|
||||
VdbeCoverageNeverTaken(v);
|
||||
VdbeCoverage(v);
|
||||
}
|
||||
if( eOnePass!=ONEPASS_SINGLE ){
|
||||
labelContinue = sqlite3VdbeMakeLabel(v);
|
||||
|
||||
+45
-21
@@ -134,32 +134,56 @@ int sqlite3_found_count = 0;
|
||||
** feature is used for test suite validation only and does not appear an
|
||||
** production builds.
|
||||
**
|
||||
** M is an integer, 2 or 3, that indices how many different ways the
|
||||
** branch can go. It is usually 2. "I" is the direction the branch
|
||||
** goes. 0 means falls through. 1 means branch is taken. 2 means the
|
||||
** second alternative branch is taken.
|
||||
** M is an integer between 2 and 4. 2 indicates a ordinary two-way
|
||||
** branch (I=0 means fall through and I=1 means taken). 3 indicates
|
||||
** a 3-way branch where the third way is when one of the operands is
|
||||
** NULL. 4 indicates the OP_Jump instruction which has three destinations
|
||||
** depending on whether the first operand is less than, equal to, or greater
|
||||
** than the second.
|
||||
**
|
||||
** iSrcLine is the source code line (from the __LINE__ macro) that
|
||||
** generated the VDBE instruction. This instrumentation assumes that all
|
||||
** source code is in a single file (the amalgamation). Special values 1
|
||||
** and 2 for the iSrcLine parameter mean that this particular branch is
|
||||
** always taken or never taken, respectively.
|
||||
** generated the VDBE instruction combined with flag bits. The source
|
||||
** code line number is in the lower 24 bits of iSrcLine and the upper
|
||||
** 8 bytes are flags. The lower three bits of the flags indicate
|
||||
** values for I that should never occur. For example, if the branch is
|
||||
** always taken, the flags should be 0x05 since the fall-through and
|
||||
** alternate branch are never taken. If a branch is never taken then
|
||||
** flags should be 0x06 since only the fall-through approach is allowed.
|
||||
**
|
||||
** Bit 0x04 of the flags indicates an OP_Jump opcode that is only
|
||||
** interested in equal or not-equal. In other words, I==0 and I==2
|
||||
** should be treated the same.
|
||||
**
|
||||
** Since only a line number is retained, not the filename, this macro
|
||||
** only works for amalgamation builds. But that is ok, since these macros
|
||||
** should be no-ops except for special builds used to measure test coverage.
|
||||
*/
|
||||
#if !defined(SQLITE_VDBE_COVERAGE)
|
||||
# define VdbeBranchTaken(I,M)
|
||||
#else
|
||||
# define VdbeBranchTaken(I,M) vdbeTakeBranch(pOp->iSrcLine,I,M)
|
||||
static void vdbeTakeBranch(int iSrcLine, u8 I, u8 M){
|
||||
if( iSrcLine<=2 && ALWAYS(iSrcLine>0) ){
|
||||
M = iSrcLine;
|
||||
/* Assert the truth of VdbeCoverageAlwaysTaken() and
|
||||
** VdbeCoverageNeverTaken() */
|
||||
assert( (M & I)==I );
|
||||
}else{
|
||||
if( sqlite3GlobalConfig.xVdbeBranch==0 ) return; /*NO_TEST*/
|
||||
sqlite3GlobalConfig.xVdbeBranch(sqlite3GlobalConfig.pVdbeBranchArg,
|
||||
iSrcLine,I,M);
|
||||
static void vdbeTakeBranch(u32 iSrcLine, u8 I, u8 M){
|
||||
u8 mNever;
|
||||
assert( I<=2 ); /* 0: fall through, 1: taken, 2: alternate taken */
|
||||
assert( M<=4 ); /* 2: two-way branch, 3: three-way branch, 4: OP_Jump */
|
||||
assert( I<M ); /* I can only be 2 if M is 3 or 4 */
|
||||
/* Transform I from a integer [0,1,2] into a bitmask of [1,2,4] */
|
||||
I = 1<<I;
|
||||
/* The upper 8 bits of iSrcLine are flags. The lower three bits of
|
||||
** the flags indicate directions that the branch can never go. If
|
||||
** a branch really does go in one of those directions, assert right
|
||||
** away. */
|
||||
mNever = iSrcLine >> 24;
|
||||
assert( (I & mNever)==0 );
|
||||
if( sqlite3GlobalConfig.xVdbeBranch==0 ) return; /*NO_TEST*/
|
||||
I |= mNever;
|
||||
if( M==2 ) I |= 0x04;
|
||||
if( M==4 ){
|
||||
I |= 0x08;
|
||||
if( (mNever&0x08)!=0 && (I&0x05)!=0) I |= 0x05; /*NO_TEST*/
|
||||
}
|
||||
sqlite3GlobalConfig.xVdbeBranch(sqlite3GlobalConfig.pVdbeBranchArg,
|
||||
iSrcLine&0xffffff, I, M);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2162,11 +2186,11 @@ case OP_Compare: {
|
||||
*/
|
||||
case OP_Jump: { /* jump */
|
||||
if( iCompare<0 ){
|
||||
VdbeBranchTaken(0,3); pOp = &aOp[pOp->p1 - 1];
|
||||
VdbeBranchTaken(0,4); pOp = &aOp[pOp->p1 - 1];
|
||||
}else if( iCompare==0 ){
|
||||
VdbeBranchTaken(1,3); pOp = &aOp[pOp->p2 - 1];
|
||||
VdbeBranchTaken(1,4); pOp = &aOp[pOp->p2 - 1];
|
||||
}else{
|
||||
VdbeBranchTaken(2,3); pOp = &aOp[pOp->p3 - 1];
|
||||
VdbeBranchTaken(2,4); pOp = &aOp[pOp->p3 - 1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+33
-3
@@ -73,7 +73,8 @@ struct VdbeOp {
|
||||
u64 cycles; /* Total time spent executing this instruction */
|
||||
#endif
|
||||
#ifdef SQLITE_VDBE_COVERAGE
|
||||
int iSrcLine; /* Source-code line that generated this opcode */
|
||||
u32 iSrcLine; /* Source-code line that generated this opcode
|
||||
** with flags in the upper 8 bits */
|
||||
#endif
|
||||
};
|
||||
typedef struct VdbeOp VdbeOp;
|
||||
@@ -317,23 +318,52 @@ int sqlite3NotPureFunc(sqlite3_context*);
|
||||
**
|
||||
** VdbeCoverageNeverTaken(v) // Previous branch is never taken
|
||||
**
|
||||
** VdbeCoverageNeverNull(v) // Previous three-way branch is only
|
||||
** // taken on the first two ways. The
|
||||
** // NULL option is not possible
|
||||
**
|
||||
** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested
|
||||
** // in distingishing equal and not-equal.
|
||||
**
|
||||
** Every VDBE branch operation must be tagged with one of the macros above.
|
||||
** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and
|
||||
** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch()
|
||||
** routine in vdbe.c, alerting the developer to the missed tag.
|
||||
**
|
||||
** During testing, the test application will invoke
|
||||
** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback
|
||||
** routine that is invoked as each bytecode branch is taken. The callback
|
||||
** contains the sqlite3.c source line number ov the VdbeCoverage macro and
|
||||
** flags to indicate whether or not the branch was taken. The test application
|
||||
** is responsible for keeping track of this and reporting byte-code branches
|
||||
** that are never taken.
|
||||
**
|
||||
** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the
|
||||
** vdbe.c source file for additional information.
|
||||
*/
|
||||
#ifdef SQLITE_VDBE_COVERAGE
|
||||
void sqlite3VdbeSetLineNumber(Vdbe*,int);
|
||||
# define VdbeCoverage(v) sqlite3VdbeSetLineNumber(v,__LINE__)
|
||||
# define VdbeCoverageIf(v,x) if(x)sqlite3VdbeSetLineNumber(v,__LINE__)
|
||||
# define VdbeCoverageAlwaysTaken(v) sqlite3VdbeSetLineNumber(v,2);
|
||||
# define VdbeCoverageNeverTaken(v) sqlite3VdbeSetLineNumber(v,1);
|
||||
# define VdbeCoverageAlwaysTaken(v) \
|
||||
sqlite3VdbeSetLineNumber(v,__LINE__|0x5000000);
|
||||
# define VdbeCoverageNeverTaken(v) \
|
||||
sqlite3VdbeSetLineNumber(v,__LINE__|0x6000000);
|
||||
# define VdbeCoverageNeverNull(v) \
|
||||
sqlite3VdbeSetLineNumber(v,__LINE__|0x4000000);
|
||||
# define VdbeCoverageNeverNullIf(v,x) \
|
||||
if(x)sqlite3VdbeSetLineNumber(v,__LINE__|0x4000000);
|
||||
# define VdbeCoverageEqNe(v) \
|
||||
sqlite3VdbeSetLineNumber(v,__LINE__|0x8000000);
|
||||
# define VDBE_OFFSET_LINENO(x) (__LINE__+x)
|
||||
#else
|
||||
# define VdbeCoverage(v)
|
||||
# define VdbeCoverageIf(v,x)
|
||||
# define VdbeCoverageAlwaysTaken(v)
|
||||
# define VdbeCoverageNeverTaken(v)
|
||||
# define VdbeCoverageNeverNull(v)
|
||||
# define VdbeCoverageNeverNullIf(v,x)
|
||||
# define VdbeCoverageEqNe(v)
|
||||
# define VDBE_OFFSET_LINENO(x) 0
|
||||
#endif
|
||||
|
||||
|
||||
+2
-1
@@ -810,7 +810,7 @@ static void constructAutomaticIndex(
|
||||
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
|
||||
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
|
||||
VdbeCoverage(v);
|
||||
VdbeComment((v, "next row of \"%s\"", pTabItem->pTab->zName));
|
||||
VdbeComment((v, "next row of %s", pTabItem->pTab->zName));
|
||||
}else{
|
||||
addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur); VdbeCoverage(v);
|
||||
}
|
||||
@@ -2672,6 +2672,7 @@ static int whereLoopAddBtreeIndex(
|
||||
if( saved_nEq==saved_nSkip
|
||||
&& saved_nEq+1<pProbe->nKeyCol
|
||||
&& pProbe->noSkipScan==0
|
||||
&& OptimizationEnabled(db, SQLITE_SkipScan)
|
||||
&& pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */
|
||||
&& (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK
|
||||
){
|
||||
|
||||
+2
-2
@@ -150,7 +150,7 @@ int sqlite3WhereExplainOneScan(
|
||||
sqlite3StrAccumInit(&str, db, zBuf, sizeof(zBuf), SQLITE_MAX_LENGTH);
|
||||
sqlite3_str_appendall(&str, isSearch ? "SEARCH" : "SCAN");
|
||||
if( pItem->pSelect ){
|
||||
sqlite3_str_appendf(&str, " SUBQUERY 0x%p", pItem->pSelect);
|
||||
sqlite3_str_appendf(&str, " SUBQUERY %u", pItem->pSelect->selId);
|
||||
}else{
|
||||
sqlite3_str_appendf(&str, " TABLE %s", pItem->zName);
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
|
||||
pLevel->p2 = sqlite3VdbeAddOp2(v, OP_Yield, regYield, addrBrk);
|
||||
VdbeCoverage(v);
|
||||
VdbeComment((v, "next row of \"%s\"", pTabItem->pTab->zName));
|
||||
VdbeComment((v, "next row of %s", pTabItem->pTab->zName));
|
||||
pLevel->op = OP_Goto;
|
||||
}else
|
||||
|
||||
|
||||
+53
-21
@@ -589,7 +589,9 @@ void sqlite3WindowUpdate(
|
||||
typedef struct WindowRewrite WindowRewrite;
|
||||
struct WindowRewrite {
|
||||
Window *pWin;
|
||||
SrcList *pSrc;
|
||||
ExprList *pSub;
|
||||
Select *pSubSelect; /* Current sub-select, if any */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -601,6 +603,24 @@ static int selectWindowRewriteExprCb(Walker *pWalker, Expr *pExpr){
|
||||
struct WindowRewrite *p = pWalker->u.pRewrite;
|
||||
Parse *pParse = pWalker->pParse;
|
||||
|
||||
/* If this function is being called from within a scalar sub-select
|
||||
** that used by the SELECT statement being processed, only process
|
||||
** TK_COLUMN expressions that refer to it (the outer SELECT). Do
|
||||
** not process aggregates or window functions at all, as they belong
|
||||
** to the scalar sub-select. */
|
||||
if( p->pSubSelect ){
|
||||
if( pExpr->op!=TK_COLUMN ){
|
||||
return WRC_Continue;
|
||||
}else{
|
||||
int nSrc = p->pSrc->nSrc;
|
||||
int i;
|
||||
for(i=0; i<nSrc; i++){
|
||||
if( pExpr->iTable==p->pSrc->a[i].iCursor ) break;
|
||||
}
|
||||
if( i==nSrc ) return WRC_Continue;
|
||||
}
|
||||
}
|
||||
|
||||
switch( pExpr->op ){
|
||||
|
||||
case TK_FUNCTION:
|
||||
@@ -643,8 +663,15 @@ static int selectWindowRewriteExprCb(Walker *pWalker, Expr *pExpr){
|
||||
return WRC_Continue;
|
||||
}
|
||||
static int selectWindowRewriteSelectCb(Walker *pWalker, Select *pSelect){
|
||||
UNUSED_PARAMETER(pWalker);
|
||||
UNUSED_PARAMETER(pSelect);
|
||||
struct WindowRewrite *p = pWalker->u.pRewrite;
|
||||
Select *pSave = p->pSubSelect;
|
||||
if( pSave==pSelect ){
|
||||
return WRC_Continue;
|
||||
}else{
|
||||
p->pSubSelect = pSelect;
|
||||
sqlite3WalkSelect(pWalker, pSelect);
|
||||
p->pSubSelect = pSave;
|
||||
}
|
||||
return WRC_Prune;
|
||||
}
|
||||
|
||||
@@ -655,7 +682,7 @@ static int selectWindowRewriteSelectCb(Walker *pWalker, Select *pSelect){
|
||||
** * TK_COLUMN,
|
||||
** * aggregate function, or
|
||||
** * window function with a Window object that is not a member of the
|
||||
** linked list passed as the second argument (pWin)
|
||||
** Window list passed as the second argument (pWin).
|
||||
**
|
||||
** Append the node to output expression-list (*ppSub). And replace it
|
||||
** with a TK_COLUMN that reads the (N-1)th element of table
|
||||
@@ -665,6 +692,7 @@ static int selectWindowRewriteSelectCb(Walker *pWalker, Select *pSelect){
|
||||
static void selectWindowRewriteEList(
|
||||
Parse *pParse,
|
||||
Window *pWin,
|
||||
SrcList *pSrc,
|
||||
ExprList *pEList, /* Rewrite expressions in this list */
|
||||
ExprList **ppSub /* IN/OUT: Sub-select expression-list */
|
||||
){
|
||||
@@ -676,6 +704,7 @@ static void selectWindowRewriteEList(
|
||||
|
||||
sRewrite.pSub = *ppSub;
|
||||
sRewrite.pWin = pWin;
|
||||
sRewrite.pSrc = pSrc;
|
||||
|
||||
sWalker.pParse = pParse;
|
||||
sWalker.xExprCallback = selectWindowRewriteExprCb;
|
||||
@@ -753,8 +782,8 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
|
||||
** many columns the table will have. */
|
||||
pMWin->iEphCsr = pParse->nTab++;
|
||||
|
||||
selectWindowRewriteEList(pParse, pMWin, p->pEList, &pSublist);
|
||||
selectWindowRewriteEList(pParse, pMWin, p->pOrderBy, &pSublist);
|
||||
selectWindowRewriteEList(pParse, pMWin, pSrc, p->pEList, &pSublist);
|
||||
selectWindowRewriteEList(pParse, pMWin, pSrc, p->pOrderBy, &pSublist);
|
||||
pMWin->nBufferCol = (pSublist ? pSublist->nExpr : 0);
|
||||
|
||||
/* Append the PARTITION BY and ORDER BY expressions to the to the
|
||||
@@ -1038,9 +1067,9 @@ static void windowCheckIntValue(Parse *pParse, int reg, int eCond){
|
||||
VdbeCoverageIf(v, eCond==1);
|
||||
VdbeCoverageIf(v, eCond==2);
|
||||
sqlite3VdbeAddOp3(v, aOp[eCond], regZero, sqlite3VdbeCurrentAddr(v)+2, reg);
|
||||
VdbeCoverageIf(v, eCond==0);
|
||||
VdbeCoverageIf(v, eCond==1);
|
||||
VdbeCoverageIf(v, eCond==2);
|
||||
VdbeCoverageNeverNullIf(v, eCond==0);
|
||||
VdbeCoverageNeverNullIf(v, eCond==1);
|
||||
VdbeCoverageNeverNullIf(v, eCond==2);
|
||||
sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_ERROR, OE_Abort);
|
||||
sqlite3VdbeAppendP4(v, (void*)azErr[eCond], P4_STATIC);
|
||||
sqlite3ReleaseTempReg(pParse, regZero);
|
||||
@@ -1120,7 +1149,7 @@ static void windowAggStep(
|
||||
sqlite3VdbeAddOp2(v, OP_IdxInsert, pWin->csrApp, pWin->regApp+2);
|
||||
}else{
|
||||
sqlite3VdbeAddOp4Int(v, OP_SeekGE, pWin->csrApp, 0, regArg, 1);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageNeverTaken(v);
|
||||
sqlite3VdbeAddOp1(v, OP_Delete, pWin->csrApp);
|
||||
sqlite3VdbeJumpHere(v, sqlite3VdbeCurrentAddr(v)-2);
|
||||
}
|
||||
@@ -1232,8 +1261,8 @@ static void windowPartitionCache(
|
||||
*pRegSize = regRowid;
|
||||
pParse->nMem += nSub + 2;
|
||||
|
||||
/* Martial the row returned by the sub-select into an array of
|
||||
** registers. */
|
||||
/* Load the column values for the row returned by the sub-select
|
||||
** into an array of registers starting at reg. */
|
||||
for(k=0; k<nSub; k++){
|
||||
sqlite3VdbeAddOp3(v, OP_Column, iSubCsr, k, reg+k);
|
||||
}
|
||||
@@ -1251,7 +1280,7 @@ static void windowPartitionCache(
|
||||
addr = sqlite3VdbeAddOp3(v, OP_Compare, regNewPart, pMWin->regPart,nPart);
|
||||
sqlite3VdbeAppendP4(v, (void*)pKeyInfo, P4_KEYINFO);
|
||||
sqlite3VdbeAddOp3(v, OP_Jump, addr+2, addr+4, addr+2);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageEqNe(v);
|
||||
sqlite3VdbeAddOp3(v, OP_Copy, regNewPart, pMWin->regPart, nPart-1);
|
||||
sqlite3VdbeAddOp2(v, OP_Gosub, regFlushPart, lblFlushPart);
|
||||
VdbeComment((v, "call flush_partition"));
|
||||
@@ -1308,9 +1337,9 @@ static void windowReturnOneRow(
|
||||
}
|
||||
sqlite3VdbeAddOp3(v, OP_Add, tmpReg, pWin->regApp, tmpReg);
|
||||
sqlite3VdbeAddOp3(v, OP_Gt, pWin->regApp+1, lbl, tmpReg);
|
||||
VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp3(v, OP_SeekRowid, csr, lbl, tmpReg);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageNeverNull(v);
|
||||
sqlite3VdbeAddOp3(v, OP_SeekRowid, csr, 0, tmpReg);
|
||||
VdbeCoverageNeverTaken(v);
|
||||
sqlite3VdbeAddOp3(v, OP_Column, csr, pWin->iArgCol, pWin->regResult);
|
||||
sqlite3VdbeResolveLabel(v, lbl);
|
||||
sqlite3ReleaseTempReg(pParse, tmpReg);
|
||||
@@ -1621,7 +1650,7 @@ static void windowCodeRowExprStep(
|
||||
assert( pMWin->pStart!=0 );
|
||||
assert( pMWin->eEnd==TK_FOLLOWING );
|
||||
sqlite3VdbeAddOp3(v, OP_Ge, regStart, sqlite3VdbeCurrentAddr(v)+2, regEnd);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageNeverNull(v);
|
||||
sqlite3VdbeAddOp2(v, OP_Copy, regSize, regStart);
|
||||
sqlite3VdbeAddOp3(v, OP_Subtract, regStart, regEnd, regEnd);
|
||||
}
|
||||
@@ -1630,7 +1659,7 @@ static void windowCodeRowExprStep(
|
||||
assert( pMWin->pEnd!=0 );
|
||||
assert( pMWin->eStart==TK_PRECEDING );
|
||||
sqlite3VdbeAddOp3(v, OP_Le, regStart, sqlite3VdbeCurrentAddr(v)+3, regEnd);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageNeverNull(v);
|
||||
sqlite3VdbeAddOp2(v, OP_Copy, regSize, regStart);
|
||||
sqlite3VdbeAddOp2(v, OP_Copy, regSize, regEnd);
|
||||
}
|
||||
@@ -1702,7 +1731,7 @@ static void windowCodeRowExprStep(
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, lblSkipInverse);
|
||||
}else{
|
||||
sqlite3VdbeAddOp2(v, OP_Next, csrStart, sqlite3VdbeCurrentAddr(v)+1);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageAlwaysTaken(v);
|
||||
}
|
||||
windowAggStep(pParse, pMWin, csrStart, 1, regArg, regSize);
|
||||
sqlite3VdbeResolveLabel(v, lblSkipInverse);
|
||||
@@ -2005,8 +2034,8 @@ static void windowCodeDefaultStep(
|
||||
|
||||
pParse->nMem += nSub + 2;
|
||||
|
||||
/* Martial the row returned by the sub-select into an array of
|
||||
** registers. */
|
||||
/* Load the individual column values of the row returned by
|
||||
** the sub-select into an array of registers. */
|
||||
for(k=0; k<nSub; k++){
|
||||
sqlite3VdbeAddOp3(v, OP_Column, iSubCsr, k, reg+k);
|
||||
}
|
||||
@@ -2024,7 +2053,7 @@ static void windowCodeDefaultStep(
|
||||
addr = sqlite3VdbeAddOp3(v, OP_Compare, regNewPart, pMWin->regPart,nPart);
|
||||
sqlite3VdbeAppendP4(v, (void*)pKeyInfo, P4_KEYINFO);
|
||||
addrJump = sqlite3VdbeAddOp3(v, OP_Jump, addr+2, 0, addr+2);
|
||||
VdbeCoverage(v);
|
||||
VdbeCoverageEqNe(v);
|
||||
windowAggFinal(pParse, pMWin, 1);
|
||||
if( pOrderBy ){
|
||||
addrGoto = sqlite3VdbeAddOp0(v, OP_Goto);
|
||||
@@ -2183,6 +2212,7 @@ void sqlite3WindowCodeStep(
|
||||
if( pMWin->eType==TK_ROWS
|
||||
&& (pMWin->eStart!=TK_UNBOUNDED||pMWin->eEnd!=TK_CURRENT||!pMWin->pOrderBy)
|
||||
){
|
||||
VdbeModuleComment((pParse->pVdbe, "Begin RowExprStep()"));
|
||||
windowCodeRowExprStep(pParse, p, pWInfo, regGosub, addrGosub);
|
||||
}else{
|
||||
Window *pWin;
|
||||
@@ -2207,8 +2237,10 @@ void sqlite3WindowCodeStep(
|
||||
|
||||
/* Otherwise, call windowCodeDefaultStep(). */
|
||||
if( bCache ){
|
||||
VdbeModuleComment((pParse->pVdbe, "Begin CacheStep()"));
|
||||
windowCodeCacheStep(pParse, p, pWInfo, regGosub, addrGosub);
|
||||
}else{
|
||||
VdbeModuleComment((pParse->pVdbe, "Begin DefaultStep()"));
|
||||
windowCodeDefaultStep(pParse, p, pWInfo, regGosub, addrGosub);
|
||||
}
|
||||
}
|
||||
|
||||
+18
-9
@@ -71,7 +71,8 @@ proc execsql_test {tn sql} {
|
||||
# with two decimal points.
|
||||
#
|
||||
proc execsql_float_test {tn sql} {
|
||||
set F "%.2f"
|
||||
set F "%.4f"
|
||||
set T 0.0001
|
||||
set res [execsql $sql]
|
||||
set res2 [list]
|
||||
foreach r $res {
|
||||
@@ -79,14 +80,22 @@ proc execsql_float_test {tn sql} {
|
||||
lappend res2 $r
|
||||
}
|
||||
|
||||
puts $::fd "do_test $tn {"
|
||||
puts $::fd " set myres {}"
|
||||
puts $::fd " foreach r \[db eval {[string trim $sql]}\] {"
|
||||
puts $::fd " lappend myres \[format $F \[set r\]\]"
|
||||
puts $::fd " }"
|
||||
puts $::fd " set myres"
|
||||
puts $::fd "} {$res2}"
|
||||
puts $::fd ""
|
||||
set sql [string trim $sql]
|
||||
puts $::fd [subst -nocommands {
|
||||
do_test $tn {
|
||||
set myres {}
|
||||
foreach r [db eval {$sql}] {
|
||||
lappend myres [format $F [set r]]
|
||||
}
|
||||
set res2 {$res2}
|
||||
foreach r [set myres] r2 [set res2] {
|
||||
if {[set r]<([set r2]-$T) || [set r]>([set r2]+$T)} {
|
||||
error "list element [set i] does not match: got=[set r] expected=[set r2]"
|
||||
}
|
||||
}
|
||||
set {} {}
|
||||
} {}
|
||||
}]
|
||||
}
|
||||
|
||||
proc start_test {name date} {
|
||||
|
||||
@@ -176,5 +176,36 @@ do_test 500 {
|
||||
} {0 {1 8192 wal ok}}
|
||||
db2 close
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
sqlite3 db2 test.db
|
||||
do_execsql_test 600 {
|
||||
PRAGMA journal_mode = wal;
|
||||
CREATE TABLE t1(a);
|
||||
INSERT INTO t1 VALUES(1), (2), (3), (4);
|
||||
} {wal}
|
||||
|
||||
do_execsql_test -db db2 610 {
|
||||
SELECT * FROM t1
|
||||
} {1 2 3 4}
|
||||
|
||||
do_test 620 {
|
||||
set res [list]
|
||||
db2 eval {SELECT a FROM t1} {
|
||||
lappend res $a
|
||||
if {$a==3} {
|
||||
sqlite3_db_config db RESET_DB 1
|
||||
db eval VACUUM
|
||||
sqlite3_db_config db RESET_DB 0
|
||||
}
|
||||
}
|
||||
|
||||
set res
|
||||
} {1 2 3 4}
|
||||
|
||||
do_execsql_test -db db2 630 {
|
||||
SELECT * FROM sqlite_master
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
+1
-1
@@ -169,6 +169,6 @@ do_execsql_test selectD-4.1 {
|
||||
WHERE x1.d>5
|
||||
GROUP BY x1.d) AS x2
|
||||
ON t41.b=x2.d;
|
||||
} {/*SEARCH SUBQUERY 0x* AS x2 USING AUTOMATIC*/}
|
||||
} {/*SEARCH SUBQUERY * AS x2 USING AUTOMATIC*/}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -337,4 +337,12 @@ do_execsql_test skipscan1-9.2 {
|
||||
SELECT * FROM t9a WHERE b IN (SELECT x FROM t9b WHERE y!=5);
|
||||
} {/USING INDEX t9a_ab .ANY.a. AND b=./}
|
||||
|
||||
|
||||
optimization_control db skip-scan 0
|
||||
do_execsql_test skipscan1-9.3 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t9a WHERE b IN (SELECT x FROM t9b WHERE y!=5);
|
||||
} {/{SCAN TABLE t9a}/}
|
||||
optimization_control db skip-scan 1
|
||||
|
||||
finish_test
|
||||
|
||||
+3
-1
@@ -974,7 +974,9 @@ proc query_plan_graph {sql} {
|
||||
}
|
||||
set a "\n QUERY PLAN\n"
|
||||
append a [append_graph " " dx cx 0]
|
||||
return [regsub -all { 0x[A-F0-9]+\y} $a { xxxxxx}]
|
||||
regsub -all { 0x[A-F0-9]+\y} $a { xxxxxx} a
|
||||
regsub -all {(MATERIALIZE|CO-ROUTINE|SUBQUERY) \d+\y} $a {\1 xxxxxx} a
|
||||
return $a
|
||||
}
|
||||
|
||||
# Helper routine for [query_plan_graph SQL]:
|
||||
|
||||
@@ -112,4 +112,20 @@ do_execsql_test upsert1-500 {
|
||||
SELECT * FROM t1;
|
||||
} {1 2}
|
||||
|
||||
# 2018-07-11
|
||||
# Ticket https://sqlite.org/src/tktview/79cad5e4b2e219dd197242e9e5f4
|
||||
# UPSERT leads to a corrupt index.
|
||||
#
|
||||
do_execsql_test upsert1-600 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(b UNIQUE, a INT PRIMARY KEY) WITHOUT ROWID;
|
||||
INSERT OR IGNORE INTO t1(a) VALUES('1') ON CONFLICT(a) DO NOTHING;
|
||||
PRAGMA integrity_check;
|
||||
} {ok}
|
||||
do_execsql_test upsert1-610 {
|
||||
DELETE FROM t1;
|
||||
INSERT OR IGNORE INTO t1(a) VALUES('1'),(1) ON CONFLICT(a) DO NOTHING;
|
||||
PRAGMA integrity_check;
|
||||
} {ok}
|
||||
|
||||
finish_test
|
||||
|
||||
+4218
-1957
File diff suppressed because one or more lines are too long
@@ -310,4 +310,30 @@ foreach {tn stmt res} {
|
||||
" $res
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 11.0 {
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES(10),(15),(20),(20),(25),(30),(30),(50);
|
||||
CREATE TABLE t3(x INT, y VARCHAR);
|
||||
INSERT INTO t3(x,y) VALUES(10,'ten'),('15','fifteen'),(30,'thirty');
|
||||
}
|
||||
|
||||
do_execsql_test 11.1 {
|
||||
SELECT a, (SELECT y FROM t3 WHERE x=a) FROM t1 ORDER BY a;
|
||||
} {
|
||||
10 ten 15 fifteen 20 {} 20 {} 25 {} 30 thirty 30 thirty 50 {}
|
||||
}
|
||||
|
||||
do_execsql_test 11.2 {
|
||||
SELECT a, (SELECT y FROM t3 WHERE x=a), sum(a) OVER (ORDER BY a)
|
||||
FROM t1 ORDER BY a;
|
||||
} {
|
||||
10 ten 10 15 fifteen 25 20 {} 65 20 {} 65
|
||||
25 {} 90 30 thirty 150 30 thirty 150 50 {} 200
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user