From a23bc8a345e9030c56808202d290c8ae0e4cbf6c Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 5 Feb 2016 16:46:09 +0000 Subject: [PATCH 01/18] From test scripts, remove stray "breakpoint" commands and blank lines at the ends of files. FossilOrigin-Name: a6b35273239669189f33402144f58328b133d182 --- manifest | 111 +++++++++++++++++++-------------------- manifest.uuid | 2 +- test/analyze9.test | 3 -- test/analyzeB.test | 1 - test/analyzeD.test | 1 - test/cacheflush.test | 1 - test/cffault.test | 1 - test/corruptH.test | 1 - test/corruptI.test | 1 - test/cost.test | 3 -- test/e_blobbytes.test | 2 - test/e_blobclose.test | 1 - test/e_blobopen.test | 1 - test/e_blobwrite.test | 1 - test/e_walckpt.test | 1 - test/fkey8.test | 1 - test/fordelete.test | 1 - test/fts3conf.test | 1 - test/fts3expr4.test | 1 - test/fts3join.test | 2 - test/fts3matchinfo.test | 2 - test/fts3offsets.test | 1 - test/fts3snippet.test | 1 - test/fts4check.test | 1 - test/fts4content.test | 1 - test/fts4growth.test | 1 - test/fts4growth2.test | 1 - test/fts4noti.test | 3 -- test/fts4onepass.test | 1 - test/fuzz3.test | 1 - test/incrcorrupt.test | 1 - test/mallocK.test | 1 - test/mallocL.test | 1 - test/ovfl.test | 2 - test/pragma2.test | 1 - test/rollback2.test | 1 - test/rollbackfault.test | 2 - test/select7.test | 2 - test/shared3.test | 1 - test/snapshot.test | 1 - test/sort3.test | 1 - test/sort5.test | 1 - test/spellfix.test | 1 - test/sqllog.test | 3 -- test/tkt-9f2eb3abac.test | 1 - test/tkt-ba7cbfaedc.test | 2 - test/triggerE.test | 2 - test/vtab_shared.test | 1 - test/wal6.test | 1 - test/waloverwrite.test | 2 - test/whereI.test | 1 - test/withM.test | 3 -- 52 files changed, 56 insertions(+), 126 deletions(-) diff --git a/manifest b/manifest index 8c2dfea1b7..ca42763a5e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\sthe\sway\sout-of-memory\sconditions\sare\shandled,\sresulting\nin\san\salmost\s1%\sperformance\sgain\sin\sthe\scommmon\scase\swhere\sOOM\serrors\sdo\nnot\soccur. -D 2016-02-05T14:11:12.413 +C From\stest\sscripts,\sremove\sstray\s"breakpoint"\scommands\sand\sblank\slines\nat\sthe\sends\sof\sfiles. +D 2016-02-05T16:46:09.824 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 @@ -450,11 +450,11 @@ F test/analyze5.test 765c4e284aa69ca172772aa940946f55629bc8c4 F test/analyze6.test f1c552ce39cca4ec922a7e4e0e5d0203d6b3281f F test/analyze7.test bb1409afc9e8629e414387ef048b8e0e3e0bdc4f F test/analyze8.test c05a461d0a6b05991106467d0c47480f2e709c82 -F test/analyze9.test 3dd9e203fad353ec8027b18a6d9a92af59f4e727 +F test/analyze9.test 88c1f2aa20b614236f03e1cc38c3619e7e8a38b4 F test/analyzeA.test 3335697f6700c7052295cfd0067fc5b2aacddf9a -F test/analyzeB.test 8bf35ee0a548aea831bf56762cb8e7fdb1db083d +F test/analyzeB.test a4c1c3048f6d9e090eb76e83eecb18bcf6d31a70 F test/analyzeC.test 555a6cc388b9818b6eda6df816f01ce0a75d3a93 -F test/analyzeD.test 08f9d0bee4e118a66fff3a32d02dbe0ee0a2b594 +F test/analyzeD.test f3d77cd0fefe2849d784897d52df13beee19271d F test/analyzeE.test 8684e8ac5722fb97c251887ad97e5d496a98af1d F test/analyzeF.test 5d1fe1024ba2dfea3c18bede8c1ccef8aba1ab34 F test/analyzer1.test 498e2ff4b62740c2751c3a2f8b744fe26689fae9 @@ -513,7 +513,7 @@ F test/btree02.test fe69453d474d8154d19b904157ff1db4812fed99 F test/btreefault.test c2bcb542685eea44621275cfedbd8a13f65201e3 F test/busy.test 76b4887f8b9160ba903c1ac22e8ff406ad6ae2f0 F test/cache.test 13bc046b26210471ca6f2889aceb1ea52dc717de -F test/cacheflush.test a755c93482ce2e20c04825304bef27e7b7ea0111 +F test/cacheflush.test af25bb1509df04c1da10e38d8f322d66eceedf61 F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738 F test/capi3.test bf6f0308bbbba1e770dac13aa08e5c2ac61c7324 F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4 @@ -521,7 +521,7 @@ F test/capi3c.test 06f6261f9e9b4ef6f76afcd9900f3665408af1c8 F test/capi3d.test 485048dc5cd07bc68011e4917ad035ad6047ab82 F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe F test/cast.test 4c275cbdc8202d6f9c54a3596701719868ac7dc3 -F test/cffault.test 1647eef45512817265c360ed4539538eed26ac69 +F test/cffault.test aadc1f61f8811cb600e3e069acbf8796f472a096 F test/check.test 5831ddb6f2c687782eaf2e1a07b6e17f24c4f763 F test/close.test 340bd24cc58b16c6bc01967402755027c37eb815 F test/closure01.test b1703ba40639cfc9b295cf478d70739415eec6a4 @@ -558,10 +558,10 @@ F test/corruptD.test b3c205fac7952b1de645ce44bb02335cd9e3e040 F test/corruptE.test be8e5088c369fc7979c662cd644efdaafc0f7f6d F test/corruptF.test be9fde98e4c93648f1ba52b74e5318edc8f59fe4 F test/corruptG.test 1ab3bf97ee7bdba70e0ff3ba2320657df55d1804 -F test/corruptH.test 5dd4fa98c6c1ed33b178f9e8a48c4fdd3cfc9067 -F test/corruptI.test f2b10e4fec2a4315bca2b936ffa52ccbffac3422 +F test/corruptH.test 99ad81a4bda7cc078c589ef7542ecbc64e453c80 +F test/corruptI.test 347babbf970e7947e3f91dccf7a1bec28a1bab04 F test/corruptJ.test 9e29e7a81ee3b6ac50f77ea7a9e2f3fa03f32d91 -F test/cost.test 19d314526616ce4473eb4e4e450fcb94499ce318 +F test/cost.test 1eedbfd868f806f3fa08ff072b04cf270dcf61c8 F test/count.test cb2e0f934c6eb33670044520748d2ecccd46259c F test/coveridxscan.test cdb47d01acc4a634a34fd25abe85189e0d0f1e62 F test/crash.test fb9dc4a02dcba30d4aa5c2c226f98b220b2b959f @@ -592,10 +592,10 @@ F test/descidx3.test 09ddbe3f5295f482d2f8b687cf6db8bad7acd9a2 F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e F test/distinct.test a1783b960ad8c15a77cd9f207be072898db1026c F test/distinctagg.test 1a6ef9c87a58669438fc771450d7a72577417376 -F test/e_blobbytes.test 9bea1d3e2b20f3010b04abba58f6ba172301f49f -F test/e_blobclose.test df756753f571bc30e42e3a6cba2807576e49e716 -F test/e_blobopen.test 234f960d90235a9b51ec3ca1e062e8541dd558d8 -F test/e_blobwrite.test 615b405f29feb2cfb5a1f03dab7933258294fa26 +F test/e_blobbytes.test 439a945953b35cb6948a552edaec4dc31fd70a05 +F test/e_blobclose.test 4b3c8c60c2171164d472059c73e9f3c1844bb66d +F test/e_blobopen.test e95e1d40f995056f6f322cd5e1a1b83a27e1a145 +F test/e_blobwrite.test 650ded42ee5e0c2dbf263583ce01adf280129599 F test/e_changes.test fd66105385153dbf21fdb35eb8ef6c3e1eade579 F test/e_createtable.test d4c6059d44dcd4b636de9aae322766062b471844 F test/e_delete.test ab39084f26ae1f033c940b70ebdbbd523dc4962e @@ -615,7 +615,7 @@ F test/e_uri.test eed3eb41b22d051a1164110dacdc778899126e14 F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9 F test/e_wal.test ae9a593207a77d711443ee69ffe081fda9243625 F test/e_walauto.test 280714ddf14e1a47dcbc59d515cd0b026dfd5567 -F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608 +F test/e_walckpt.test 28c371a6bb5e5fe7f31679c1df1763a19d19e8a0 F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664 F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473 @@ -641,9 +641,9 @@ F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d F test/fkey5.test 5a373303f201ac03c22ba1ef17a733d3f56e611a F test/fkey6.test abb59f866c1b44926fd02d1fdd217d831fe04f48 F test/fkey7.test 72e915890ee4a005daaf3002cb208e8fe973ac13 -F test/fkey8.test 8f08203458321e6c19a263829de4cfc936274ab0 +F test/fkey8.test 7bd1dd0174a0e29a90c62c517b9e2a410a0b345d F test/fkey_malloc.test 594a7ea1fbab553c036c70813cd8bd9407d63749 -F test/fordelete.test 57ed9b953eeace09dd2eac3251b40bf9d6990aec +F test/fordelete.test eb93a2f34137bb87bdab88fcab06c0bd92719aff F test/format4.test 1f0cac8ff3895e9359ed87e41aaabee982a812eb F test/fts-9fd058691.test 78b887e30ae6816df0e1fed6259de4b5a64ad33c F test/fts1a.test 46090311f85da51bb33bd5ce84f7948359c6d8d7 @@ -704,7 +704,7 @@ F test/fts3aux2.test 7ae2b2c13aefdf4169279a27a5f51780ce57f6ba F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984 F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958 F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c -F test/fts3conf.test ff90127b2462c788348c0dd7f6f8c573ef9cb5d9 +F test/fts3conf.test 1c8b8adb0ab28a41b68d1514df44380bd7353402 F test/fts3corrupt.test 2710b77983cc7789295ddbffea52c1d3b7506dbb F test/fts3corrupt2.test 6d96efae2f8a6af3eeaf283aba437e6d0e5447ba F test/fts3cov.test e0fb00d8b715ddae4a94c305992dfc3ef70353d7 @@ -717,40 +717,40 @@ F test/fts3e.test 1f6c6ac9cc8b772ca256e6b22aaeed50c9350851 F test/fts3expr.test 3401d47b229c4504424caf362cc4ff704cad4162 F test/fts3expr2.test 18da930352e5693eaa163a3eacf96233b7290d1a F test/fts3expr3.test c4d4a7d6327418428c96e0a3a1137c251b8dfbf8 -F test/fts3expr4.test e1be1248566f43c252d4404d52914f1fc4bfa065 +F test/fts3expr4.test c39a15d676b14fc439d9bf845aa7bddcf4a74dc3 F test/fts3expr5.test f9abfffbf5e53d48a33e12a1e8f8ba2c551c9b49 F test/fts3fault.test da49627b280b210ebc6657f76344c7851f10ce66 F test/fts3fault2.test f953bb3cf903988172270a9a0aafd5a890b0f98f F test/fts3first.test dbdedd20914c8d539aa3206c9b34a23775644641 -F test/fts3join.test 53e66a0c21eb568580674a43b21c059acb26f499 +F test/fts3join.test 34750f3ce1e29b2749eaf0f1be2fa6301c5d50da F test/fts3malloc.test b0e4c133b8d61d4f6d112d8110f8320e9e453ef6 -F test/fts3matchinfo.test 07009313ad6c082f94d8c9c3228eb8940c93ac71 +F test/fts3matchinfo.test ce864e0bd92429df8008f31cf557269ba172482a F test/fts3near.test 7e3354d46f155a822b59c0e957fd2a70c1d7e905 -F test/fts3offsets.test 5b8ec5be27dd2070af3538b23c67f1ca8c822853 +F test/fts3offsets.test b85fd382abdc78ebce721d8117bd552dfb75094c F test/fts3prefix.test fa794eaab0bdae466494947b0b153d7844478ab2 F test/fts3prefix2.test e1f0a822ca661dced7f12ce392e14eaf65609dce F test/fts3query.test f33eb71a1fe1084ea585eeb7ee76b390729f5170 F test/fts3rnd.test 1320d8826a845e38a96e769562bf83d7a92a15d0 F test/fts3shared.test 57e26a801f21027b7530da77db54286a6fe4997e -F test/fts3snippet.test 63dbd687d5bf5191f1b8e6a0977aa9c1e28a7004 +F test/fts3snippet.test 01a4231816e03a0660ae53ba2404fe69012fe0db F test/fts3sort.test ed34c716a11cc2009a35210e84ad5f9c102362ca F test/fts3tok1.test 178c050199af8c05299b1ad572514ce1c54b7827 F test/fts3tok_err.test 52273cd193b9036282f7bacb43da78c6be87418d F test/fts3varint.test 752c08ed5d32c5d7dc211b056f4ed68a76b7e36e F test/fts4aa.test 10aac8e9d62c7357590acfabe3fad01e9a9ce1cb -F test/fts4check.test 9d9e818fd6cb29c0e007cd6d00447739d4fde430 -F test/fts4content.test 8707425b926663f8ca81de866c007900442b5ec0 +F test/fts4check.test c3056eab9524232e4c9bdcd119912947e07bcc1c +F test/fts4content.test 05716af19a899cd70d5cd916c580043c03f30db4 F test/fts4docid.test e33c383cfbdff0284685604d256f347a18fdbf01 -F test/fts4growth.test df10fde9f47cf5c71861e63fd8efcd573c4f7e53 -F test/fts4growth2.test 2f063be1902a73cd087355837c52fed42ac11a5d +F test/fts4growth.test 60d6bb3f78e25b34f533797dd9f2f9402310a13a +F test/fts4growth2.test 13ad4e76451af6e6906c95cdc725d01b00044269 F test/fts4incr.test 4e353a0bd886ea984e56fce9e77724fc923b8d0d F test/fts4langid.test 24a6e41063b416bbdf371ff6b4476fa41c194aa7 F test/fts4merge.test c424309743fdd203f8e56a1f1cd7872cd66cc0ee F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891 F test/fts4merge3.test aab02a09f50fe6baaddc2e159c3eabc116d45fc7 F test/fts4merge4.test d895b1057a7798b67e03455d0fa50e9ea836c47b -F test/fts4noti.test 524807f0c36d49deea7920cdd4cd687408b58849 -F test/fts4onepass.test bfca61f69c6ca74cd71e6dca12a0cdd47192fc24 +F test/fts4noti.test 5553d7bb2e20bf4a06b23e849352efc022ce6309 +F test/fts4onepass.test 7319d61a2ed1325fc54afd0c060a0513b462303a F test/fts4unicode.test 27378af76394542cf490cf001d8d1505fe55f6a9 F test/full.test 6b3c8fb43c6beab6b95438c1675374b95fab245d F test/func.test ae97561957aba6ca9e3a7b8a13aac41830d701ef @@ -761,7 +761,7 @@ F test/func5.test cdd224400bc3e48d891827cc913a57051a426fa4 F test/fuzz-oss1.test 4912e528ec9cf2f42134456933659d371c9e0d74 F test/fuzz.test 96083052bf5765e4518c1ba686ce2bab785670d1 F test/fuzz2.test 76dc35b32b6d6f965259508508abce75a6c4d7e1 -F test/fuzz3.test 53fabcd5f0f430f8b221282f6c12c4d0903c21eb +F test/fuzz3.test b47377143f0c80f91ed29d722861077ff34415d5 F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b F test/fuzz_malloc.test 328f70aaca63adf29b4c6f06505ed0cf57ca7c26 F test/fuzzcheck.c 3309d793165ca61a9996271cb799694839348f9a @@ -790,7 +790,7 @@ F test/incrblob3.test d8d036fde015d4a159cd3cbae9d29003b37227a4 F test/incrblob4.test f26502a5697893e5acea268c910f16478c2f0fab F test/incrblob_err.test af1f12ba60d220c9752073ff2bda2ad59e88960d F test/incrblobfault.test 280474078f6da9e732cd2a215d3d854969014b6e -F test/incrcorrupt.test 9786cba68c5832f01887fde1c06b43c3904d86f6 +F test/incrcorrupt.test 6c567fbf870aa9e91866fe52ce6f200cd548939a F test/incrvacuum.test d2a6ddf5e429720b5fe502766af747915ccf6c32 F test/incrvacuum2.test 676c41428765d58f1da7dbe659ef27726d3d30ac F test/incrvacuum3.test 75256fb1377e7c39ef2de62bfc42bbff67be295a @@ -876,8 +876,8 @@ F test/mallocG.test 0ff91b65c50bdaba680fb75d87fe4ad35bb7934f F test/mallocH.test 79b65aed612c9b3ed2dcdaa727c85895fd1bfbdb F test/mallocI.test a88c2b9627c8506bf4703d8397420043a786cdb6 F test/mallocJ.test b5d1839da331d96223e5f458856f8ffe1366f62e -F test/mallocK.test da01dcdd316767b8356741f8d33a23a06a23def5 -F test/mallocL.test 252ddc7eb4fbf75364eab17b938816085ff1fc17 +F test/mallocK.test 27cb5566a6e5f2d76f9d4aa2eca45524401fd61e +F test/mallocL.test fb311ff80afddf3b1a75e52289081f4754d901dc F test/malloc_common.tcl aac62499b76be719fac31e7a3e54a7fd53272e7f F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f @@ -930,7 +930,7 @@ F test/orderby7.test 3d1383d52ade5b9eb3a173b3147fdd296f0202da F test/orderby8.test 23ef1a5d72bd3adcc2f65561c654295d1b8047bd F test/orderby9.test 87fb9548debcc2cd141c5299002dd94672fa76a3 F test/oserror.test b32dc34f2363ef18532e3a0a7358e3e7e321974f -F test/ovfl.test 4f7ca651cba5c059a12d8c67dddd49bec5747799 +F test/ovfl.test 199c482696defceacee8c8e0e0ef36da62726b2f F test/pager1.test 1acbdb14c5952a72dd43129cabdbf69aaa3ed1fa F test/pager2.test 67b8f40ae98112bcdba1f2b2d03ea83266418c71 F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f @@ -946,7 +946,7 @@ F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff F test/permutations.test 382a43c49f49bafe6fddffe904ea33d6bb3ff33e F test/pragma.test 507ac7ef2ea5682241ea0ef041799ca70bb5e0bf -F test/pragma2.test a9400a7289605280576098b97f5cde3f204075c0 +F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c F test/printf.test b3ff34e73d59124140eaf89f7672e21bc2ca5fcc F test/printf2.test 0b61566dd1c0f0b802f59dffa228c5dc5aa6b054 @@ -967,8 +967,8 @@ F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 F test/releasetest.tcl 975449bf742b8bb9025208292208af816a1fcb58 F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea -F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 -F test/rollbackfault.test 6a004f71087cc399296cffbb5429ea6da655ae65 +F test/rollback2.test 8435d6ff0f13f51d2a4181c232e706005fa90fc5 +F test/rollbackfault.test 0e646aeab8840c399cfbfa43daab46fd609cf04a F test/rowallock.test 3f88ec6819489d0b2341c7a7528ae17c053ab7cc F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81 F test/rowid.test 5b7509f384f4f6fae1af3c8c104c8ca299fea18d @@ -995,7 +995,7 @@ F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054 F test/select4.test 6d5bc6d178a367e8b48fa1c1d3ea12cae9c2d650 F test/select5.test e758b8ef94f69b111df4cb819008856655dcd535 F test/select6.test 39eac4a5c03650b2b473c532882273283ee8b7a0 -F test/select7.test 71f06cd37cb6f65bb08ba1ccf8e2f5818c09329f +F test/select7.test 95e370c42d47c3c52377d05e9ffc01ccff7c1f61 F test/select8.test 8c8f5ae43894c891efc5755ed905467d1d67ad5d F test/select9.test aebc2bb0c3bc44606125033cbcaac2c8d1f33a95 F test/selectA.test e452bdb975f488ea46d091382a9185b5853ed2c7 @@ -1008,7 +1008,7 @@ F test/selectG.test e8600e379589e85e9fefd2fe4d44a4cdd63f6982 F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118 F test/shared.test 1da9dbad400cee0d93f252ccf76e1ae007a63746 F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879 -F test/shared3.test fcd65cb11d189eff5f5c85cc4fad246fb0933108 +F test/shared3.test ab693f9b6e156b8bfb2a0ad94f29fe69602a5d38 F test/shared4.test c75f476804e76e26bf6fa0e7b421fb0ca7d07558 F test/shared6.test 866bb4982c45ce216c61ded5e8fde4e7e2f3ffa9 F test/shared7.test a81e99f83e6c51b02ac99c96fb3a2a7b5978c956 @@ -1032,15 +1032,15 @@ F test/skipscan2.test d1d1450952b7275f0b0a3a981f0230532743951a F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5 F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2 F test/skipscan6.test 5866039d03a56f5bd0b3d172a012074a1d90a15b -F test/snapshot.test efc6b4edc5d571161835f9dd8552e181ad1f0ac2 +F test/snapshot.test 5ec4651d16c3d1eb6c010d102febe32b3614bf56 F test/snapshot_fault.test 25973aeb1b86a280800e0bcf1eb5ce70e9ef57ab F test/soak.test 0b5b6375c9f4110c828070b826b3b4b0bb65cd5f F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087 F test/sort.test c2adc635c2564241fefec0b3a68391ef6868fd3b F test/sort2.test cc23b7c19d684657559e8a55b02f7fcee03851d0 -F test/sort3.test 1d831e95076b92985754a122e92ebc23bdf6f712 +F test/sort3.test 1480ed7c4c157682542224e05e3b75faf4a149e5 F test/sort4.test 5c34d9623a4ae5921d956dfa2b70e77ed0fc6e5c -F test/sort5.test a448240a42b49239edc00f85d6d7ac7a1b261e1f +F test/sort5.test d3041ce3c475aa04142a959ae56ef6593f98a99f F test/sortfault.test d4ccf606a0c77498e2beb542764fd9394acb4d66 F test/speed1.test f2974a91d79f58507ada01864c0e323093065452 F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb @@ -1051,12 +1051,12 @@ F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b F test/speedtest1.c f8bf04214e7b5f745feea99f7bde68b1c4870666 -F test/spellfix.test 0597065ff57042df1f138e6a2611ae19c2698135 +F test/spellfix.test f9c1f431e2c096c8775fec032952320c0e4700db F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix3.test f7bf7b3482971473d32b6b00f6944c5c066cff97 F test/sqldiff1.test 8f6bc7c6a5b3585d350d779c6078869ba402f8f5 F test/sqllimits1.test a74ee2a3740b9f9c2437c246d8fb77354862a142 -F test/sqllog.test a8faa2df39610a037dd372ed872d124260d32953 +F test/sqllog.test 6af6cb0b09f4e44e1917e06ce85be7670302517a F test/stat.test acc91e80517fff447ae8adcfd953cfdaa5efc0af F test/statfault.test f525a7bf633e50afd027700e9a486090684b1ac1 F test/stmt.test 25d64e3dbf9a3ce89558667d7f39d966fe2a71b9 @@ -1125,14 +1125,14 @@ F test/tkt-91e2e8ba6f.test 08c4f94ae07696b05c9b822da0b4e5337a2f54c5 F test/tkt-94c04eaadb.test f738c57c7f68ab8be1c054415af7774617cb6223 F test/tkt-9a8b09f8e6.test b2ef151d0984b2ebf237760dbeaa50724e5a0667 F test/tkt-9d68c883.test 458f7d82a523d7644b54b497c986378a7d8c8b67 -F test/tkt-9f2eb3abac.test 85bc63e749f050e6a61c8f9207f1eee65c9d3395 +F test/tkt-9f2eb3abac.test cb6123ac695a08b4454c3792fbe85108f67fabf8 F test/tkt-a7b7803e.test 159ef554234fa1f9fb318c751b284bd1cf858da4 F test/tkt-a8a0d2996a.test eb597379dbcefa24765763d7f682c00cb5924fa9 F test/tkt-b1d3a2e531.test 8f7576e41ca179289ee1a8fee28386fd8e4b0550 F test/tkt-b351d95f9.test d14a503c414c5c58fdde3e80f9a3cfef986498c0 F test/tkt-b72787b1.test a95e8cdad0b98af1853ac7f0afd4ab27b77bf5f3 F test/tkt-b75a9ca6b0.test 97cc2d5eeaf82799eb42138c0a1ff64370238ce4 -F test/tkt-ba7cbfaedc.test e76d88e572e489ee0d64fe4caf4af18b3d1dc688 +F test/tkt-ba7cbfaedc.test b4c0deccc12aeb55cfdb57935b16b5d67c5a9877 F test/tkt-bd484a090c.test 60460bf946f79a79712b71f202eda501ca99b898 F test/tkt-bdc6bbbb38.test fc38bb09bdd440e3513a1f5f98fc60a075182d7d F test/tkt-c48d99d690.test ba61977d62ab612fc515b3c488a6fbd6464a2447 @@ -1252,7 +1252,7 @@ F test/triggerA.test fe5597f47ee21bacb4936dc827994ed94161e332 F test/triggerB.test 56780c031b454abac2340dbb3b71ac5c56c3d7fe F test/triggerC.test 302d8995f5ffe63bbc15053abb3ef7a39cf5a092 F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650 -F test/triggerE.test 355e9c5cbaed5cd039a60baad1fb2197caeb8e52 +F test/triggerE.test 15fa63f1097db1f83dd62d121616006978063d1f F test/tt3_checkpoint.c 9e75cf7c1c364f52e1c47fd0f14c4340a9db0fe1 F test/tt3_index.c 39eec10a35f57672225be4d182862152896dee4a F test/tt3_lookaside1.c 0377e202c3c2a50d688cb65ba203afeda6fafeb9 @@ -1295,13 +1295,13 @@ F test/vtabH.test 5f5157a1501d9889ec35c1a1832f69612dd31444 F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8 -F test/vtab_shared.test ea8778d5b0df200adef2ca7c00c3c37d4375f772 +F test/vtab_shared.test 5253bff2355a9a3f014c15337da7e177ab0ef8ad F test/wal.test 0148c8b3421a25fdb4d9c160e84a681d0646371b F test/wal2.test 1f841d2048080d32f552942e333fd99ce541dada F test/wal3.test 5dd734147f1f8f958c5261a1f2775d346d7013ce F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c F test/wal5.test 88b5d9a6a3d1532497ee9f4296f010d66f07e33c -F test/wal6.test 4421cd5a2fa99d29cc91ef12fb23bed171ed3a4c +F test/wal6.test a9d6aa635b9d63607dabdc11406f5f96ca986635 F test/wal64k.test 163655ecd2cb8afef4737cac2a40fdd2eeaf20b8 F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd F test/wal8.test 75c42e1bc4545c277fed212f8fc9b7723cd02216 @@ -1318,7 +1318,7 @@ F test/walfault.test 1f8389f7709877e9b4cc679033d71d6fe529056b F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483 F test/walmode.test 4022fe03ae6e830583672caa101f046438a0473c F test/walnoshm.test 84ca10c544632a756467336b7c3b864d493ee496 -F test/waloverwrite.test a0d2ae0783187374c1e6a9571e0916152977cb81 +F test/waloverwrite.test dad2f26567f1b45174e54fbf9a8dc1cb876a7f03 F test/walpersist.test 8c6b7e3ec1ba91b5e4dc4e0921d6d3f87cd356a6 F test/walprotocol.test 059cb75484a1ecf6357a2c1b3324b8156749221e F test/walro.test 34422d1d95aaff0388f0791ec20edb34e2a3ed57 @@ -1342,7 +1342,7 @@ F test/whereE.test b3a055eef928c992b0a33198a7b8dc10eea5ad2f F test/whereF.test 5b2ba0dbe8074aa13e416b37c753991f0a2492d7 F test/whereG.test dde4c52a97385a55be6a7cd46be8373f0cf35501 F test/whereH.test e4b07f7a3c2f5d31195cd33710054c78667573b2 -F test/whereI.test 1d89199697919d4930be05a71e7fe620f114e622 +F test/whereI.test eab5b226bbc344ac70d7dc09b963a064860ae6d7 F test/whereJ.test 55a3221706a7ab706293f17cc8f96da563bf0767 F test/whereK.test f8e3cf26a8513ecc7f514f54df9f0572c046c42b F test/wherefault.test 1374c3aa198388925246475f84ad4cd5f9528864 @@ -1354,7 +1354,7 @@ F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d F test/with1.test cef099a491eac9874f2c28bd2dc86394fb3e47b3 F test/with2.test 2b40da883658eb74ad8ad06afabe11a408e7fb87 F test/with3.test 511bacdbe41c49cf34f9fd1bd3245fe1575bca98 -F test/withM.test e97f2a8c506ab3ea9eab94e6f6072f6cc924c991 +F test/withM.test 693b61765f2b387b5e3e24a4536e2e82de15ff64 F test/without_rowid1.test 1a7b9bd51b899928d327052df9741d2fe8dbe701 F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99 F test/without_rowid3.test aad4f9d383e199349b6c7e508a778f7dff5dff79 @@ -1426,8 +1426,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 fe123ab4f17f97ba9d64a7e0589ac47fd9d43877 0a802e96ab06e2643834b83671fa8353da1a348d -R 3749c59fe6fdfc59db76e85b115f2d1f -T +closed 0a802e96ab06e2643834b83671fa8353da1a348d +P b082538da774ac77f284fd7e22f9b1b9c2abc343 +R 2d1b67b182c9e99ebe80d7af9546dd2d U drh -Z 89e3d20f1d49685c430d339bf1d58063 +Z 796cfacaa9509982f1af1b696a2e58d2 diff --git a/manifest.uuid b/manifest.uuid index 96f1ef1f1f..e7a723dfc9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b082538da774ac77f284fd7e22f9b1b9c2abc343 \ No newline at end of file +a6b35273239669189f33402144f58328b133d182 \ No newline at end of file diff --git a/test/analyze9.test b/test/analyze9.test index 1ebd69c8d1..e24f3dd49d 100644 --- a/test/analyze9.test +++ b/test/analyze9.test @@ -1244,6 +1244,3 @@ do_eqp_test 26.2.2 { finish_test - - - diff --git a/test/analyzeB.test b/test/analyzeB.test index 2a78c18b3d..e91e7d585e 100644 --- a/test/analyzeB.test +++ b/test/analyzeB.test @@ -680,4 +680,3 @@ for {set i 0} {$i<16} {incr i} { } finish_test - diff --git a/test/analyzeD.test b/test/analyzeD.test index 4d46be6c64..7ef1094f82 100644 --- a/test/analyzeD.test +++ b/test/analyzeD.test @@ -114,4 +114,3 @@ do_eqp_test 1.8 { } finish_test - diff --git a/test/cacheflush.test b/test/cacheflush.test index 007ee8a065..50461893ef 100644 --- a/test/cacheflush.test +++ b/test/cacheflush.test @@ -321,4 +321,3 @@ do_test 4.5 { test_restore_config_pagecache finish_test - diff --git a/test/cffault.test b/test/cffault.test index a89477b617..79cefd24c4 100644 --- a/test/cffault.test +++ b/test/cffault.test @@ -156,4 +156,3 @@ do_faultsim_test 2.4 -prep { } finish_test - diff --git a/test/corruptH.test b/test/corruptH.test index 5c83cb3b90..0e1a1d4429 100644 --- a/test/corruptH.test +++ b/test/corruptH.test @@ -174,4 +174,3 @@ do_test 3.3 { } {1 {database disk image is malformed}} finish_test - diff --git a/test/corruptI.test b/test/corruptI.test index 64323d9608..9f46efb744 100644 --- a/test/corruptI.test +++ b/test/corruptI.test @@ -206,7 +206,6 @@ do_test 6.1 { db close hexio_write test.db 616 8FFFFFFF7F02 sqlite3 db test.db - breakpoint execsql { DELETE FROM t1 WHERE rowid=2 } } {} diff --git a/test/cost.test b/test/cost.test index 92fff9c888..9c10d821d9 100644 --- a/test/cost.test +++ b/test/cost.test @@ -287,6 +287,3 @@ ifcapable stat4 { } finish_test - - - diff --git a/test/e_blobbytes.test b/test/e_blobbytes.test index a6283ab852..d38f56bf34 100644 --- a/test/e_blobbytes.test +++ b/test/e_blobbytes.test @@ -72,5 +72,3 @@ do_test 2.1 { sqlite3_blob_close $B finish_test - - diff --git a/test/e_blobclose.test b/test/e_blobclose.test index a5d432d3b5..2683197854 100644 --- a/test/e_blobclose.test +++ b/test/e_blobclose.test @@ -168,4 +168,3 @@ do_execsql_test 3.5 { do_test 4.0 { sqlite3_blob_close 0 } {} finish_test - diff --git a/test/e_blobopen.test b/test/e_blobopen.test index 01f62cdd78..a6168042e9 100644 --- a/test/e_blobopen.test +++ b/test/e_blobopen.test @@ -546,4 +546,3 @@ do_test 13.5 { finish_test - diff --git a/test/e_blobwrite.test b/test/e_blobwrite.test index a0d33336de..7b2249c243 100644 --- a/test/e_blobwrite.test +++ b/test/e_blobwrite.test @@ -201,4 +201,3 @@ do_execsql_test 3.2.4 { finish_test - diff --git a/test/e_walckpt.test b/test/e_walckpt.test index e022f840cf..3b1f3b015a 100644 --- a/test/e_walckpt.test +++ b/test/e_walckpt.test @@ -751,4 +751,3 @@ do_test 6.5 { finish_test - diff --git a/test/fkey8.test b/test/fkey8.test index 60bb8e4640..b4b6bb75e7 100644 --- a/test/fkey8.test +++ b/test/fkey8.test @@ -103,4 +103,3 @@ foreach {tn use_stmt sql schema} { finish_test - diff --git a/test/fordelete.test b/test/fordelete.test index bc38a4c5e3..9a382d97f5 100644 --- a/test/fordelete.test +++ b/test/fordelete.test @@ -207,4 +207,3 @@ do_execsql_test 5.3 { finish_test - diff --git a/test/fts3conf.test b/test/fts3conf.test index e157c239ef..f9698770cc 100644 --- a/test/fts3conf.test +++ b/test/fts3conf.test @@ -212,4 +212,3 @@ do_execsql_test 4.2.2 { } {} finish_test - diff --git a/test/fts3expr4.test b/test/fts3expr4.test index 4bc62030d5..9fc22c1172 100644 --- a/test/fts3expr4.test +++ b/test/fts3expr4.test @@ -79,4 +79,3 @@ do_icu_expr_test 3.9 { "ab*c" } { PHRASE 3 0 ab+ * c } do_icu_expr_test 3.10 { ab*c } { AND {PHRASE 3 0 ab+} {PHRASE 3 0 c}} finish_test - diff --git a/test/fts3join.test b/test/fts3join.test index 64363639db..0fb8c62022 100644 --- a/test/fts3join.test +++ b/test/fts3join.test @@ -62,5 +62,3 @@ do_catchsql_test 2.5 { } {1 {unable to use function MATCH in the requested context}} finish_test - - diff --git a/test/fts3matchinfo.test b/test/fts3matchinfo.test index b17d7da0a5..8cbcd69041 100644 --- a/test/fts3matchinfo.test +++ b/test/fts3matchinfo.test @@ -524,7 +524,6 @@ foreach {tn expr res} { do_execsql_test 11.1.$tn.2 { SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr } $r2 - breakpoint do_execsql_test 11.1.$tn.2 { SELECT rowid, mit(matchinfo(tt, 'b')) FROM tt WHERE tt MATCH $expr @@ -552,4 +551,3 @@ do_execsql_test 12.1 { set sqlite_fts3_enable_parentheses 0 finish_test - diff --git a/test/fts3offsets.test b/test/fts3offsets.test index 184321ac01..4a1e63aa4c 100644 --- a/test/fts3offsets.test +++ b/test/fts3offsets.test @@ -121,4 +121,3 @@ do_execsql_test 1.4.1 { set sqlite_fts3_enable_parentheses 0 finish_test - diff --git a/test/fts3snippet.test b/test/fts3snippet.test index 4e1d123b2f..887011cd11 100644 --- a/test/fts3snippet.test +++ b/test/fts3snippet.test @@ -559,4 +559,3 @@ do_test 4.2 { set sqlite_fts3_enable_parentheses 0 finish_test - diff --git a/test/fts4check.test b/test/fts4check.test index 4ded053871..1e2f6b234f 100644 --- a/test/fts4check.test +++ b/test/fts4check.test @@ -210,4 +210,3 @@ do_execsql_test 5.4 { } {} finish_test - diff --git a/test/fts4content.test b/test/fts4content.test index 5a91987867..67642b6b8a 100644 --- a/test/fts4content.test +++ b/test/fts4content.test @@ -636,4 +636,3 @@ do_catchsql_test 11.1 { finish_test - diff --git a/test/fts4growth.test b/test/fts4growth.test index aa5f251f95..e4b5f19ecb 100644 --- a/test/fts4growth.test +++ b/test/fts4growth.test @@ -434,4 +434,3 @@ do_execsql_test 7.7 { finish_test - diff --git a/test/fts4growth2.test b/test/fts4growth2.test index af41d51c18..bcccf89c87 100644 --- a/test/fts4growth2.test +++ b/test/fts4growth2.test @@ -90,4 +90,3 @@ for {set tn 0} {$tn < 40} {incr tn} { finish_test - diff --git a/test/fts4noti.test b/test/fts4noti.test index c90999b4fa..6707203970 100644 --- a/test/fts4noti.test +++ b/test/fts4noti.test @@ -228,6 +228,3 @@ do_execsql_test 6.3.1 { } {0 1 1 0 1 1} finish_test - - - diff --git a/test/fts4onepass.test b/test/fts4onepass.test index d290980dc9..46cb4b794b 100644 --- a/test/fts4onepass.test +++ b/test/fts4onepass.test @@ -144,4 +144,3 @@ foreach {tn tcl1 tcl2} { } finish_test - diff --git a/test/fuzz3.test b/test/fuzz3.test index b432671822..6d2a01c7d3 100644 --- a/test/fuzz3.test +++ b/test/fuzz3.test @@ -173,4 +173,3 @@ for {set ii 0} {$ii < 5000} {incr ii} { test_restore_config_pagecache finish_test - diff --git a/test/incrcorrupt.test b/test/incrcorrupt.test index eda65e4035..2ea68c8c7c 100644 --- a/test/incrcorrupt.test +++ b/test/incrcorrupt.test @@ -124,4 +124,3 @@ do_test 2.16 { sqlite3_errcode db } {SQLITE_CORRUPT} do_test 2.17 { sqlite3_errmsg db } {database disk image is malformed} finish_test - diff --git a/test/mallocK.test b/test/mallocK.test index 65791e79ea..45ee7905c3 100644 --- a/test/mallocK.test +++ b/test/mallocK.test @@ -172,4 +172,3 @@ do_faultsim_test 8 -faults oom* -body { finish_test - diff --git a/test/mallocL.test b/test/mallocL.test index 6532ca5e14..5c2a4ec0b0 100644 --- a/test/mallocL.test +++ b/test/mallocL.test @@ -40,4 +40,3 @@ for {set j 1} {$j < 40} {incr j} { finish_test - diff --git a/test/ovfl.test b/test/ovfl.test index 075b1e43dd..4be7568546 100644 --- a/test/ovfl.test +++ b/test/ovfl.test @@ -45,5 +45,3 @@ do_execsql_test 1.2 { } [expr 2000 * 2000] finish_test - - diff --git a/test/pragma2.test b/test/pragma2.test index a4fb2ce657..5896e52687 100644 --- a/test/pragma2.test +++ b/test/pragma2.test @@ -255,7 +255,6 @@ db close forcedelete test.db sqlite3 db test.db -breakpoint do_execsql_test pragma2-5.1 { PRAGMA page_size=16384; CREATE TABLE t1(x); diff --git a/test/rollback2.test b/test/rollback2.test index 4d42dda5d6..3ba0f3f9fd 100644 --- a/test/rollback2.test +++ b/test/rollback2.test @@ -154,4 +154,3 @@ do_rollback_test 4.4 -setup { } finish_test - diff --git a/test/rollbackfault.test b/test/rollbackfault.test index f248d0758d..4d060b43c8 100644 --- a/test/rollbackfault.test +++ b/test/rollbackfault.test @@ -80,5 +80,3 @@ foreach f {oom ioerr} { finish_test - - diff --git a/test/select7.test b/test/select7.test index 9ed5357748..0df84e13d9 100644 --- a/test/select7.test +++ b/test/select7.test @@ -220,5 +220,3 @@ do_catchsql_test 8.2 { finish_test - - diff --git a/test/shared3.test b/test/shared3.test index acc86d2a07..1d09b69b82 100644 --- a/test/shared3.test +++ b/test/shared3.test @@ -139,4 +139,3 @@ do_test 3.5 { sqlite3_enable_shared_cache $::enable_shared_cache finish_test - diff --git a/test/snapshot.test b/test/snapshot.test index 6e160166c3..63a0e30175 100644 --- a/test/snapshot.test +++ b/test/snapshot.test @@ -55,7 +55,6 @@ do_execsql_test 2.1.0 { SELECT * FROM t1; } {1 2 3 4 5 6 7 8} -breakpoint do_test 2.1.1 { set snapshot [sqlite3_snapshot_get db main] execsql { diff --git a/test/sort3.test b/test/sort3.test index 3aa6512a4b..088ae1642d 100644 --- a/test/sort3.test +++ b/test/sort3.test @@ -111,4 +111,3 @@ do_execsql_test 3 { } finish_test - diff --git a/test/sort5.test b/test/sort5.test index a02b8f920f..5b1292bb48 100644 --- a/test/sort5.test +++ b/test/sort5.test @@ -42,4 +42,3 @@ do_execsql_test 1.2 { db close tvfs delete finish_test - diff --git a/test/spellfix.test b/test/spellfix.test index b47001ebd7..8128bb59d2 100644 --- a/test/spellfix.test +++ b/test/spellfix.test @@ -403,4 +403,3 @@ foreach {tn conflict err bRollback res} { } finish_test - diff --git a/test/sqllog.test b/test/sqllog.test index dca5781dbd..53d8d871d8 100644 --- a/test/sqllog.test +++ b/test/sqllog.test @@ -110,7 +110,4 @@ unset ::env(SQLITE_SQLLOG_DIR) unset ::env(SQLITE_SQLLOG_CONDITIONAL) sqlite3_config_sqllog sqlite3_initialize -breakpoint finish_test - - diff --git a/test/tkt-9f2eb3abac.test b/test/tkt-9f2eb3abac.test index 5b93733afe..8411654cdd 100644 --- a/test/tkt-9f2eb3abac.test +++ b/test/tkt-9f2eb3abac.test @@ -76,4 +76,3 @@ do_faultsim_test 3 -faults oom* -prep { } finish_test - diff --git a/test/tkt-ba7cbfaedc.test b/test/tkt-ba7cbfaedc.test index a558d4cec3..f83f8a3d17 100644 --- a/test/tkt-ba7cbfaedc.test +++ b/test/tkt-ba7cbfaedc.test @@ -61,5 +61,3 @@ do_execsql_test 2.0 { } finish_test - - diff --git a/test/triggerE.test b/test/triggerE.test index e2727bbdcb..a82ac9d2a5 100644 --- a/test/triggerE.test +++ b/test/triggerE.test @@ -108,5 +108,3 @@ do_execsql_test 2.3 { } {1 2 x y z z} finish_test - - diff --git a/test/vtab_shared.test b/test/vtab_shared.test index 3473992900..a9079eac04 100644 --- a/test/vtab_shared.test +++ b/test/vtab_shared.test @@ -276,4 +276,3 @@ ifcapable fts3 { sqlite3_enable_shared_cache 0 finish_test - diff --git a/test/wal6.test b/test/wal6.test index d96166ef59..2574a64a84 100644 --- a/test/wal6.test +++ b/test/wal6.test @@ -236,4 +236,3 @@ do_test 4.4.2 { finish_test - diff --git a/test/waloverwrite.test b/test/waloverwrite.test index aa1154fb97..ff8bc5ab55 100644 --- a/test/waloverwrite.test +++ b/test/waloverwrite.test @@ -131,7 +131,6 @@ foreach {tn xtra} { execsql { UPDATE t1 SET y = randomblob(797) WHERE x=$x } } } - breakpoint execsql {ROLLBACK TO abc} } @@ -161,4 +160,3 @@ foreach {tn xtra} { } finish_test - diff --git a/test/whereI.test b/test/whereI.test index 452e7f8f19..29b08549be 100644 --- a/test/whereI.test +++ b/test/whereI.test @@ -89,4 +89,3 @@ do_execsql_test 3.0 { } finish_test - diff --git a/test/withM.test b/test/withM.test index c1650d9576..78b757f422 100644 --- a/test/withM.test +++ b/test/withM.test @@ -72,6 +72,3 @@ do_faultsim_test withM-1.3 -prep { } finish_test - - - From 1cd0f054921f7fd552bf8711abbf31ba88c6908c Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 5 Feb 2016 17:49:43 +0000 Subject: [PATCH 02/18] Make sure the "bak.db" database file does not actually exist before starting the "quota.test" testing. FossilOrigin-Name: 1cac6c45eeb7dbbcda0c76ba7d3a2ca77bc725cd --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/quota.test | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index ca42763a5e..35ca92466b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C From\stest\sscripts,\sremove\sstray\s"breakpoint"\scommands\sand\sblank\slines\nat\sthe\sends\sof\sfiles. -D 2016-02-05T16:46:09.824 +C Make\ssure\sthe\s"bak.db"\sdatabase\sfile\sdoes\snot\sactually\sexist\sbefore\nstarting\sthe\s"quota.test"\stesting. +D 2016-02-05T17:49:43.402 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 @@ -955,7 +955,7 @@ F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca F test/quick.test 1681febc928d686362d50057c642f77a02c62e57 F test/quota-glob.test 32901e9eed6705d68ca3faee2a06b73b57cb3c26 -F test/quota.test 2379902c25e291eac5c12b4cf96946a3447e3744 +F test/quota.test 36cd78b178c4eb0401d4f25754ef410fbd9df2a7 F test/quota2.test 7dc12e08b11cbc4c16c9ba2aa2e040ea8d8ab4b8 F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6 F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459 @@ -1426,7 +1426,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 b082538da774ac77f284fd7e22f9b1b9c2abc343 -R 2d1b67b182c9e99ebe80d7af9546dd2d +P a6b35273239669189f33402144f58328b133d182 +R a53abbe37c3df437dd159edcdce10b4b U drh -Z 796cfacaa9509982f1af1b696a2e58d2 +Z b28b558e8ce57b27d1473527e7eaafc5 diff --git a/manifest.uuid b/manifest.uuid index e7a723dfc9..25bc3f5bbc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a6b35273239669189f33402144f58328b133d182 \ No newline at end of file +1cac6c45eeb7dbbcda0c76ba7d3a2ca77bc725cd \ No newline at end of file diff --git a/test/quota.test b/test/quota.test index f9655fb8c0..7af55a8330 100644 --- a/test/quota.test +++ b/test/quota.test @@ -21,6 +21,7 @@ ifcapable !curdir { source $testdir/malloc_common.tcl +forcedelete bak.db unset -nocomplain defaultVfs set defaultVfs [file_control_vfsname db] db close From b80b8f482c5ef4fe0159db8931995e191f52c95a Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 5 Feb 2016 19:18:02 +0000 Subject: [PATCH 03/18] Further streamlining of fts5 prefix query code. FossilOrigin-Name: ca91bd8ac70a5b3fef127364f73ec675e58bb92c --- ext/fts5/fts5Int.h | 1 + ext/fts5/fts5_buffer.c | 62 ++++++++++++++++++++++------------- ext/fts5/fts5_index.c | 55 ++++++++++++++++++++++--------- ext/fts5/fts5_main.c | 3 +- ext/fts5/test/fts5ad.test | 2 ++ ext/fts5/test/fts5detail.test | 4 +++ manifest | 24 +++++++------- manifest.uuid | 2 +- 8 files changed, 101 insertions(+), 52 deletions(-) diff --git a/ext/fts5/fts5Int.h b/ext/fts5/fts5Int.h index fc71584909..6318af900f 100644 --- a/ext/fts5/fts5Int.h +++ b/ext/fts5/fts5Int.h @@ -282,6 +282,7 @@ struct Fts5PoslistWriter { i64 iPrev; }; int sqlite3Fts5PoslistWriterAppend(Fts5Buffer*, Fts5PoslistWriter*, i64); +void sqlite3Fts5PoslistSafeAppend(Fts5Buffer*, i64*, i64); int sqlite3Fts5PoslistNext64( const u8 *a, int n, /* Buffer containing poslist */ diff --git a/ext/fts5/fts5_buffer.c b/ext/fts5/fts5_buffer.c index d69adf7d24..878240af4f 100644 --- a/ext/fts5/fts5_buffer.c +++ b/ext/fts5/fts5_buffer.c @@ -16,18 +16,20 @@ #include "fts5Int.h" int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){ - u32 nNew = pBuf->nSpace ? pBuf->nSpace*2 : 64; - u8 *pNew; - while( nNewp, nNew); - if( pNew==0 ){ - *pRc = SQLITE_NOMEM; - return 1; - }else{ - pBuf->nSpace = nNew; - pBuf->p = pNew; + if( pBuf->nSpacenSpace ? pBuf->nSpace : 64; + u8 *pNew; + while( nNewp, nNew); + if( pNew==0 ){ + *pRc = SQLITE_NOMEM; + return 1; + }else{ + pBuf->nSpace = nNew; + pBuf->p = pNew; + } } return 0; } @@ -208,23 +210,37 @@ int sqlite3Fts5PoslistReaderInit( return pIter->bEof; } +/* +** Append position iPos to the position list being accumulated in buffer +** pBuf, which must be already be large enough to hold the new data. +** The previous position written to this list is *piPrev. *piPrev is set +** to iPos before returning. +*/ +void sqlite3Fts5PoslistSafeAppend( + Fts5Buffer *pBuf, + i64 *piPrev, + i64 iPos +){ + static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32; + if( (iPos & colmask) != (*piPrev & colmask) ){ + pBuf->p[pBuf->n++] = 1; + pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], (iPos>>32)); + *piPrev = (iPos & colmask); + } + pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], (iPos-*piPrev)+2); + *piPrev = iPos; +} + int sqlite3Fts5PoslistWriterAppend( Fts5Buffer *pBuf, Fts5PoslistWriter *pWriter, i64 iPos ){ static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32; - int rc = SQLITE_OK; - if( 0==fts5BufferGrow(&rc, pBuf, 5+5+5) ){ - if( (iPos & colmask) != (pWriter->iPrev & colmask) ){ - pBuf->p[pBuf->n++] = 1; - pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], (iPos>>32)); - pWriter->iPrev = (iPos & colmask); - } - pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], (iPos-pWriter->iPrev)+2); - pWriter->iPrev = iPos; - } - return rc; + int rc; + if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; + sqlite3Fts5PoslistSafeAppend(pBuf, &pWriter->iPrev, iPos); + return SQLITE_OK; } void *sqlite3Fts5MallocZero(int *pRc, int nByte){ diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index 0461f3a778..3dd9a9c92d 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -4704,6 +4704,7 @@ static void fts5MergePrefixLists( Fts5Buffer *p1, /* First list to merge */ Fts5Buffer *p2 /* Second list to merge */ ){ + if( p2->n ){ if( p1->n==0 ){ fts5BufferSwap(p1, p2); @@ -4719,7 +4720,6 @@ static void fts5MergePrefixLists( fts5DoclistIterInit(p2, &i2); while( 1 ){ - if( i1.iRowidrc, &tmp, i1.nPoslist + i2.nPoslist); + if( p->rc ) break; sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1); sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2); + assert( iPos1>=0 && iPos2>=0 ); - while( iPos1>=0 || iPos2>=0 ){ - i64 iNew; - if( iPos2<0 || (iPos1>=0 && iPos1=0 && iPos2>=0 ){ + while( 1 ){ + if( iPos1rc = sqlite3Fts5PoslistWriterAppend(&tmp, &writer, iNew); - if( p->rc ) goto error_out; + } + + if( iPos1>=0 ){ + if( iPos1!=iPrev ){ + sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1); } + fts5BufferSafeAppendBlob(&tmp, &a1[iOff1], i1.nPoslist-iOff1); + } + else if( iPos2>=0 ){ + if( iPos2!=iPrev ){ + sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2); + } + fts5BufferSafeAppendBlob(&tmp, &a2[iOff2], i2.nPoslist-iOff2); } /* WRITEPOSLISTSIZE */ @@ -4936,7 +4961,7 @@ int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit){ int sqlite3Fts5IndexRollback(Fts5Index *p){ fts5CloseReader(p); fts5IndexDiscardData(p); - assert( p->rc==SQLITE_OK ); + /* assert( p->rc==SQLITE_OK ); */ return SQLITE_OK; } diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index 9ef8d9a01a..4b798314c0 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -803,7 +803,7 @@ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){ */ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; - int rc = SQLITE_OK; + int rc; assert( (pCsr->ePlan<3)== (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) @@ -820,6 +820,7 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ switch( pCsr->ePlan ){ case FTS5_PLAN_SPECIAL: { CsrFlagSet(pCsr, FTS5CSR_EOF); + rc = SQLITE_OK; break; } diff --git a/ext/fts5/test/fts5ad.test b/ext/fts5/test/fts5ad.test index c6b09d8121..974aa781aa 100644 --- a/ext/fts5/test/fts5ad.test +++ b/ext/fts5/test/fts5ad.test @@ -11,6 +11,8 @@ # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # +# More specifically, the focus is on testing prefix queries, both with and +# without prefix indexes. # source [file join [file dirname [info script]] fts5_common.tcl] diff --git a/ext/fts5/test/fts5detail.test b/ext/fts5/test/fts5detail.test index 5bdd14424e..58fda3e995 100644 --- a/ext/fts5/test/fts5detail.test +++ b/ext/fts5/test/fts5detail.test @@ -85,6 +85,10 @@ do_execsql_test 2.2 { SELECT fts5_test_poslist(t2) FROM t2('aa'); } {0.0.0} +do_execsql_test 2.3 { + SELECT fts5_test_collist(t2) FROM t2('aa'); +} {0.0} + set ::pc 0 #puts [nearset {{ax bx cx}} -pc ::pc -near 10 -- b*] #exit diff --git a/manifest b/manifest index 35ca92466b..76600b8190 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sthe\s"bak.db"\sdatabase\sfile\sdoes\snot\sactually\sexist\sbefore\nstarting\sthe\s"quota.test"\stesting. -D 2016-02-05T17:49:43.402 +C Further\sstreamlining\sof\sfts5\sprefix\squery\scode. +D 2016-02-05T19:18:02.811 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 @@ -98,14 +98,14 @@ F ext/fts3/unicode/mkunicode.tcl 95cf7ec186e48d4985e433ff8a1c89090a774252 F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95 F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0 F ext/fts5/fts5.h ff9c2782e8ed890b0de2f697a8d63971939e70c7 -F ext/fts5/fts5Int.h 2095cc38e776f19cc083ca90e00772ea0b204ab3 +F ext/fts5/fts5Int.h efb02807dbe5a2bfb0ea592a472d1171cb553d53 F ext/fts5/fts5_aux.c b9bcce753ef5b451267b2232f0ca153ddeb3951d -F ext/fts5/fts5_buffer.c f6e0c6018ffc8e39fc0b333b5daa8b8d528ae6e4 +F ext/fts5/fts5_buffer.c ad4bb545c866eea6add1b0f84c2c5029cd689092 F ext/fts5/fts5_config.c 0c384ebdd23fd055e2e50a93277b8d59da538238 F ext/fts5/fts5_expr.c ff5c451a6d025909639ac0f0d0af0cc595b50feb F ext/fts5/fts5_hash.c 1b113977296cf4212c6ec667d5e3f2bd18036955 -F ext/fts5/fts5_index.c 614c54544f844387ba6728c613a884a1aa151f06 -F ext/fts5/fts5_main.c 7e8a5f27d504bc04e3de7f1cba8867f0332aee9d +F ext/fts5/fts5_index.c 9706959f2188d97d72df750519fee7baccef9964 +F ext/fts5/fts5_main.c 6e23df904049edb498538bd3e22e53ec1ab6f4f7 F ext/fts5/fts5_storage.c 2a1f44deae090cd711f02cec0c2af8e660360d24 F ext/fts5/fts5_tcl.c f8731e0508299bd43f1a2eff7dbeaac870768966 F ext/fts5/fts5_test_mi.c 1ec66ffdf7632077fbd773b7a6df5153272ec070 @@ -120,7 +120,7 @@ F ext/fts5/test/fts5_common.tcl 61ff0d1a29d98a91c4553b20b3f410d858834ee9 F ext/fts5/test/fts5aa.test 7e814df4a0e6c22a6fe2d84f210fdc0b5068a084 F ext/fts5/test/fts5ab.test 30325a89453280160106be411bba3acf138e6d1b F ext/fts5/test/fts5ac.test 55cad4275a1f5acabfe14d8442a8046b47e49e5f -F ext/fts5/test/fts5ad.test 0ddaa5b692ff220100ee396228838f4331399eaa +F ext/fts5/test/fts5ad.test 36995f0586f30f5602074e012b9224c71ec5171c F ext/fts5/test/fts5ae.test 612dcb51f4069226791ff14c17dbfb3138c56f20 F ext/fts5/test/fts5af.test be858a96b1f5de66ba6d64f0021bd8b2408e126c F ext/fts5/test/fts5ag.test 27180de76c03036be75ee80b93d8c5f540014071 @@ -142,7 +142,7 @@ F ext/fts5/test/fts5content.test 9a952c95518a14182dc3b59e3c8fa71cda82a4e1 F ext/fts5/test/fts5corrupt.test c2ad090192708150d50d961278df10ae7a4b8b62 F ext/fts5/test/fts5corrupt2.test 26c0a39dd9ff73207e6229f83b50b21d37c7658c F ext/fts5/test/fts5corrupt3.test a2b537c120bdd43c79c42fe2438d7b8c81fe5599 -F ext/fts5/test/fts5detail.test 4e971d28e7336c61ab916fc287900355dab7054d +F ext/fts5/test/fts5detail.test ef5c690535a797413acaf5ad9b8ab5d49972df69 F ext/fts5/test/fts5dlidx.test 13871a14641017ae42f6f1055a8067bafd44cb3d F ext/fts5/test/fts5doclist.test 8edb5b57e5f144030ed74ec00ef6fa4294fed79b F ext/fts5/test/fts5ea.test b01e3a18cdfabbff8104a96a5242a06a68a998a0 @@ -1426,7 +1426,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 a6b35273239669189f33402144f58328b133d182 -R a53abbe37c3df437dd159edcdce10b4b -U drh -Z b28b558e8ce57b27d1473527e7eaafc5 +P 1cac6c45eeb7dbbcda0c76ba7d3a2ca77bc725cd +R 82ed27d217d52be944f2d4bee3dfe639 +U dan +Z ad1bc1867d7f59ff72d365283a40efbf diff --git a/manifest.uuid b/manifest.uuid index 25bc3f5bbc..8902cb7ad9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1cac6c45eeb7dbbcda0c76ba7d3a2ca77bc725cd \ No newline at end of file +ca91bd8ac70a5b3fef127364f73ec675e58bb92c \ No newline at end of file From a6f28893ed0066a06f03b2ea3f54a31582558ea2 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 5 Feb 2016 19:40:23 +0000 Subject: [PATCH 04/18] More work on Windows 10 SDK integration. FossilOrigin-Name: ebace2c99b6af9230c4bbc31a764c7f397200148 --- Makefile.msc | 24 ++++++++++++++++++++++-- manifest | 17 ++++++++++------- manifest.uuid | 2 +- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 3427b8177a..a507825a20 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -356,6 +356,16 @@ NSDKLIBPATH = $(WINDOWSSDKDIR)\lib NSDKLIBPATH = $(NSDKLIBPATH:\\=\) +# Check for the UCRT library path macro. Othertise, this value will +# default to the version-specific, platform-specific 'lib' directory +# underneath the Windows SDK installation directory. +# +!IFNDEF UCRTLIBPATH +UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM) +!ENDIF + +UCRTLIBPATH = $(UCRTLIBPATH:\\=\) + # C compiler and options for use in building executables that # will run on the platform that is doing the build. # @@ -541,7 +551,7 @@ BCC = $(BCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE # USE_CRT_DLL option is set to force dynamically linking to the # MSVC runtime library. # -!IF $(FOR_WINRT)!=0 || $(FOR_WIN10)!=0 || $(USE_CRT_DLL)!=0 +!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0 !IF $(DEBUG)>1 TCC = $(TCC) -MDd BCC = $(BCC) -MDd @@ -888,7 +898,8 @@ LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelH LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib !ENDIF -# When compiling for UAP, some extra linker options are also required. +# When compiling for UAP or the Windows 10 platform, some extra +# linker options are also required. # !IF $(FOR_UAP)!=0 || $(FOR_WIN10)!=0 LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib @@ -898,6 +909,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" !ENDIF !ENDIF +!IF $(FOR_WIN10)!=0 +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(UCRTLIBPATH)" +!IF $(DEBUG)>1 +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib +!ELSE +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib +!ENDIF +!ENDIF + # If either debugging or symbols are enabled, enable PDBs. # !IF $(DEBUG)>1 || $(SYMBOLS)!=0 diff --git a/manifest b/manifest index 76600b8190..c8a0a95df0 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -C Further\sstreamlining\sof\sfts5\sprefix\squery\scode. -D 2016-02-05T19:18:02.811 +C More\swork\son\sWindows\s10\sSDK\sintegration. +D 2016-02-05T19:40:23.877 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 +F Makefile.msc 9eadde083c1ef0d0d2a253671c76e0b7e48a3dc6 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION 866588d1edf0ccb5b0d33896974338f97564f719 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -1426,7 +1426,10 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1cac6c45eeb7dbbcda0c76ba7d3a2ca77bc725cd -R 82ed27d217d52be944f2d4bee3dfe639 -U dan -Z ad1bc1867d7f59ff72d365283a40efbf +P ca91bd8ac70a5b3fef127364f73ec675e58bb92c +R 1ddcbe680d5a6ea9a1dc01ec422c820c +T *branch * win10sdk +T *sym-win10sdk * +T -sym-trunk * +U mistachkin +Z 9a5014635472c911640e985821bf4dea diff --git a/manifest.uuid b/manifest.uuid index 8902cb7ad9..bf7c81653a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca91bd8ac70a5b3fef127364f73ec675e58bb92c \ No newline at end of file +ebace2c99b6af9230c4bbc31a764c7f397200148 \ No newline at end of file From d120a1e3ab9763ba9c39e08d2b4e6f5f2cfbf346 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 5 Feb 2016 21:09:26 +0000 Subject: [PATCH 05/18] Add tests for and remove unreachable branches from fts5 in order to restore test coverage. FossilOrigin-Name: 22589018ac3321f7bd89ce9fa69e57eae395e324 --- ext/fts5/fts5_buffer.c | 1 - ext/fts5/fts5_index.c | 213 ++++++++++++++++------------------ ext/fts5/fts5_varint.c | 3 + ext/fts5/test/fts5config.test | 4 + manifest | 18 +-- manifest.uuid | 2 +- 6 files changed, 117 insertions(+), 124 deletions(-) diff --git a/ext/fts5/fts5_buffer.c b/ext/fts5/fts5_buffer.c index 878240af4f..c3d4101b8b 100644 --- a/ext/fts5/fts5_buffer.c +++ b/ext/fts5/fts5_buffer.c @@ -236,7 +236,6 @@ int sqlite3Fts5PoslistWriterAppend( Fts5PoslistWriter *pWriter, i64 iPos ){ - static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32; int rc; if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; sqlite3Fts5PoslistSafeAppend(pBuf, &pWriter->iPrev, iPos); diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index 3dd9a9c92d..12e18c6445 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -518,7 +518,6 @@ struct Fts5Iter { int nSeg; /* Size of aSeg[] array */ int bRev; /* True to iterate in reverse order */ u8 bSkipEmpty; /* True to skip deleted entries */ - u8 bFiltered; /* True if column-filter already applied */ i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */ Fts5CResult *aFirst; /* Current merge state (see above) */ @@ -2030,9 +2029,6 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){ iPoslist = 4; } fts5IndexSkipVarint(pLeaf->p, iPoslist); - assert( p->pConfig->eDetail==FTS5_DETAIL_NONE || iPoslist==( - pIter->iLeafOffset - sqlite3Fts5GetVarintLen(pIter->nPos*2+pIter->bDel) - )); pIter->iLeafOffset = iPoslist; /* If this condition is true then the largest rowid for the current @@ -3095,7 +3091,7 @@ static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){ pIter->base.nData = pSeg->nPos; assert( pIter->pIndex->pConfig->eDetail!=FTS5_DETAIL_NONE ); - assert( pIter->pColset==0 || pIter->bFiltered ); + assert( pIter->pColset==0 ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ /* All data is stored on the current page. Populate the output @@ -3212,7 +3208,7 @@ static void fts5IterSetOutputCb(int *pRc, Fts5Iter *pIter){ pIter->xSetOutputs = fts5IterSetOutputs_None; } - else if( pIter->pColset==0 || pIter->bFiltered ){ + else if( pIter->pColset==0 ){ pIter->xSetOutputs = fts5IterSetOutputs_Nocolset; } @@ -3359,7 +3355,6 @@ static void fts5MultiIterNew2( if( pNew ){ Fts5SegIter *pIter = &pNew->aSeg[1]; - pNew->bFiltered = 1; pIter->flags = FTS5_SEGITER_ONETERM; if( pData->szLeaf>0 ){ pIter->pLeaf = pData; @@ -4704,120 +4699,111 @@ static void fts5MergePrefixLists( Fts5Buffer *p1, /* First list to merge */ Fts5Buffer *p2 /* Second list to merge */ ){ - if( p2->n ){ - if( p1->n==0 ){ - fts5BufferSwap(p1, p2); - }else{ - i64 iLastRowid = 0; - Fts5DoclistIter i1; - Fts5DoclistIter i2; - Fts5Buffer out = {0, 0, 0}; - Fts5Buffer tmp = {0, 0, 0}; + i64 iLastRowid = 0; + Fts5DoclistIter i1; + Fts5DoclistIter i2; + Fts5Buffer out = {0, 0, 0}; + Fts5Buffer tmp = {0, 0, 0}; - if( sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n) ) return; - fts5DoclistIterInit(p1, &i1); - fts5DoclistIterInit(p2, &i2); + if( sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n) ) return; + fts5DoclistIterInit(p1, &i1); + fts5DoclistIterInit(p2, &i2); - while( 1 ){ - if( i1.iRowidrc, &tmp, i1.nPoslist + i2.nPoslist); - if( p->rc ) break; - - sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1); - sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2); - assert( iPos1>=0 && iPos2>=0 ); - - if( iPos1=0 && iPos2>=0 ){ - while( 1 ){ - if( iPos1=0 ){ - if( iPos1!=iPrev ){ - sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1); - } - fts5BufferSafeAppendBlob(&tmp, &a1[iOff1], i1.nPoslist-iOff1); - } - else if( iPos2>=0 ){ - if( iPos2!=iPrev ){ - sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2); - } - fts5BufferSafeAppendBlob(&tmp, &a2[iOff2], i2.nPoslist-iOff2); - } - - /* WRITEPOSLISTSIZE */ - fts5BufferSafeAppendVarint(&out, tmp.n * 2); - fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n); - fts5DoclistIterNext(&i1); - fts5DoclistIterNext(&i2); - if( i1.aPoslist==0 || i2.aPoslist==0 ) break; - } - } - - if( i1.aPoslist ){ + while( 1 ){ + if( i1.iRowidrc, p1, out.n, out.p); - fts5BufferFree(&tmp); - fts5BufferFree(&out); + i64 iPrev = 0; + Fts5PoslistWriter writer; + memset(&writer, 0, sizeof(writer)); + + fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid); + fts5BufferZero(&tmp); + sqlite3Fts5BufferSize(&p->rc, &tmp, i1.nPoslist + i2.nPoslist); + if( p->rc ) break; + + sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1); + sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2); + assert( iPos1>=0 && iPos2>=0 ); + + if( iPos1=0 && iPos2>=0 ){ + while( 1 ){ + if( iPos1=0 ){ + if( iPos1!=iPrev ){ + sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1); + } + fts5BufferSafeAppendBlob(&tmp, &a1[iOff1], i1.nPoslist-iOff1); + }else{ + assert( iPos2>=0 && iPos2!=iPrev ); + sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2); + fts5BufferSafeAppendBlob(&tmp, &a2[iOff2], i2.nPoslist-iOff2); + } + + /* WRITEPOSLISTSIZE */ + fts5BufferSafeAppendVarint(&out, tmp.n * 2); + fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n); + fts5DoclistIterNext(&i1); + fts5DoclistIterNext(&i2); + if( i1.aPoslist==0 || i2.aPoslist==0 ) break; + } } + + if( i1.aPoslist ){ + fts5MergeAppendDocid(&out, iLastRowid, i1.iRowid); + fts5BufferSafeAppendBlob(&out, i1.aPoslist, i1.aEof - i1.aPoslist); + } + else if( i2.aPoslist ){ + fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid); + fts5BufferSafeAppendBlob(&out, i2.aPoslist, i2.aEof - i2.aPoslist); + } + + fts5BufferSet(&p->rc, p1, out.n, out.p); + fts5BufferFree(&tmp); + fts5BufferFree(&out); } } @@ -5181,10 +5167,11 @@ int sqlite3Fts5IndexQuery( int bDesc = (flags & FTS5INDEX_QUERY_DESC)!=0; buf.p[0] = FTS5_MAIN_PREFIX; fts5SetupPrefixIter(p, bDesc, buf.p, nToken+1, pColset, &pRet); + assert( pRet->pColset==0 ); fts5IterSetOutputCb(&p->rc, pRet); if( p->rc==SQLITE_OK ){ Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst]; - if( p->rc==SQLITE_OK && pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); + if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); } } diff --git a/ext/fts5/fts5_varint.c b/ext/fts5/fts5_varint.c index 21858506ac..bb212ab5a8 100644 --- a/ext/fts5/fts5_varint.c +++ b/ext/fts5/fts5_varint.c @@ -333,7 +333,10 @@ int sqlite3Fts5PutVarint(unsigned char *p, u64 v){ int sqlite3Fts5GetVarintLen(u32 iVal){ +#if 0 if( iVal<(1 << 7 ) ) return 1; +#endif + assert( iVal>=(1 << 7) ); if( iVal<(1 << 14) ) return 2; if( iVal<(1 << 21) ) return 3; if( iVal<(1 << 28) ) return 4; diff --git a/ext/fts5/test/fts5config.test b/ext/fts5/test/fts5config.test index 223e504a65..c30a597242 100644 --- a/ext/fts5/test/fts5config.test +++ b/ext/fts5/test/fts5config.test @@ -243,5 +243,9 @@ foreach {tn opt} { do_catchsql_test 11.$tn "CREATE VIRTUAL TABLE f1 USING fts5(x, $opt)" $res } +do_catchsql_test 12.1 { + INSERT INTO t1(t1, rank) VALUES('rank', NULL);; +} {1 {SQL logic error or missing database}} + finish_test diff --git a/manifest b/manifest index 76600b8190..15c459f19f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Further\sstreamlining\sof\sfts5\sprefix\squery\scode. -D 2016-02-05T19:18:02.811 +C Add\stests\sfor\sand\sremove\sunreachable\sbranches\sfrom\sfts5\sin\sorder\sto\srestore\stest\scoverage. +D 2016-02-05T21:09:26.310 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 @@ -100,11 +100,11 @@ F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0 F ext/fts5/fts5.h ff9c2782e8ed890b0de2f697a8d63971939e70c7 F ext/fts5/fts5Int.h efb02807dbe5a2bfb0ea592a472d1171cb553d53 F ext/fts5/fts5_aux.c b9bcce753ef5b451267b2232f0ca153ddeb3951d -F ext/fts5/fts5_buffer.c ad4bb545c866eea6add1b0f84c2c5029cd689092 +F ext/fts5/fts5_buffer.c 2dac8e23c5b77fccecc234f1a1f37d75113b4e46 F ext/fts5/fts5_config.c 0c384ebdd23fd055e2e50a93277b8d59da538238 F ext/fts5/fts5_expr.c ff5c451a6d025909639ac0f0d0af0cc595b50feb F ext/fts5/fts5_hash.c 1b113977296cf4212c6ec667d5e3f2bd18036955 -F ext/fts5/fts5_index.c 9706959f2188d97d72df750519fee7baccef9964 +F ext/fts5/fts5_index.c 28f72130400cb54d179a9a120b7232915e3e7a4e F ext/fts5/fts5_main.c 6e23df904049edb498538bd3e22e53ec1ab6f4f7 F ext/fts5/fts5_storage.c 2a1f44deae090cd711f02cec0c2af8e660360d24 F ext/fts5/fts5_tcl.c f8731e0508299bd43f1a2eff7dbeaac870768966 @@ -112,7 +112,7 @@ F ext/fts5/fts5_test_mi.c 1ec66ffdf7632077fbd773b7a6df5153272ec070 F ext/fts5/fts5_test_tok.c db08af63673c3a7d39f053b36fd6e065017706be F ext/fts5/fts5_tokenize.c 4d5c4f183c7d07d144bc219b92da1ea0e962fae3 F ext/fts5/fts5_unicode2.c 78273fbd588d1d9bd0a7e4e0ccc9207348bae33c -F ext/fts5/fts5_varint.c 3f86ce09cab152e3d45490d7586b7ed2e40c13f1 +F ext/fts5/fts5_varint.c a5aceacda04dafcbae725413d7a16818ecd65738 F ext/fts5/fts5_vocab.c 3ef401a8d6932db56368de32f446eb9fe73aa623 F ext/fts5/fts5parse.y 1647eba089b9b3fc058b4dc989d9da87d15b9580 F ext/fts5/mkportersteps.tcl 5acf962d2e0074f701620bb5308155fa1e4a63ba @@ -136,7 +136,7 @@ F ext/fts5/test/fts5auxdata.test 141a7cbffcceb1bd2799b4b29c183ff8780d586e F ext/fts5/test/fts5bigpl.test 04ee0d7eebbebf17c31f5a0b5c5f9494eac3a0cb F ext/fts5/test/fts5bigtok.test 981b2790f6fa02773c889bd35d42c6b97f80f0f4 F ext/fts5/test/fts5columnsize.test a8cfef21ffa1c264b9f670a7d94eeaccb5341c07 -F ext/fts5/test/fts5config.test 83941309b94d002ed6f55d9cd814e0353c9ae013 +F ext/fts5/test/fts5config.test 8b2bc6dcc0eb06fa2b7dd65b2ce2db09e829e873 F ext/fts5/test/fts5conflict.test 26f4e46c4d31e16221794832a990dc4e30e18de5 F ext/fts5/test/fts5content.test 9a952c95518a14182dc3b59e3c8fa71cda82a4e1 F ext/fts5/test/fts5corrupt.test c2ad090192708150d50d961278df10ae7a4b8b62 @@ -1426,7 +1426,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 1cac6c45eeb7dbbcda0c76ba7d3a2ca77bc725cd -R 82ed27d217d52be944f2d4bee3dfe639 +P ca91bd8ac70a5b3fef127364f73ec675e58bb92c +R bc449da6b3e9fd24816f80d5ebb5f8a2 U dan -Z ad1bc1867d7f59ff72d365283a40efbf +Z 6b9788cdb90c1d425a4100a494ea3da5 diff --git a/manifest.uuid b/manifest.uuid index 8902cb7ad9..3643624eee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca91bd8ac70a5b3fef127364f73ec675e58bb92c \ No newline at end of file +22589018ac3321f7bd89ce9fa69e57eae395e324 \ No newline at end of file From bb3da060e3d90da84944b1d75df74ce7697d8998 Mon Sep 17 00:00:00 2001 From: pdr Date: Sat, 6 Feb 2016 14:14:43 +0000 Subject: [PATCH 06/18] Fix an assert() to have a test instead of a side effect FossilOrigin-Name: a2952231ac7abe165ed070875728f752ae0be608 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/alter.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 15c459f19f..d6e074a0b5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\stests\sfor\sand\sremove\sunreachable\sbranches\sfrom\sfts5\sin\sorder\sto\srestore\stest\scoverage. -D 2016-02-05T21:09:26.310 +C Fix\san\sassert()\sto\shave\sa\stest\sinstead\sof\sa\sside\seffect +D 2016-02-06T14:14:43.463 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 @@ -284,7 +284,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a -F src/alter.c e4a5132e6264e002ab87c268108f416df3f1fb10 +F src/alter.c d50b7dbb49a4affee951301afb76a008463e3625 F src/analyze.c fbf0e80d83cc893734e872f932f249a056b86e11 F src/attach.c c16c2648a577fa3def2adfa48c28901376389bc5 F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 @@ -1426,7 +1426,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 ca91bd8ac70a5b3fef127364f73ec675e58bb92c -R bc449da6b3e9fd24816f80d5ebb5f8a2 -U dan -Z 6b9788cdb90c1d425a4100a494ea3da5 +P 22589018ac3321f7bd89ce9fa69e57eae395e324 +R e3d82b169cbfebcfd4c4fb1447b3dcc4 +U pdr +Z 6e44ca05901e086eb71b8481afaf44d8 diff --git a/manifest.uuid b/manifest.uuid index 3643624eee..4f51f901e5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -22589018ac3321f7bd89ce9fa69e57eae395e324 \ No newline at end of file +a2952231ac7abe165ed070875728f752ae0be608 \ No newline at end of file diff --git a/src/alter.c b/src/alter.c index 3419059fa2..34ca8abd2c 100644 --- a/src/alter.c +++ b/src/alter.c @@ -695,7 +695,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ rc = sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, &pVal); assert( rc==SQLITE_OK || rc==SQLITE_NOMEM ); if( rc!=SQLITE_OK ){ - assert( db->mallocFailed = 1 ); + assert( db->mallocFailed == 1 ); return; } if( !pVal ){ From f5818aa560fc463e241bbeeaefba8cfacdd0131f Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 6 Feb 2016 19:48:50 +0000 Subject: [PATCH 07/18] Make sure variable declarations occur at the beginning of blocks, even with SQLITE_DEBUG enabled. FossilOrigin-Name: 2f7778e64d93ef237e23ceac01ea9808df5cf2a1 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/malloc.c | 7 +++++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index d6e074a0b5..098cff6d3a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\sassert()\sto\shave\sa\stest\sinstead\sof\sa\sside\seffect -D 2016-02-06T14:14:43.463 +C Make\ssure\svariable\sdeclarations\soccur\sat\sthe\sbeginning\sof\sblocks,\seven\nwith\sSQLITE_DEBUG\senabled. +D 2016-02-06T19:48:50.321 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 @@ -314,7 +314,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c b1b0880fc474abfab89e737b0ecfde0bd7a60902 F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b F src/main.c 62b7fe3ed245757d1ff2e6268a7ec0bc30100308 -F src/malloc.c 55ebb1701ebd39985dbcc497aaecb09192b69682 +F src/malloc.c 337e9808b5231855fe28857950f4f60ae42c417f F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3 @@ -1426,7 +1426,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 22589018ac3321f7bd89ce9fa69e57eae395e324 -R e3d82b169cbfebcfd4c4fb1447b3dcc4 -U pdr -Z 6e44ca05901e086eb71b8481afaf44d8 +P a2952231ac7abe165ed070875728f752ae0be608 +R da8a8c4dec6af3be8a6f4cff524d4f5f +U drh +Z f3b1e3c58e3e9ab1cb32cfa377da1181 diff --git a/manifest.uuid b/manifest.uuid index 4f51f901e5..c92bb840b3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a2952231ac7abe165ed070875728f752ae0be608 \ No newline at end of file +2f7778e64d93ef237e23ceac01ea9808df5cf2a1 \ No newline at end of file diff --git a/src/malloc.c b/src/malloc.c index 1ff0a5221d..ebe0440350 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -626,11 +626,11 @@ void *sqlite3DbMallocRaw(sqlite3 *db, u64 n){ return p; } void *sqlite3DbMallocRawNN(sqlite3 *db, u64 n){ +#ifndef SQLITE_OMIT_LOOKASIDE + LookasideSlot *pBuf; assert( db!=0 ); assert( sqlite3_mutex_held(db->mutex) ); assert( db->pnBytesFreed==0 ); -#ifndef SQLITE_OMIT_LOOKASIDE - LookasideSlot *pBuf; if( db->lookaside.bDisable==0 ){ assert( db->mallocFailed==0 ); if( n>db->lookaside.sz ){ @@ -650,6 +650,9 @@ void *sqlite3DbMallocRawNN(sqlite3 *db, u64 n){ return 0; } #else + assert( db!=0 ); + assert( sqlite3_mutex_held(db->mutex) ); + assert( db->pnBytesFreed==0 ); if( db->mallocFailed ){ return 0; } From cc5f8a46b975d5afb86bfbe2da2ee7f2d85d7572 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 6 Feb 2016 22:32:06 +0000 Subject: [PATCH 08/18] Add a utility program that looks for assert(), NEVER(), ALWAYS(), and testcase() macros that have side-effects, and reports errors when they are found. Also fix a bug that this utility detected as it was being tested. FossilOrigin-Name: b0b4624fc5d53bb0cc9fae7dad51984837d946ac --- Makefile.in | 8 ++- main.mk | 8 ++- manifest | 19 +++--- manifest.uuid | 2 +- src/btree.c | 15 +++-- src/main.c | 2 +- tool/srcck1.c | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 192 insertions(+), 19 deletions(-) create mode 100644 tool/srcck1.c diff --git a/Makefile.in b/Makefile.in index a07279c3c9..f0c78a4ee7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -583,6 +583,12 @@ sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h $(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) +srcck1$(BEXE): $(TOP)/tool/srcck1.c + $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c + +sourcetest: srcck1$(BEXE) sqlite3.c + ./srcck1 sqlite3.c + fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h $(LTLINK) -o $@ $(FUZZERSHELL_OPT) \ $(TOP)/tool/fuzzershell.c sqlite3.c $(TLIBS) @@ -1083,7 +1089,7 @@ quicktest: ./testfixture$(TEXE) # This is the common case. Run many tests that do not take too long, # including fuzzcheck, sqlite3_analyzer, and sqldiff tests. # -test: $(TESTPROGS) fastfuzztest +test: $(TESTPROGS) sourcetest fastfuzztest ./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS) # Run a test using valgrind. This can take a really long time diff --git a/main.mk b/main.mk index 1dda2d153f..f4cbbdbb95 100644 --- a/main.mk +++ b/main.mk @@ -480,6 +480,12 @@ sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \ $(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB) +srcck1$(EXE): $(TOP)/tool/srcck1.c + $(BCC) -o srcck1$(EXE) $(TOP)/tool/srcck1.c + +sourcetest: srcck1$(EXE) sqlite3.c + ./srcck1 sqlite3.c + fuzzershell$(EXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h $(TCCX) -o fuzzershell$(EXE) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \ $(FUZZERSHELL_OPT) $(TOP)/tool/fuzzershell.c sqlite3.c \ @@ -768,7 +774,7 @@ quicktest: ./testfixture$(EXE) # The default test case. Runs most of the faster standard TCL tests, # and fuzz tests, and sqlite3_analyzer and sqldiff tests. # -test: $(TESTPROGS) fastfuzztest +test: $(TESTPROGS) sourcetest fastfuzztest ./testfixture$(EXE) $(TOP)/test/veryquick.test $(TESTOPTS) # Run a test using valgrind. This can take a really long time diff --git a/manifest b/manifest index 098cff6d3a..9220387b53 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ -C Make\ssure\svariable\sdeclarations\soccur\sat\sthe\sbeginning\sof\sblocks,\seven\nwith\sSQLITE_DEBUG\senabled. -D 2016-02-06T19:48:50.321 -F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 +C Add\sa\sutility\sprogram\sthat\slooks\sfor\sassert(),\sNEVER(),\sALWAYS(),\sand\ntestcase()\smacros\sthat\shave\sside-effects,\sand\sreports\serrors\swhen\sthey\sare\nfound.\s\sAlso\sfix\sa\sbug\sthat\sthis\sutility\sdetected\sas\sit\swas\sbeing\stested. +D 2016-02-06T22:32:06.228 +F Makefile.in 0a957a57243a3d55e96b1514e22ffae5db9ea116 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 @@ -272,7 +272,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk 960071a0bceb043bc5627573986154f507931f33 +F main.mk f51c0652d2a623160e90a758e01312a6a00f3454 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 @@ -291,7 +291,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 2869a76c03eb393ee795416e2387005553df72bc F src/bitvec.c 1a78d450a17c5016710eec900bedfc5729bf9bdf F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73 -F src/btree.c 0b359bcc2316a57acf12f583253974ad22b4654f +F src/btree.c 4c8caaeed7878aafdb607c3d2bcbc365bb0d19a1 F src/btree.h 368ceeb4bd9312dc8df2ffd64b4b7dbcf4db5f8e F src/btreeInt.h c18b7d2a3494695133e4e60ee36061d37f45d9a5 F src/build.c 198eaa849c193f28b802ed135b2483c68ef7a35c @@ -313,7 +313,7 @@ F src/insert.c b84359365bace233919db550a15f131923190efc F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c b1b0880fc474abfab89e737b0ecfde0bd7a60902 F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b -F src/main.c 62b7fe3ed245757d1ff2e6268a7ec0bc30100308 +F src/main.c b67a45397b93b7ba8fbd6bfcb03423d245baed05 F src/malloc.c 337e9808b5231855fe28857950f4f60ae42c417f F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b @@ -1416,6 +1416,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/sqldiff.c 5a26205111e6fa856d9b1535b1637744dcdb930b +F tool/srcck1.c 3119733530abcef14f1b0603c66207a342936263 F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43 F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d F tool/symbols.sh fec58532668296d7c7dc48be9c87f75ccdb5814f @@ -1426,7 +1427,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 a2952231ac7abe165ed070875728f752ae0be608 -R da8a8c4dec6af3be8a6f4cff524d4f5f +P 2f7778e64d93ef237e23ceac01ea9808df5cf2a1 +R e75f025e263d6165f7cd0bcd65f5ad12 U drh -Z f3b1e3c58e3e9ab1cb32cfa377da1181 +Z 663376736f9ceb33b8ce1b1cb94df97c diff --git a/manifest.uuid b/manifest.uuid index c92bb840b3..20460304dd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2f7778e64d93ef237e23ceac01ea9808df5cf2a1 \ No newline at end of file +b0b4624fc5d53bb0cc9fae7dad51984837d946ac \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index b99820ddbc..c6f9c34f7b 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6148,7 +6148,7 @@ static int fillInCell( { CellInfo info; pPage->xParseCell(pPage, pCell, &info); - assert( nHeader=(int)(info.pPayload - pCell) ); + assert( nHeader==(int)(info.pPayload - pCell) ); assert( info.nKey==nKey ); assert( *pnSize == info.nSize ); assert( spaceLeft == info.nLocal ); @@ -7807,8 +7807,8 @@ static int balance(BtCursor *pCur){ u8 aBalanceQuickSpace[13]; u8 *pFree = 0; - TESTONLY( int balance_quick_called = 0 ); - TESTONLY( int balance_deeper_called = 0 ); + VVA_ONLY( int balance_quick_called = 0 ); + VVA_ONLY( int balance_deeper_called = 0 ); do { int iPage = pCur->iPage; @@ -7821,7 +7821,8 @@ static int balance(BtCursor *pCur){ ** and copy the current contents of the root-page to it. The ** next iteration of the do-loop will balance the child page. */ - assert( (balance_deeper_called++)==0 ); + assert( balance_deeper_called==0 ); + VVA_ONLY( balance_deeper_called++ ); rc = balance_deeper(pPage, &pCur->apPage[1]); if( rc==SQLITE_OK ){ pCur->iPage = 1; @@ -7860,7 +7861,8 @@ static int balance(BtCursor *pCur){ ** function. If this were not verified, a subtle bug involving reuse ** of the aBalanceQuickSpace[] might sneak in. */ - assert( (balance_quick_called++)==0 ); + assert( balance_quick_called==0 ); + VVA_ONLY( balance_quick_called++ ); rc = balance_quick(pParent, pPage, aBalanceQuickSpace); }else #endif @@ -9327,7 +9329,8 @@ char *sqlite3BtreeIntegrityCheck( sqlite3BtreeEnter(p); assert( p->inTrans>TRANS_NONE && pBt->inTransaction>TRANS_NONE ); - assert( (nRef = sqlite3PagerRefcount(pBt->pPager))>=0 ); + VVA_ONLY( nRef = sqlite3PagerRefcount(pBt->pPager) ); + assert( nRef>=0 ); sCheck.pBt = pBt; sCheck.pPager = pBt->pPager; sCheck.nPage = btreePagecount(sCheck.pBt); diff --git a/src/main.c b/src/main.c index 588461b48a..922af1315a 100644 --- a/src/main.c +++ b/src/main.c @@ -3566,7 +3566,7 @@ int sqlite3_test_control(int op, ...){ */ case SQLITE_TESTCTRL_ASSERT: { volatile int x = 0; - assert( (x = va_arg(ap,int))!=0 ); + assert( /*side-effects-ok*/ (x = va_arg(ap,int))!=0 ); rc = x; break; } diff --git a/tool/srcck1.c b/tool/srcck1.c new file mode 100644 index 0000000000..cd4b4990b9 --- /dev/null +++ b/tool/srcck1.c @@ -0,0 +1,157 @@ +/* +** The program does some simple static analysis of the sqlite3.c source +** file looking for mistakes. +** +** Usage: +** +** ./srcck1 sqlite3.c +** +** This program looks for instances of assert(), ALWAYS(), NEVER() or +** testcase() that contain side-effects and reports errors if any such +** instances are found. +** +** The aim of this utility is to prevent recurrences of errors such +** as the one fixed at: +** +** https://www.sqlite.org/src/info/a2952231ac7abe16 +** +** Note that another similar error was found by this utility when it was +** first written. That other error was fixed by the same check-in that +** committed the first version of this utility program. +*/ +#include +#include +#include + +/* Read the complete text of a file into memory. Return a pointer to +** the result. Panic if unable to read the file or allocate memory. +*/ +static char *readFile(const char *zFilename){ + FILE *in; + char *z; + long n; + size_t got; + + in = fopen(zFilename, "rb"); + if( in==0 ){ + fprintf(stderr, "unable to open '%s' for reading\n", zFilename); + exit(1); + } + fseek(in, 0, SEEK_END); + n = ftell(in); + rewind(in); + z = malloc( n+1 ); + if( z==0 ){ + fprintf(stderr, "cannot allocate %d bytes to store '%s'\n", + (int)(n+1), zFilename); + exit(1); + } + got = fread(z, 1, n, in); + fclose(in); + if( got!=(size_t)n ){ + fprintf(stderr, "only read %d of %d bytes from '%s'\n", + (int)got, (int)n, zFilename); + exit(1); + } + z[n] = 0; + return z; +} + +/* Change the C code in the argument to see if it might have +** side effects. The only accurate way to know this is to do a full +** parse of the C code, which this routine does not do. This routine +** uses a simple heuristic of looking for: +** +** * '=' not immediately after '>', '<', '!', or '='. +** * '++' +** * '--' +** +** If the code contains the phrase "side-effects-ok" is inside a +** comment, then always return false. This is used to disable checking +** for assert()s with deliberate side-effects, such as used by +** SQLITE_TESTCTRL_ASSERT - a facility that allows applications to +** determine at runtime whether or not assert()s are enabled. +** Obviously, that determination cannot be made unless the assert() +** has some side-effect. +** +** Return true if a side effect is seen. Return false if not. +*/ +static int hasSideEffect(const char *z, unsigned int n){ + unsigned int i; + for(i=0; i0 && z[i-1]!='=' && z[i-1]!='>' + && z[i-1]!='<' && z[i-1]!='!' && z[i+1]!='=' ) return 1; + if( z[i]=='+' && z[i+1]=='+' ) return 1; + if( z[i]=='-' && z[i+1]=='-' ) return 1; + } + return 0; +} + +/* Return the number of bytes in string z[] prior to the first unmatched ')' +** character. +*/ +static unsigned int findCloseParen(const char *z){ + unsigned int nOpen = 0; + unsigned i; + for(i=0; z[i]; i++){ + if( z[i]=='(' ) nOpen++; + if( z[i]==')' ){ + if( nOpen==0 ) break; + nOpen--; + } + } + return i; +} + +/* Search for instances of assert(...), ALWAYS(...), NEVER(...), and/or +** testcase(...) where the argument contains side effects. +** +** Print error messages whenever a side effect is found. Return the number +** of problems seen. +*/ +static unsigned int findAllSideEffects(const char *z){ + unsigned int lineno = 1; /* Line number */ + unsigned int i; + unsigned int nErr = 0; + char c, prevC = 0; + for(i=0; (c = z[i])!=0; prevC=c, i++){ + if( c=='\n' ){ lineno++; continue; } + if( isalpha(c) && !isalpha(prevC) ){ + if( strncmp(&z[i],"assert(",7)==0 + || strncmp(&z[i],"ALWAYS(",7)==0 + || strncmp(&z[i],"NEVER(",6)==0 + || strncmp(&z[i],"testcase(",9)==0 + ){ + unsigned int j, n; + const char *z2 = &z[i+5]; + while( z2[0]!='(' ){ z2++; } + z2++; + n = findCloseParen(z2); + if( hasSideEffect(z2, n) ){ + nErr++; + fprintf(stderr, "side-effect line %u: %.*s\n", lineno, + (int)(&z2[n+1] - &z[i]), &z[i]); + } + } + } + } + return nErr; +} + +int main(int argc, char **argv){ + char *z; + unsigned int nErr = 0; + if( argc!=2 ){ + fprintf(stderr, "Usage: %s FILENAME\n", argv[0]); + return 1; + } + z = readFile(argv[1]); + nErr = findAllSideEffects(z); + free(z); + if( nErr ){ + fprintf(stderr, "Found %u undesirable side-effects\n", nErr); + return 1; + } + return 0; +} From fd0d93fd71b2c9f1f889bb2e2022a1119a2b52bd Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 7 Feb 2016 00:08:08 +0000 Subject: [PATCH 09/18] Add the sourcetest target to Makefile.msc. FossilOrigin-Name: ab269e720552483c5617906837e294c1be3e0a57 --- Makefile.msc | 10 ++++++++-- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/srcck1.c | 1 + 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 3427b8177a..0ba00d89c7 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -1393,6 +1393,12 @@ $(SQLITE3EXE): $(TOP)\src\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_S sqldiff.exe: $(TOP)\tool\sqldiff.c $(SQLITE3C) $(SQLITE3H) $(LTLINK) $(NO_WARN) $(TOP)\tool\sqldiff.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) +srcck1.exe: $(TOP)\tool\srcck1.c + $(BCC) $(NO_WARN) -Fe$@ $(TOP)\tool\srcck1.c + +sourcetest: srcck1.exe sqlite3.c + srcck1.exe sqlite3.c + fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H) $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) @@ -1916,14 +1922,14 @@ fastfuzztest: fuzzcheck.exe # Minimal testing that runs in less than 3 minutes (on a fast machine) # -quicktest: testfixture.exe +quicktest: testfixture.exe sourcetest @set PATH=$(LIBTCLPATH);$(PATH) .\testfixture.exe $(TOP)\test\extraquick.test $(TESTOPTS) # This is the common case. Run many tests that do not take too long, # including fuzzcheck, sqlite3_analyzer, and sqldiff tests. # -test: $(TESTPROGS) fastfuzztest +test: $(TESTPROGS) sourcetest fastfuzztest @set PATH=$(LIBTCLPATH);$(PATH) .\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS) diff --git a/manifest b/manifest index 9220387b53..3a81b43628 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -C Add\sa\sutility\sprogram\sthat\slooks\sfor\sassert(),\sNEVER(),\sALWAYS(),\sand\ntestcase()\smacros\sthat\shave\sside-effects,\sand\sreports\serrors\swhen\sthey\sare\nfound.\s\sAlso\sfix\sa\sbug\sthat\sthis\sutility\sdetected\sas\sit\swas\sbeing\stested. -D 2016-02-06T22:32:06.228 +C Add\sthe\ssourcetest\starget\sto\sMakefile.msc. +D 2016-02-07T00:08:08.480 F Makefile.in 0a957a57243a3d55e96b1514e22ffae5db9ea116 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.msc 72b7858f02017611c3ac1ddc965251017fed0845 +F Makefile.msc a3f8092763bb5d0057f0f4feb6b7fcc19713e107 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION 866588d1edf0ccb5b0d33896974338f97564f719 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -1416,7 +1416,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/sqldiff.c 5a26205111e6fa856d9b1535b1637744dcdb930b -F tool/srcck1.c 3119733530abcef14f1b0603c66207a342936263 +F tool/srcck1.c 0522865656ed7f89a8acdcfa6ba2d4f898f4e55c F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43 F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d F tool/symbols.sh fec58532668296d7c7dc48be9c87f75ccdb5814f @@ -1427,7 +1427,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 2f7778e64d93ef237e23ceac01ea9808df5cf2a1 -R e75f025e263d6165f7cd0bcd65f5ad12 +P b0b4624fc5d53bb0cc9fae7dad51984837d946ac +R 08c9d9815def36a9ada11c24d7dc13cb U drh -Z 663376736f9ceb33b8ce1b1cb94df97c +Z 21cfff4994071e02bdb1eef8143a0ef4 diff --git a/manifest.uuid b/manifest.uuid index 20460304dd..16127e2758 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b0b4624fc5d53bb0cc9fae7dad51984837d946ac \ No newline at end of file +ab269e720552483c5617906837e294c1be3e0a57 \ No newline at end of file diff --git a/tool/srcck1.c b/tool/srcck1.c index cd4b4990b9..ae19fbebaa 100644 --- a/tool/srcck1.c +++ b/tool/srcck1.c @@ -22,6 +22,7 @@ #include #include #include +#include /* Read the complete text of a file into memory. Return a pointer to ** the result. Panic if unable to read the file or allocate memory. From 27b6997e9cec6ef3a27e54925db1e377a2903e75 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Sun, 7 Feb 2016 20:39:27 +0000 Subject: [PATCH 10/18] Fix harmless compiler warning in 'srcck1' tool and add it to the clean targets. FossilOrigin-Name: 852a529a8b112049f67a3126f677c06ae4a22d73 --- Makefile.in | 1 + Makefile.msc | 2 +- main.mk | 1 + manifest | 20 ++++++++++---------- manifest.uuid | 2 +- tool/srcck1.c | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index f0c78a4ee7..54f7643327 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1225,6 +1225,7 @@ clean: rm -f sqlite-*-output.vsix rm -f mptester mptester.exe rm -f rbu rbu.exe + rm -f srcck1 srcck1.exe rm -f fuzzershell fuzzershell.exe rm -f fuzzcheck fuzzcheck.exe rm -f sqldiff sqldiff.exe diff --git a/Makefile.msc b/Makefile.msc index 0ba00d89c7..aacacbcec3 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -2016,7 +2016,7 @@ clean: del /Q testfixture.exe test.db 2>NUL del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL - del /Q mptester.exe wordcount.exe rbu.exe 2>NUL + del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL del /Q $(SQLITE3EXE) $(SQLITE3DLL) sqlite3.def 2>NUL del /Q sqlite3.c sqlite3-*.c 2>NUL del /Q sqlite3rc.h 2>NUL diff --git a/main.mk b/main.mk index f4cbbdbb95..149f94e209 100644 --- a/main.mk +++ b/main.mk @@ -899,6 +899,7 @@ clean: rm -f speedtest1 speedtest1.exe rm -f wordcount wordcount.exe rm -f rbu rbu.exe + rm -f srcck1 srcck1.exe rm -f sqlite3.c sqlite3-*.c fts?amal.c tclsqlite3.c rm -f sqlite3rc.h rm -f shell.c sqlite3ext.h diff --git a/manifest b/manifest index 3a81b43628..dbd577f123 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -C Add\sthe\ssourcetest\starget\sto\sMakefile.msc. -D 2016-02-07T00:08:08.480 -F Makefile.in 0a957a57243a3d55e96b1514e22ffae5db9ea116 +C Fix\sharmless\scompiler\swarning\sin\s'srcck1'\stool\sand\sadd\sit\sto\sthe\sclean\stargets. +D 2016-02-07T20:39:27.144 +F Makefile.in dac2776c84e0d533b158a9af6e57e05c4a6b19f3 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.msc a3f8092763bb5d0057f0f4feb6b7fcc19713e107 +F Makefile.msc fcf377286d910b47e072da1ac7945976337c0925 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION 866588d1edf0ccb5b0d33896974338f97564f719 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -272,7 +272,7 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk f51c0652d2a623160e90a758e01312a6a00f3454 +F main.mk 37497b06d3e3acb2c71675d76627a3b2639c6db0 F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 @@ -1416,7 +1416,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/sqldiff.c 5a26205111e6fa856d9b1535b1637744dcdb930b -F tool/srcck1.c 0522865656ed7f89a8acdcfa6ba2d4f898f4e55c +F tool/srcck1.c 4c39bdfa9a92edd20233ee720df84dbeb2417602 F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43 F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d F tool/symbols.sh fec58532668296d7c7dc48be9c87f75ccdb5814f @@ -1427,7 +1427,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 b0b4624fc5d53bb0cc9fae7dad51984837d946ac -R 08c9d9815def36a9ada11c24d7dc13cb -U drh -Z 21cfff4994071e02bdb1eef8143a0ef4 +P ab269e720552483c5617906837e294c1be3e0a57 +R b0244c1b9f3d2cf89729e9f132d42a5e +U mistachkin +Z 9a8eb772a0a9cfffcb8487b60e9945a2 diff --git a/manifest.uuid b/manifest.uuid index 16127e2758..3f741fdf8b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ab269e720552483c5617906837e294c1be3e0a57 \ No newline at end of file +852a529a8b112049f67a3126f677c06ae4a22d73 \ No newline at end of file diff --git a/tool/srcck1.c b/tool/srcck1.c index ae19fbebaa..e95765185f 100644 --- a/tool/srcck1.c +++ b/tool/srcck1.c @@ -124,7 +124,7 @@ static unsigned int findAllSideEffects(const char *z){ || strncmp(&z[i],"NEVER(",6)==0 || strncmp(&z[i],"testcase(",9)==0 ){ - unsigned int j, n; + unsigned int n; const char *z2 = &z[i+5]; while( z2[0]!='(' ){ z2++; } z2++; From 8974331fc35a22b48ccf1ca2c709890646f10a3d Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 8 Feb 2016 02:30:50 +0000 Subject: [PATCH 11/18] Demonstrate a much faster sqlite3GetToken() routine by using a lookup table to map initial token characters into a character class. This check-in does not work for EBCDIC. More optimization needed. FossilOrigin-Name: 9115baa1919584dc8ca25bbff54d3b65748a9631 --- manifest | 15 +++--- manifest.uuid | 2 +- src/tokenize.c | 133 ++++++++++++++++++++++++++++++++++--------------- 3 files changed, 102 insertions(+), 48 deletions(-) diff --git a/manifest b/manifest index 3a81b43628..3badb22032 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\ssourcetest\starget\sto\sMakefile.msc. -D 2016-02-07T00:08:08.480 +C Demonstrate\sa\smuch\sfaster\ssqlite3GetToken()\sroutine\sby\susing\sa\slookup\stable\nto\smap\sinitial\stoken\scharacters\sinto\sa\scharacter\sclass.\s\sThis\scheck-in\sdoes\nnot\swork\sfor\sEBCDIC.\s\sMore\soptimization\sneeded. +D 2016-02-08T02:30:50.194 F Makefile.in 0a957a57243a3d55e96b1514e22ffae5db9ea116 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc a3f8092763bb5d0057f0f4feb6b7fcc19713e107 @@ -406,7 +406,7 @@ F src/test_windirent.c 8f5fada630348558d5745b334702f301da1ffc61 F src/test_windirent.h b12055cab6227f7be10f5c19296f67c60cc5e2a5 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/threads.c bbfb74450643cb5372a43ad4f6cffd7e9dfcecb0 -F src/tokenize.c 214b783d6138e9f9fbb6b225ce9a376db3b03d42 +F src/tokenize.c b3cfc123d65a5bf7ba615f74f28737ae2135620a F src/treeview.c dc39ccf04e9331237388b9cb73289c9d87ea050b F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280 F src/update.c 310ca7adb86a7d1f2afae46905b21c83580f3e17 @@ -1427,7 +1427,10 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b0b4624fc5d53bb0cc9fae7dad51984837d946ac -R 08c9d9815def36a9ada11c24d7dc13cb +P ab269e720552483c5617906837e294c1be3e0a57 +R de21eeb460827c84c88aec10967c3b1d +T *branch * tokenizer-char-class +T *sym-tokenizer-char-class * +T -sym-trunk * U drh -Z 21cfff4994071e02bdb1eef8143a0ef4 +Z 8982f608f7ca1f17154501e0dba47865 diff --git a/manifest.uuid b/manifest.uuid index 16127e2758..9b08cb07e9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ab269e720552483c5617906837e294c1be3e0a57 \ No newline at end of file +9115baa1919584dc8ca25bbff54d3b65748a9631 \ No newline at end of file diff --git a/src/tokenize.c b/src/tokenize.c index 5bee3d5a84..c4b36c4758 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -18,6 +18,56 @@ #include "sqliteInt.h" #include +/* Character classes for tokenizing */ +#define CC_X 0 /* The letter 'x' or 'X'. Start of x'01234fed' */ +#define CC_KYWD 1 /* Alphabetics or '_'. Usable in a keyword */ +#define CC_ID 2 /* unicode characters usable in IDs */ +#define CC_DIGIT 3 /* Digits */ +#define CC_DOLLAR 4 /* '$' */ +#define CC_VARALPHA 5 /* '@', '#', ':'. Alphabetic SQL variables */ +#define CC_VARNUM 6 /* '?'. Numeric SQL variables */ +#define CC_SPACE 7 /* Space characters */ +#define CC_QUOTE 8 /* '"', '\'', or '`'. String literals, quoted ids */ +#define CC_QUOTE2 9 /* '['. [...] style quoted ids */ +#define CC_PIPE 10 /* '|'. Bitwise OR or concatenate */ +#define CC_MINUS 11 /* '-'. Minus or SQL-style comment */ +#define CC_LT 12 /* '<'. Part of < or <= or <> */ +#define CC_GT 13 /* '>'. Part of > or >= */ +#define CC_EQ 14 /* '='. Part of = or == */ +#define CC_BANG 15 /* '!'. Part of != */ +#define CC_SLASH 16 /* '/'. / or c-style comment */ +#define CC_LP 17 /* '(' */ +#define CC_RP 18 /* ')' */ +#define CC_SEMI 19 /* ';' */ +#define CC_PLUS 20 /* '+' */ +#define CC_STAR 21 /* '*' */ +#define CC_PERCENT 22 /* '%' */ +#define CC_COMMA 23 /* ',' */ +#define CC_AND 24 /* '&' */ +#define CC_TILDA 25 /* '~' */ +#define CC_DOT 26 /* '.' */ +#define CC_ILLEGAL 27 /* Illegal character */ + +static const unsigned char aiClass[] = { +/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */ +/* 0x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 7, 7, 27, 7, 7, 27, 27, +/* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +/* 2x */ 7, 15, 8, 5, 4, 22, 24, 8, 17, 18, 21, 20, 23, 11, 26, 16, +/* 3x */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 19, 12, 14, 13, 6, +/* 4x */ 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +/* 5x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 9, 27, 27, 27, 1, +/* 6x */ 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +/* 7x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 27, 10, 27, 25, 27, +/* 8x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* 9x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* Ax */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* Bx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* Cx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* Dx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* Ex */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, +/* Fx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; + /* ** The charMap() macro maps alphabetic characters into their ** lower-case ASCII equivalent. On ASCII machines, this is just @@ -115,8 +165,8 @@ int sqlite3IsIdChar(u8 c){ return IdChar(c); } */ int sqlite3GetToken(const unsigned char *z, int *tokenType){ int i, c; - switch( *z ){ - case ' ': case '\t': case '\n': case '\f': case '\r': { + switch( aiClass[*z] ){ + case CC_SPACE: { testcase( z[0]==' ' ); testcase( z[0]=='\t' ); testcase( z[0]=='\n' ); @@ -126,7 +176,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_SPACE; return i; } - case '-': { + case CC_MINUS: { if( z[1]=='-' ){ for(i=2; (c=z[i])!=0 && c!='\n'; i++){} *tokenType = TK_SPACE; /* IMP: R-22934-25134 */ @@ -135,27 +185,27 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_MINUS; return 1; } - case '(': { + case CC_LP: { *tokenType = TK_LP; return 1; } - case ')': { + case CC_RP: { *tokenType = TK_RP; return 1; } - case ';': { + case CC_SEMI: { *tokenType = TK_SEMI; return 1; } - case '+': { + case CC_PLUS: { *tokenType = TK_PLUS; return 1; } - case '*': { + case CC_STAR: { *tokenType = TK_STAR; return 1; } - case '/': { + case CC_SLASH: { if( z[1]!='*' || z[2]==0 ){ *tokenType = TK_SLASH; return 1; @@ -165,15 +215,15 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_SPACE; /* IMP: R-22934-25134 */ return i; } - case '%': { + case CC_PERCENT: { *tokenType = TK_REM; return 1; } - case '=': { + case CC_EQ: { *tokenType = TK_EQ; return 1 + (z[1]=='='); } - case '<': { + case CC_LT: { if( (c=z[1])=='=' ){ *tokenType = TK_LE; return 2; @@ -188,7 +238,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return 1; } } - case '>': { + case CC_GT: { if( (c=z[1])=='=' ){ *tokenType = TK_GE; return 2; @@ -200,7 +250,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return 1; } } - case '!': { + case CC_BANG: { if( z[1]!='=' ){ *tokenType = TK_ILLEGAL; return 2; @@ -209,7 +259,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return 2; } } - case '|': { + case CC_PIPE: { if( z[1]!='|' ){ *tokenType = TK_BITOR; return 1; @@ -218,21 +268,19 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return 2; } } - case ',': { + case CC_COMMA: { *tokenType = TK_COMMA; return 1; } - case '&': { + case CC_AND: { *tokenType = TK_BITAND; return 1; } - case '~': { + case CC_TILDA: { *tokenType = TK_BITNOT; return 1; } - case '`': - case '\'': - case '"': { + case CC_QUOTE: { int delim = z[0]; testcase( delim=='`' ); testcase( delim=='\'' ); @@ -257,7 +305,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return i; } } - case '.': { + case CC_DOT: { #ifndef SQLITE_OMIT_FLOATING_POINT if( !sqlite3Isdigit(z[1]) ) #endif @@ -268,8 +316,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ /* If the next character is a digit, this is a floating point ** number that begins with ".". Fall thru into the next case */ } - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': { + case CC_DIGIT: { testcase( z[0]=='0' ); testcase( z[0]=='1' ); testcase( z[0]=='2' ); testcase( z[0]=='3' ); testcase( z[0]=='4' ); testcase( z[0]=='5' ); testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' ); @@ -304,22 +351,18 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ } return i; } - case '[': { + case CC_QUOTE2: { for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} *tokenType = c==']' ? TK_ID : TK_ILLEGAL; return i; } - case '?': { + case CC_VARNUM: { *tokenType = TK_VARIABLE; for(i=1; sqlite3Isdigit(z[i]); i++){} return i; } -#ifndef SQLITE_OMIT_TCL_VARIABLE - case '$': -#endif - case '@': /* For compatibility with MS SQL Server */ - case '#': - case ':': { + case CC_DOLLAR: + case CC_VARALPHA: { int n = 0; testcase( z[0]=='$' ); testcase( z[0]=='@' ); testcase( z[0]==':' ); testcase( z[0]=='#' ); @@ -349,7 +392,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return i; } #ifndef SQLITE_OMIT_BLOB_LITERAL - case 'x': case 'X': { + case CC_X: { testcase( z[0]=='x' ); testcase( z[0]=='X' ); if( z[1]=='\'' ){ *tokenType = TK_BLOB; @@ -361,20 +404,28 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ if( z[i] ) i++; return i; } - /* Otherwise fall through to the next case */ + i = 1; + break; } #endif - default: { - if( !IdChar(*z) ){ - break; - } - for(i=1; IdChar(z[i]); i++){} + case CC_KYWD: { + for(i=1; aiClass[z[i]]<=CC_KYWD; i++){} + if( aiClass[z[i]]<=CC_DOLLAR ){ i++; break; } *tokenType = TK_ID; return keywordCode((char*)z, i, tokenType); } + case CC_ID: { + i = 1; + break; + } + default: { + *tokenType = TK_ILLEGAL; + return 1; + } } - *tokenType = TK_ILLEGAL; - return 1; + while( aiClass[z[i]]<=CC_DOLLAR ){ i++; } + *tokenType = TK_ID; + return i; } /* From 41aab89b3123f9b7ffcb59d3e57528c88d2f50eb Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 8 Feb 2016 03:23:46 +0000 Subject: [PATCH 12/18] Faster keywordCode() implementation by taking advantage of the fact that the input is always pure ASCII alphabetic and underscore and that the keyword table is always upper-case. FossilOrigin-Name: ff406b9701ebe3a01834837f380641c6f0c495bc --- manifest | 15 ++++++--------- manifest.uuid | 2 +- tool/mkkeywordhash.c | 17 ++++++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/manifest b/manifest index 3badb22032..a3d1184319 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Demonstrate\sa\smuch\sfaster\ssqlite3GetToken()\sroutine\sby\susing\sa\slookup\stable\nto\smap\sinitial\stoken\scharacters\sinto\sa\scharacter\sclass.\s\sThis\scheck-in\sdoes\nnot\swork\sfor\sEBCDIC.\s\sMore\soptimization\sneeded. -D 2016-02-08T02:30:50.194 +C Faster\skeywordCode()\simplementation\sby\staking\sadvantage\sof\sthe\sfact\sthat\nthe\sinput\sis\salways\spure\sASCII\salphabetic\sand\sunderscore\sand\sthat\sthe\skeyword\ntable\sis\salways\supper-case. +D 2016-02-08T03:23:46.173 F Makefile.in 0a957a57243a3d55e96b1514e22ffae5db9ea116 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc a3f8092763bb5d0057f0f4feb6b7fcc19713e107 @@ -1383,7 +1383,7 @@ F tool/lempar.c 3ec1463a034b37d87d782be5f6b8b10a3b1ecbe7 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh a29b14d54302b33fd892958f6895582ea90e4a45 -F tool/mkkeywordhash.c 06ec0b78bd4fa68c12d90ef2bdfe76b039133ff8 +F tool/mkkeywordhash.c 4451824f4f68f8e8d89eba080e0c1a9cf83f7b62 F tool/mkmsvcmin.tcl d57e6efc9428605f5418d0b235721ddf7b5d9c0b F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c F tool/mkopcodeh.tcl 385c62d78c38b2d92146dcb5abd319dbbc33506d @@ -1427,10 +1427,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 ab269e720552483c5617906837e294c1be3e0a57 -R de21eeb460827c84c88aec10967c3b1d -T *branch * tokenizer-char-class -T *sym-tokenizer-char-class * -T -sym-trunk * +P 9115baa1919584dc8ca25bbff54d3b65748a9631 +R b013689cd0826a67d194ddf9700064de U drh -Z 8982f608f7ca1f17154501e0dba47865 +Z b5dc027d5e497c867b371327464bbd96 diff --git a/manifest.uuid b/manifest.uuid index 9b08cb07e9..290fa630a8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9115baa1919584dc8ca25bbff54d3b65748a9631 \ No newline at end of file +ff406b9701ebe3a01834837f380641c6f0c495bc \ No newline at end of file diff --git a/tool/mkkeywordhash.c b/tool/mkkeywordhash.c index 003ed7d66e..43455ef97c 100644 --- a/tool/mkkeywordhash.c +++ b/tool/mkkeywordhash.c @@ -565,20 +565,23 @@ int main(int argc, char **argv){ } printf("%s };\n", j==0 ? "" : "\n"); - printf(" int h, i;\n"); + printf(" int h, i, j;\n"); + printf(" const char *zKW;\n"); printf(" if( n>=2 ){\n"); printf(" h = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n) %% %d;\n", bestSize); printf(" for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n"); - printf(" if( aLen[i]==n &&" - " sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n"); + printf(" if( aLen[i]!=n ) continue;\n"); + printf(" j = 0;\n"); + printf(" zKW = &zText[aOffset[i]];\n"); + printf(" while( j Date: Mon, 8 Feb 2016 19:15:48 +0000 Subject: [PATCH 13/18] Add code to get the tokenizer character-class logic working for EBCDIC. FossilOrigin-Name: 04f7da77c13925c1f1e287f4579bb85518297d81 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/tokenize.c | 42 ++++++++++++++++++++++++++++++++++++------ tool/mkkeywordhash.c | 16 ++++++++++++---- 4 files changed, 56 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index a3d1184319..180d6f2232 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Faster\skeywordCode()\simplementation\sby\staking\sadvantage\sof\sthe\sfact\sthat\nthe\sinput\sis\salways\spure\sASCII\salphabetic\sand\sunderscore\sand\sthat\sthe\skeyword\ntable\sis\salways\supper-case. -D 2016-02-08T03:23:46.173 +C Add\scode\sto\sget\sthe\stokenizer\scharacter-class\slogic\sworking\sfor\sEBCDIC. +D 2016-02-08T19:15:48.295 F Makefile.in 0a957a57243a3d55e96b1514e22ffae5db9ea116 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc a3f8092763bb5d0057f0f4feb6b7fcc19713e107 @@ -406,7 +406,7 @@ F src/test_windirent.c 8f5fada630348558d5745b334702f301da1ffc61 F src/test_windirent.h b12055cab6227f7be10f5c19296f67c60cc5e2a5 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/threads.c bbfb74450643cb5372a43ad4f6cffd7e9dfcecb0 -F src/tokenize.c b3cfc123d65a5bf7ba615f74f28737ae2135620a +F src/tokenize.c 5019666f8705e9f7135c6f1c1ffac95a1af76fa6 F src/treeview.c dc39ccf04e9331237388b9cb73289c9d87ea050b F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280 F src/update.c 310ca7adb86a7d1f2afae46905b21c83580f3e17 @@ -1383,7 +1383,7 @@ F tool/lempar.c 3ec1463a034b37d87d782be5f6b8b10a3b1ecbe7 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/mkautoconfamal.sh a29b14d54302b33fd892958f6895582ea90e4a45 -F tool/mkkeywordhash.c 4451824f4f68f8e8d89eba080e0c1a9cf83f7b62 +F tool/mkkeywordhash.c f7f3b342211ac6a14258b9726d5b97cf4f548f22 F tool/mkmsvcmin.tcl d57e6efc9428605f5418d0b235721ddf7b5d9c0b F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c F tool/mkopcodeh.tcl 385c62d78c38b2d92146dcb5abd319dbbc33506d @@ -1427,7 +1427,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 9115baa1919584dc8ca25bbff54d3b65748a9631 -R b013689cd0826a67d194ddf9700064de +P ff406b9701ebe3a01834837f380641c6f0c495bc +R f322e625886c02a1fcd0df28b2c76f16 U drh -Z b5dc027d5e497c867b371327464bbd96 +Z 8351e730f91ff26fa5b93d74f8f175a3 diff --git a/manifest.uuid b/manifest.uuid index 290fa630a8..96aac98d14 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ff406b9701ebe3a01834837f380641c6f0c495bc \ No newline at end of file +04f7da77c13925c1f1e287f4579bb85518297d81 \ No newline at end of file diff --git a/src/tokenize.c b/src/tokenize.c index c4b36c4758..68e7b45172 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -18,7 +18,14 @@ #include "sqliteInt.h" #include -/* Character classes for tokenizing */ +/* Character classes for tokenizing +** +** In the sqlite3GetToken() function, a switch() on aiClass[c] is implemented +** using a lookup table, whereas a switch() directly on c uses a binary search. +** The lookup table is much faster. To maximize speed, and to ensure that +** a lookup table is used, all of the classes need to be small integers and +** all of them need to be used within the switch. +*/ #define CC_X 0 /* The letter 'x' or 'X'. Start of x'01234fed' */ #define CC_KYWD 1 /* Alphabetics or '_'. Usable in a keyword */ #define CC_ID 2 /* unicode characters usable in IDs */ @@ -49,6 +56,7 @@ #define CC_ILLEGAL 27 /* Illegal character */ static const unsigned char aiClass[] = { +#ifdef SQLITE_ASCII /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */ /* 0x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 7, 7, 27, 7, 7, 27, 27, /* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, @@ -66,14 +74,36 @@ static const unsigned char aiClass[] = { /* Dx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* Ex */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* Fx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +#endif +#ifdef SQLITE_EBCDIC +/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */ +/* 0x */ 27, 27, 27, 27, 27, 7, 27, 27, 27, 27, 27, 27, 7, 7, 27, 27, +/* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +/* 2x */ 27, 27, 27, 27, 27, 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +/* 3x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +/* 4x */ 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 12, 17, 20, 10, +/* 5x */ 24, 27, 27, 27, 27, 27, 27, 27, 27, 27, 15, 4, 21, 18, 19, 27, +/* 6x */ 11, 16, 27, 27, 27, 27, 27, 27, 27, 27, 27, 23, 22, 1, 13, 7, +/* 7x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 8, 5, 5, 5, 8, 14, 8, +/* 8x */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27, +/* 9x */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27, +/* 9x */ 25, 1, 1, 1, 1, 1, 1, 0, 1, 1, 27, 27, 27, 27, 27, 27, +/* Bx */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 9, 27, 27, 27, 27, 27, +/* Cx */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27, +/* Dx */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27, +/* Ex */ 27, 27, 1, 1, 1, 1, 1, 0, 1, 1, 27, 27, 27, 27, 27, 27, +/* Fx */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 27, 27, 27, 27, 27, 27, +#endif }; /* -** The charMap() macro maps alphabetic characters into their +** The charMap() macro maps alphabetic characters (only) into their ** lower-case ASCII equivalent. On ASCII machines, this is just ** an upper-to-lower case map. On EBCDIC machines we also need -** to adjust the encoding. Only alphabetic characters and underscores -** need to be translated. +** to adjust the encoding. The mapping is only valid for alphabetics +** which are the only characters for which this feature is used. +** +** Used by keywordhash.h */ #ifdef SQLITE_ASCII # define charMap(X) sqlite3UpperToLower[(unsigned char)X] @@ -410,7 +440,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ #endif case CC_KYWD: { for(i=1; aiClass[z[i]]<=CC_KYWD; i++){} - if( aiClass[z[i]]<=CC_DOLLAR ){ i++; break; } + if( IdChar(z[i]) ){ i++; break; } *tokenType = TK_ID; return keywordCode((char*)z, i, tokenType); } @@ -423,7 +453,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ return 1; } } - while( aiClass[z[i]]<=CC_DOLLAR ){ i++; } + while( IdChar(z[i]) ){ i++; } *tokenType = TK_ID; return i; } diff --git a/tool/mkkeywordhash.c b/tool/mkkeywordhash.c index 43455ef97c..7e5287ea54 100644 --- a/tool/mkkeywordhash.c +++ b/tool/mkkeywordhash.c @@ -277,7 +277,10 @@ static Keyword aKeywordTable[] = { /* Number of keywords */ static int nKeyword = (sizeof(aKeywordTable)/sizeof(aKeywordTable[0])); -/* Map all alphabetic characters into the same case */ +/* Map all alphabetic characters into lower-case for hashing. This is +** only valid for alphabetics. In particular it does not work for '_' +** and so the hash cannot be on a keyword position that might be an '_'. +*/ #define charMap(X) (0x20|(X)) /* @@ -565,16 +568,21 @@ int main(int argc, char **argv){ } printf("%s };\n", j==0 ? "" : "\n"); - printf(" int h, i, j;\n"); + printf(" int i, j;\n"); printf(" const char *zKW;\n"); printf(" if( n>=2 ){\n"); - printf(" h = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n) %% %d;\n", + printf(" i = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n) %% %d;\n", bestSize); - printf(" for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){\n"); + printf(" for(i=((int)aHash[i])-1; i>=0; i=((int)aNext[i])-1){\n"); printf(" if( aLen[i]!=n ) continue;\n"); printf(" j = 0;\n"); printf(" zKW = &zText[aOffset[i]];\n"); + printf("#ifdef SQLITE_ASCII\n"); printf(" while( j Date: Mon, 8 Feb 2016 19:40:17 +0000 Subject: [PATCH 14/18] Disable the two-argument form of the fts3_tokenizer() SQL function unless the library is built with -DSQLITE_ENABLE_FTS3_TOKENIZER. FossilOrigin-Name: e0eb217aca7e4aadf9c44ed20822b78139f7c83c --- ext/fts3/fts3_tokenizer.c | 12 ++++- manifest | 21 ++++---- manifest.uuid | 2 +- src/test_config.c | 6 +++ test/fts3atoken.test | 110 ++++++++++++++++++++------------------ test/fts4langid.test | 46 ++++++++-------- 6 files changed, 111 insertions(+), 86 deletions(-) diff --git a/ext/fts3/fts3_tokenizer.c b/ext/fts3/fts3_tokenizer.c index 64cfe07aac..26bac57648 100644 --- a/ext/fts3/fts3_tokenizer.c +++ b/ext/fts3/fts3_tokenizer.c @@ -67,6 +67,7 @@ static void scalarFunc( nName = sqlite3_value_bytes(argv[0])+1; if( argc==2 ){ +#ifdef SQLITE_ENABLE_FTS3_TOKENIZER void *pOld; int n = sqlite3_value_bytes(argv[1]); if( zName==0 || n!=sizeof(pPtr) ){ @@ -79,7 +80,14 @@ static void scalarFunc( sqlite3_result_error(context, "out of memory", -1); return; } - }else{ +#else + sqlite3_result_error(context, "fts3tokenize: " + "disabled - rebuild with -DSQLITE_ENABLE_FTS3_TOKENIZER", -1 + ); + return; +#endif /* SQLITE_ENABLE_FTS3_TOKENIZER */ + }else + { if( zName ){ pPtr = sqlite3Fts3HashFind(pHash, zName, nName); } @@ -420,11 +428,13 @@ static void intTestFunc( assert( 0==strcmp(sqlite3_errmsg(db), "unknown tokenizer: nosuchtokenizer") ); /* Test the storage function */ +#ifdef SQLITE_ENABLE_FTS3_TOKENIZER rc = registerTokenizer(db, "nosuchtokenizer", p1); assert( rc==SQLITE_OK ); rc = queryTokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_OK ); assert( p2==p1 ); +#endif sqlite3_result_text(context, "ok", -1, SQLITE_STATIC); } diff --git a/manifest b/manifest index 2902207223..2ad9b86f00 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Changes\sto\shelp\sthe\stokenizer\srun\sabout\s33%\sfaster. -D 2016-02-08T19:36:46.659 +C Disable\sthe\stwo-argument\sform\sof\sthe\sfts3_tokenizer()\sSQL\sfunction\sunless\sthe\slibrary\sis\sbuilt\swith\s-DSQLITE_ENABLE_FTS3_TOKENIZER. +D 2016-02-08T19:40:17.991 F Makefile.in dac2776c84e0d533b158a9af6e57e05c4a6b19f3 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc fcf377286d910b47e072da1ac7945976337c0925 @@ -83,7 +83,7 @@ F ext/fts3/fts3_snippet.c 68ae118b0f834ea53d2b89e4087fc0f0b8c4ee4e F ext/fts3/fts3_term.c 88c55a6fa1a51ab494e33dced0401a6c28791fd7 F ext/fts3/fts3_test.c 8a3a78c4458b2d7c631fcf4b152a5cd656fa7038 F ext/fts3/fts3_tokenize_vtab.c a27593ab19657166f6fa5ec073b678cc29a75860 -F ext/fts3/fts3_tokenizer.c 50e7a69a549ac5882cc1971ee43f66aaabc11395 +F ext/fts3/fts3_tokenizer.c 0d3a77bbdc6f394d302f24980fa80667371c6e68 F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004 F ext/fts3/fts3_unicode.c a93f5edc0aff44ef8b06d7cb55b52026541ca145 @@ -372,7 +372,7 @@ 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 0dee90328e3dedf8ba002ee94b6a7e7ea7726fe4 +F src/test_config.c 7985332c806d1cece793475c75a6abcccde9d331 F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_fs.c a61f54247fdb843761d709879c3bcd1989b2050c @@ -697,7 +697,7 @@ F test/fts3al.test 07d64326e79bbdbab20ee87fc3328fbf01641c9f F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8 F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18 F test/fts3ao.test 3e4e3d5e75c076520341d0bdf4eb17c00e8cbde2 -F test/fts3atoken.test e3a126365131a6db52efc20a9a6053cd44e5f289 +F test/fts3atoken.test 76262be798f23a390717d14266f0df551e52a7ee F test/fts3auto.test b981fea19b132b4e6878f50d7c1f369b28f68eb9 F test/fts3aux1.test f8f287a4a73f381f8fa15b6a70f36245f903d221 F test/fts3aux2.test 7ae2b2c13aefdf4169279a27a5f51780ce57f6ba @@ -744,7 +744,7 @@ F test/fts4docid.test e33c383cfbdff0284685604d256f347a18fdbf01 F test/fts4growth.test 60d6bb3f78e25b34f533797dd9f2f9402310a13a F test/fts4growth2.test 13ad4e76451af6e6906c95cdc725d01b00044269 F test/fts4incr.test 4e353a0bd886ea984e56fce9e77724fc923b8d0d -F test/fts4langid.test 24a6e41063b416bbdf371ff6b4476fa41c194aa7 +F test/fts4langid.test 8bd8759e0d4b04d71771544b861193a6841fee84 F test/fts4merge.test c424309743fdd203f8e56a1f1cd7872cd66cc0ee F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891 F test/fts4merge3.test aab02a09f50fe6baaddc2e159c3eabc116d45fc7 @@ -1427,8 +1427,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 852a529a8b112049f67a3126f677c06ae4a22d73 04f7da77c13925c1f1e287f4579bb85518297d81 -R 64edf86f87d772039cf70265114474cb -T +closed 04f7da77c13925c1f1e287f4579bb85518297d81 -U drh -Z feb6daf33d3b967be60d8c209f5e5987 +P a050e6f096d40aa5b6275797b96e62c228044f5a +R b09b6ba902e95153c88d724675282802 +U dan +Z a5b8919de2cf0c2997cac75a4e3c3a2c diff --git a/manifest.uuid b/manifest.uuid index dc1ddc7e40..fcaa3cc3b9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a050e6f096d40aa5b6275797b96e62c228044f5a \ No newline at end of file +e0eb217aca7e4aadf9c44ed20822b78139f7c83c \ No newline at end of file diff --git a/src/test_config.c b/src/test_config.c index 30b421e00b..5db7117555 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -370,6 +370,12 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY); #endif +#ifdef SQLITE_ENABLE_FTS3_TOKENIZER + Tcl_SetVar2(interp, "sqlite_options", "fts3_tokenizer", "1", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar2(interp, "sqlite_options", "fts3_tokenizer", "0", TCL_GLOBAL_ONLY); +#endif + #ifdef SQLITE_ENABLE_FTS5 Tcl_SetVar2(interp, "sqlite_options", "fts5", "1", TCL_GLOBAL_ONLY); #else diff --git a/test/fts3atoken.test b/test/fts3atoken.test index 88e3d4f72b..2cdea79a98 100644 --- a/test/fts3atoken.test +++ b/test/fts3atoken.test @@ -24,7 +24,7 @@ ifcapable !fts3 { return } -set ::testprefix fts3token +set ::testprefix fts3atoken proc escape_string {str} { set out "" @@ -40,7 +40,7 @@ proc escape_string {str} { } #-------------------------------------------------------------------------- -# Test cases fts3token-1.* are the warm-body test for the SQL scalar +# Test cases fts3atoken-1.* are the warm-body test for the SQL scalar # function fts3_tokenizer(). The procedure is as follows: # # 1: Verify that there is no such fts3 tokenizer as 'blah'. @@ -56,62 +56,68 @@ proc escape_string {str} { # # 5: Test that the table created to use tokenizer 'blah' is usable. # -do_test fts3token-1.1 { - catchsql { - CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah); - } -} {1 {unknown tokenizer: blah}} -do_test fts3token-1.2 { - execsql { +ifcapable fts3_tokenizer { + do_test fts3atoken-1.1 { + catchsql { + CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah); + } + } {1 {unknown tokenizer: blah}} + do_test fts3atoken-1.2 { + execsql { + SELECT fts3_tokenizer('blah', fts3_tokenizer('simple')) IS NULL; + } + } {0} + do_test fts3atoken-1.3 { + execsql { + SELECT fts3_tokenizer('blah') == fts3_tokenizer('simple'); + } + } {1} + do_test fts3atoken-1.4 { + catchsql { + CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah); + } + } {0 {}} + do_test fts3atoken-1.5 { + execsql { + INSERT INTO t1(content) VALUES('There was movement at the station'); + INSERT INTO t1(content) VALUES('For the word has passed around'); + INSERT INTO t1(content) VALUES('That the colt from ol regret had got'); + SELECT content FROM t1 WHERE content MATCH 'movement' + } + } {{There was movement at the station}} +} else { + do_catchsql_test 1.6 { SELECT fts3_tokenizer('blah', fts3_tokenizer('simple')) IS NULL; - } -} {0} -do_test fts3token-1.3 { - execsql { - SELECT fts3_tokenizer('blah') == fts3_tokenizer('simple'); - } -} {1} -do_test fts3token-1.4 { - catchsql { - CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize blah); - } -} {0 {}} -do_test fts3token-1.5 { - execsql { - INSERT INTO t1(content) VALUES('There was movement at the station'); - INSERT INTO t1(content) VALUES('For the word has passed around'); - INSERT INTO t1(content) VALUES('That the colt from ol regret had got away'); - SELECT content FROM t1 WHERE content MATCH 'movement' - } -} {{There was movement at the station}} + } {1 {fts3tokenize: disabled - rebuild with -DSQLITE_ENABLE_FTS3_TOKENIZER}} +} #-------------------------------------------------------------------------- -# Test cases fts3token-2.* test error cases in the scalar function based +# Test cases fts3atoken-2.* test error cases in the scalar function based # API for getting and setting tokenizers. # -do_test fts3token-2.1 { +do_test fts3atoken-2.1 { catchsql { SELECT fts3_tokenizer('nosuchtokenizer'); } } {1 {unknown tokenizer: nosuchtokenizer}} #-------------------------------------------------------------------------- -# Test cases fts3token-3.* test the three built-in tokenizers with a +# Test cases fts3atoken-3.* test the three built-in tokenizers with a # simple input string via the built-in test function. This is as much # to test the test function as the tokenizer implementations. # -do_test fts3token-3.1 { +do_test fts3atoken-3.1 { execsql { SELECT fts3_tokenizer_test('simple', 'I don''t see how'); } } {{0 i I 1 don don 2 t t 3 see see 4 how how}} -do_test fts3token-3.2 { +do_test fts3atoken-3.2 { execsql { SELECT fts3_tokenizer_test('porter', 'I don''t see how'); } } {{0 i I 1 don don 2 t t 3 see see 4 how how}} ifcapable icu { - do_test fts3token-3.3 { + do_test fts3atoken-3.3 { execsql { SELECT fts3_tokenizer_test('icu', 'I don''t see how'); } @@ -119,7 +125,7 @@ ifcapable icu { } #-------------------------------------------------------------------------- -# Test cases fts3token-4.* test the ICU tokenizer. In practice, this +# Test cases fts3atoken-4.* test the ICU tokenizer. In practice, this # tokenizer only has two modes - "thai" and "everybody else". Some other # Asian languages (Lao, Khmer etc.) require the same special treatment as # Thai, but ICU doesn't support them yet. @@ -133,8 +139,8 @@ ifcapable icu { } $output } - do_icu_test fts3token-4.1 en_US {} {} - do_icu_test fts3token-4.2 en_US {Test cases fts3} [list \ + do_icu_test fts3atoken-4.1 en_US {} {} + do_icu_test fts3atoken-4.2 en_US {Test cases fts3} [list \ 0 test Test 1 cases cases 2 fts3 fts3 ] @@ -147,12 +153,12 @@ ifcapable icu { append output "1 \u0e19\u0e30 \u0e19\u0e30 " append output "2 \u0e04\u0e23\u0e31\u0e1a \u0e04\u0e23\u0e31\u0e1a" - do_icu_test fts3token-4.3 th_TH $input $output - do_icu_test fts3token-4.4 en_US $input $output + do_icu_test fts3atoken-4.3 th_TH $input $output + do_icu_test fts3atoken-4.4 en_US $input $output # ICU handles an unknown locale by falling back to the default. # So this is not an error. - do_icu_test fts3token-4.5 MiddleOfTheOcean $input $output + do_icu_test fts3atoken-4.5 MiddleOfTheOcean $input $output set longtoken "AReallyReallyLongTokenOneThatWillSurelyRequire" append longtoken "AReallocInTheIcuTokenizerCode" @@ -164,9 +170,9 @@ ifcapable icu { append output "2 then then " append output "3 [string tolower $longtoken] $longtoken" - do_icu_test fts3token-4.6 MiddleOfTheOcean $input $output - do_icu_test fts3token-4.7 th_TH $input $output - do_icu_test fts3token-4.8 en_US $input $output + do_icu_test fts3atoken-4.6 MiddleOfTheOcean $input $output + do_icu_test fts3atoken-4.7 th_TH $input $output + do_icu_test fts3atoken-4.8 en_US $input $output do_execsql_test 5.1 { CREATE VIRTUAL TABLE x1 USING fts3(name,TOKENIZE icu en_US); @@ -186,7 +192,7 @@ ifcapable icu { } {} } -do_test fts3token-internal { +do_test fts3atoken-internal { execsql { SELECT fts3_tokenizer_internal_test() } } {ok} @@ -206,12 +212,14 @@ do_catchsql_test 6.1.3 { do_catchsql_test 6.2.1 { SELECT fts3_tokenizer(NULL); } {1 {unknown tokenizer: }} -do_catchsql_test 6.2.2 { - SELECT fts3_tokenizer(NULL, X'1234567812345678'); -} {1 {argument type mismatch}} -do_catchsql_test 6.2.3 { - SELECT fts3_tokenizer(NULL, X'12345678'); -} {1 {argument type mismatch}} +ifcapable fts3_tokenizer { + do_catchsql_test 6.2.2 { + SELECT fts3_tokenizer(NULL, X'1234567812345678'); + } {1 {argument type mismatch}} + do_catchsql_test 6.2.3 { + SELECT fts3_tokenizer(NULL, X'12345678'); + } {1 {argument type mismatch}} +} finish_test diff --git a/test/fts4langid.test b/test/fts4langid.test index 843e11f9ab..a3059931e7 100644 --- a/test/fts4langid.test +++ b/test/fts4langid.test @@ -358,29 +358,31 @@ proc build_multilingual_db_2 {db} { } } -do_test 4.1.0 { - reset_db - set ptr [fts3_test_tokenizer] - execsql { SELECT fts3_tokenizer('testtokenizer', $ptr) } - build_multilingual_db_2 db -} {} -do_execsql_test 4.1.1 { - SELECT docid FROM t4 WHERE t4 MATCH 'quick'; -} {0} -do_execsql_test 4.1.2 { - SELECT docid FROM t4 WHERE t4 MATCH 'quick' AND lid=1; -} {} -do_execsql_test 4.1.3 { - SELECT docid FROM t4 WHERE t4 MATCH 'Quick' AND lid=1; -} {1} -for {set i 0} {$i < 50} {incr i} { - do_execsql_test 4.1.4.$i { - SELECT count(*) FROM t4 WHERE t4 MATCH 'fox' AND lid=$i; - } [expr 0==($i%2)] +ifcapable fts3_tokenizer { + do_test 4.1.0 { + reset_db + set ptr [fts3_test_tokenizer] + execsql { SELECT fts3_tokenizer('testtokenizer', $ptr) } + build_multilingual_db_2 db + } {} + do_execsql_test 4.1.1 { + SELECT docid FROM t4 WHERE t4 MATCH 'quick'; + } {0} + do_execsql_test 4.1.2 { + SELECT docid FROM t4 WHERE t4 MATCH 'quick' AND lid=1; + } {} + do_execsql_test 4.1.3 { + SELECT docid FROM t4 WHERE t4 MATCH 'Quick' AND lid=1; + } {1} + for {set i 0} {$i < 50} {incr i} { + do_execsql_test 4.1.4.$i { + SELECT count(*) FROM t4 WHERE t4 MATCH 'fox' AND lid=$i; + } [expr 0==($i%2)] + } + do_catchsql_test 4.1.5 { + INSERT INTO t4(content, lid) VALUES('hello world', 101) + } {1 {SQL logic error or missing database}} } -do_catchsql_test 4.1.5 { - INSERT INTO t4(content, lid) VALUES('hello world', 101) -} {1 {SQL logic error or missing database}} #------------------------------------------------------------------------- # Test cases 5.* From 83d7920e551c33cf93c8104cf44fc23117b5414b Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 8 Feb 2016 20:06:52 +0000 Subject: [PATCH 15/18] Fix a compiler warning when compiling without SQLITE_ENABLE_FTS3_TOKENIZER. FossilOrigin-Name: 6926f28cd56bf61f7c92877baa54024bee7cbab5 --- ext/fts3/fts3_tokenizer.c | 3 +++ manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ext/fts3/fts3_tokenizer.c b/ext/fts3/fts3_tokenizer.c index 26bac57648..fcabe5cca2 100644 --- a/ext/fts3/fts3_tokenizer.c +++ b/ext/fts3/fts3_tokenizer.c @@ -336,6 +336,7 @@ finish: Tcl_DecrRefCount(pRet); } +#ifdef SQLITE_ENABLE_FTS3_TOKENIZER static int registerTokenizer( sqlite3 *db, @@ -357,6 +358,8 @@ int registerTokenizer( return sqlite3_finalize(pStmt); } +#endif /* SQLITE_ENABLE_FTS3_TOKENIZER */ + static int queryTokenizer( diff --git a/manifest b/manifest index 2ad9b86f00..7b991aaa7c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Disable\sthe\stwo-argument\sform\sof\sthe\sfts3_tokenizer()\sSQL\sfunction\sunless\sthe\slibrary\sis\sbuilt\swith\s-DSQLITE_ENABLE_FTS3_TOKENIZER. -D 2016-02-08T19:40:17.991 +C Fix\sa\scompiler\swarning\swhen\scompiling\swithout\sSQLITE_ENABLE_FTS3_TOKENIZER. +D 2016-02-08T20:06:52.183 F Makefile.in dac2776c84e0d533b158a9af6e57e05c4a6b19f3 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc fcf377286d910b47e072da1ac7945976337c0925 @@ -83,7 +83,7 @@ F ext/fts3/fts3_snippet.c 68ae118b0f834ea53d2b89e4087fc0f0b8c4ee4e F ext/fts3/fts3_term.c 88c55a6fa1a51ab494e33dced0401a6c28791fd7 F ext/fts3/fts3_test.c 8a3a78c4458b2d7c631fcf4b152a5cd656fa7038 F ext/fts3/fts3_tokenize_vtab.c a27593ab19657166f6fa5ec073b678cc29a75860 -F ext/fts3/fts3_tokenizer.c 0d3a77bbdc6f394d302f24980fa80667371c6e68 +F ext/fts3/fts3_tokenizer.c 4bd72f767f61c9ce5a7575c844e8d1ed2c3c561a F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004 F ext/fts3/fts3_unicode.c a93f5edc0aff44ef8b06d7cb55b52026541ca145 @@ -1427,7 +1427,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 a050e6f096d40aa5b6275797b96e62c228044f5a -R b09b6ba902e95153c88d724675282802 -U dan -Z a5b8919de2cf0c2997cac75a4e3c3a2c +P e0eb217aca7e4aadf9c44ed20822b78139f7c83c +R 3ba2bfd061690101a8667e8fadcc2696 +U drh +Z 2da14d7bb409b5abdcdd912d6af6bf8a diff --git a/manifest.uuid b/manifest.uuid index fcaa3cc3b9..116910222d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e0eb217aca7e4aadf9c44ed20822b78139f7c83c \ No newline at end of file +6926f28cd56bf61f7c92877baa54024bee7cbab5 \ No newline at end of file From c2d0b56e6a7fd298113e857df6012e21189dfa13 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 8 Feb 2016 20:14:41 +0000 Subject: [PATCH 16/18] Fix a signed/unsigned comparison warning in fts5. FossilOrigin-Name: 85eb05ddbc3a7cff986af13c3dab6c0063e62171 --- ext/fts5/fts5_buffer.c | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/fts5/fts5_buffer.c b/ext/fts5/fts5_buffer.c index c3d4101b8b..c552e860eb 100644 --- a/ext/fts5/fts5_buffer.c +++ b/ext/fts5/fts5_buffer.c @@ -16,7 +16,7 @@ #include "fts5Int.h" int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){ - if( pBuf->nSpacenSpacenSpace ? pBuf->nSpace : 64; u8 *pNew; while( nNew Date: Mon, 8 Feb 2016 20:45:37 +0000 Subject: [PATCH 17/18] Fix spelling error in MSVC makefile comments. FossilOrigin-Name: 6eab74c9ae57676044b5bc82fa14e92fd2448008 --- Makefile.msc | 8 ++++---- autoconf/Makefile.msc | 8 ++++---- manifest | 15 +++++++-------- manifest.uuid | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 8d416b77cb..9620ff6237 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -306,7 +306,7 @@ LD = link.exe RC = rc.exe !ENDIF -# Check for the MSVC runtime library path macro. Othertise, this value will +# Check for the MSVC runtime library path macro. Otherwise, this value will # default to the 'lib' directory underneath the MSVC installation directory. # !IFNDEF CRTLIBPATH @@ -343,7 +343,7 @@ NCC = $(NCC:\\=\) NCC = $(CC) !ENDIF -# Check for the MSVC native runtime library path macro. Othertise, +# Check for the MSVC native runtime library path macro. Otherwise, # this value will default to the 'lib' directory underneath the MSVC # installation directory. # @@ -353,7 +353,7 @@ NCRTLIBPATH = $(VCINSTALLDIR)\lib NCRTLIBPATH = $(NCRTLIBPATH:\\=\) -# Check for the Platform SDK library path macro. Othertise, this +# Check for the Platform SDK library path macro. Otherwise, this # value will default to the 'lib' directory underneath the Windows # SDK installation directory (the environment variable used appears # to be available when using Visual C++ 2008 or later via the @@ -365,7 +365,7 @@ NSDKLIBPATH = $(WINDOWSSDKDIR)\lib NSDKLIBPATH = $(NSDKLIBPATH:\\=\) -# Check for the UCRT library path macro. Othertise, this value will +# Check for the UCRT library path macro. Otherwise, this value will # default to the version-specific, platform-specific 'lib' directory # underneath the Windows SDK installation directory. # diff --git a/autoconf/Makefile.msc b/autoconf/Makefile.msc index a4f916f5a7..65f2396180 100644 --- a/autoconf/Makefile.msc +++ b/autoconf/Makefile.msc @@ -291,7 +291,7 @@ LD = link.exe RC = rc.exe !ENDIF -# Check for the MSVC runtime library path macro. Othertise, this value will +# Check for the MSVC runtime library path macro. Otherwise, this value will # default to the 'lib' directory underneath the MSVC installation directory. # !IFNDEF CRTLIBPATH @@ -328,7 +328,7 @@ NCC = $(NCC:\\=\) NCC = $(CC) !ENDIF -# Check for the MSVC native runtime library path macro. Othertise, +# Check for the MSVC native runtime library path macro. Otherwise, # this value will default to the 'lib' directory underneath the MSVC # installation directory. # @@ -338,7 +338,7 @@ NCRTLIBPATH = $(VCINSTALLDIR)\lib NCRTLIBPATH = $(NCRTLIBPATH:\\=\) -# Check for the Platform SDK library path macro. Othertise, this +# Check for the Platform SDK library path macro. Otherwise, this # value will default to the 'lib' directory underneath the Windows # SDK installation directory (the environment variable used appears # to be available when using Visual C++ 2008 or later via the @@ -350,7 +350,7 @@ NSDKLIBPATH = $(WINDOWSSDKDIR)\lib NSDKLIBPATH = $(NSDKLIBPATH:\\=\) -# Check for the UCRT library path macro. Othertise, this value will +# Check for the UCRT library path macro. Otherwise, this value will # default to the version-specific, platform-specific 'lib' directory # underneath the Windows SDK installation directory. # diff --git a/manifest b/manifest index 24eebb58a9..23d68d6a6c 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -C More\swork\son\sWindows\s10\sSDK\sintegration. -D 2016-02-08T20:40:57.726 +C Fix\sspelling\serror\sin\sMSVC\smakefile\scomments. +D 2016-02-08T20:45:37.407 F Makefile.in dac2776c84e0d533b158a9af6e57e05c4a6b19f3 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 -F Makefile.msc 8514a6d7c15fa179b45da902a4ddcf0a8e6748b2 +F Makefile.msc b0493f10caddb8adf992a4e6f1943141fc7c6816 F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7 F VERSION 866588d1edf0ccb5b0d33896974338f97564f719 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -11,7 +11,7 @@ F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am 1c1657650775960804945dc392e14d9e43c5ed84 -F autoconf/Makefile.msc de6d40e0c495d761b9813ccb20a649841f6d6b72 +F autoconf/Makefile.msc a35b2aab24d1603f3f0ae65cf01686c2578d319c F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 F autoconf/README.txt e9757a381e5ce2553dbaa6247bb8ad00eb8d87aa F autoconf/configure.ac 72a5e42beb090b32bca580285dc0ab3c4670adb8 @@ -1427,8 +1427,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 85eb05ddbc3a7cff986af13c3dab6c0063e62171 ebace2c99b6af9230c4bbc31a764c7f397200148 -R 7f11f3c1dcb5601b2c82dcb73372e020 -T +closed ebace2c99b6af9230c4bbc31a764c7f397200148 +P 1e563c6ebbb02d2e89760c7a7f95aa69964629c6 +R 8450aebd4fe3e5df6689a15f6b4c74a5 U mistachkin -Z ac6553c79aaf86d7e04ebeafa308be17 +Z fa8db5a9236f4356c9f0e0ef9af9fdef diff --git a/manifest.uuid b/manifest.uuid index 583f181cdb..def0c6f083 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1e563c6ebbb02d2e89760c7a7f95aa69964629c6 \ No newline at end of file +6eab74c9ae57676044b5bc82fa14e92fd2448008 \ No newline at end of file From 2fade2f7913f948a6b2ad92e2e0e557de53937fe Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 9 Feb 2016 02:12:20 +0000 Subject: [PATCH 18/18] Make sure every co-routines has its own set of temporary registers and does not share temporaries, since a co-routine might expect the content of a temporary register to be preserved across an OP_Yield. Proposed fix for ticket [d06a25c84454a]. FossilOrigin-Name: ca72be8618e5d466d6f35819ca8bbd2b84269959 --- manifest | 24 ++++++++++++------------ manifest.uuid | 2 +- src/build.c | 2 +- src/insert.c | 2 +- src/select.c | 6 +++--- src/vdbe.h | 1 + src/vdbeaux.c | 15 +++++++++++++++ test/select4.test | 20 ++++++++++++++++++++ 8 files changed, 54 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index 23d68d6a6c..69b6e1ba9f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sspelling\serror\sin\sMSVC\smakefile\scomments. -D 2016-02-08T20:45:37.407 +C Make\ssure\severy\sco-routines\shas\sits\sown\sset\sof\stemporary\sregisters\sand\sdoes\nnot\sshare\stemporaries,\ssince\sa\sco-routine\smight\sexpect\sthe\scontent\sof\sa\ntemporary\sregister\sto\sbe\spreserved\sacross\san\sOP_Yield.\nProposed\sfix\sfor\sticket\s[d06a25c84454a]. +D 2016-02-09T02:12:20.490 F Makefile.in dac2776c84e0d533b158a9af6e57e05c4a6b19f3 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b0493f10caddb8adf992a4e6f1943141fc7c6816 @@ -294,7 +294,7 @@ F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73 F src/btree.c 4c8caaeed7878aafdb607c3d2bcbc365bb0d19a1 F src/btree.h 368ceeb4bd9312dc8df2ffd64b4b7dbcf4db5f8e F src/btreeInt.h c18b7d2a3494695133e4e60ee36061d37f45d9a5 -F src/build.c 198eaa849c193f28b802ed135b2483c68ef7a35c +F src/build.c 54866fbafa09d494269bdefc79995eb7207003a6 F src/callback.c ed6c2a4a712eb7287ff64e20e3c23265dfb8a7ce F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f F src/ctime.c 60e135af364d777a9ab41c97e5e89cd224da6198 @@ -309,7 +309,7 @@ F src/global.c bd5a0af3f30b0c01be6db756c626cd3c33a3d260 F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5 F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094 F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08 -F src/insert.c b84359365bace233919db550a15f131923190efc +F src/insert.c 046199e085e69e05af7bef197d53c5b4b402b6fa F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c b1b0880fc474abfab89e737b0ecfde0bd7a60902 F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b @@ -348,7 +348,7 @@ F src/printf.c 63e6fb12bbe702dd664dc3703776c090383a5a26 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c 9f7ce3a3c087afb7597b7c916c99126ff3f12f0c F src/rowset.c 9fe4b3ad7cc00944386bb600233d8f523de07a6e -F src/select.c 57646a44ba9a0bc4aa926ae9c79b8199c246844b +F src/select.c ff80004a9a6ece891a8d9327a88e7b6e2588ee6d F src/shell.c dcd7a83645ef2a58ee9c6d0ea4714d877d7835c4 F src/sqlite.h.in cf22ad1d52dca2c9862d63833e581028119aab7e F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 @@ -414,10 +414,10 @@ F src/utf.c 10cc2519e82e3369344d0969ad4b1a333dc86d18 F src/util.c 49ce0a65306c1c51d61cb5bc214c71cb62452de6 F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701 F src/vdbe.c c193299e595a13eba247738e22fce25c49346a6c -F src/vdbe.h 7a733ea8aac1b77305a67698e784fa3484ee3337 +F src/vdbe.h c743791f723049db94f009e3e30958952bc2d512 F src/vdbeInt.h 4b69d5451bcadd473e745af53ef1e8abfdce0a79 F src/vdbeapi.c 9324f6baee1a1b2284c6543e98f916888a81e459 -F src/vdbeaux.c 49b536284c2b8a823dd342d653e18145ca2b393a +F src/vdbeaux.c deae5d3bd45da0e57c7d9e1d7436333d142dc3bb F src/vdbeblob.c 3b570b730109e8f653d9d2081649f6e7015113db F src/vdbemem.c 68fcfac37dc6601d98c32cc5adee4d39f2c1b7b4 F src/vdbesort.c ef3c6d1f1a7d44cf67bb2bee59ea3d1fe5bad174 @@ -992,7 +992,7 @@ F test/securedel2.test 2d54c28e46eb1fd6902089958b20b1b056c6f1c5 F test/select1.test be62204d2bd9a5a8a149e9974cfddce893d8f686 F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56 F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054 -F test/select4.test 6d5bc6d178a367e8b48fa1c1d3ea12cae9c2d650 +F test/select4.test 453631158540e5f685b81cac5b7e8bd8c6b4c5fc F test/select5.test e758b8ef94f69b111df4cb819008856655dcd535 F test/select6.test 39eac4a5c03650b2b473c532882273283ee8b7a0 F test/select7.test 95e370c42d47c3c52377d05e9ffc01ccff7c1f61 @@ -1427,7 +1427,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 1e563c6ebbb02d2e89760c7a7f95aa69964629c6 -R 8450aebd4fe3e5df6689a15f6b4c74a5 -U mistachkin -Z fa8db5a9236f4356c9f0e0ef9af9fdef +P 6eab74c9ae57676044b5bc82fa14e92fd2448008 +R 28a5285fd29b59b5a769fa2b98c8137d +U drh +Z 50a93197f1857fe46bad3c49957d1f43 diff --git a/manifest.uuid b/manifest.uuid index def0c6f083..9e7ed6ea08 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6eab74c9ae57676044b5bc82fa14e92fd2448008 \ No newline at end of file +ca72be8618e5d466d6f35819ca8bbd2b84269959 \ No newline at end of file diff --git a/src/build.c b/src/build.c index 476fc28c41..250dc20d20 100644 --- a/src/build.c +++ b/src/build.c @@ -1954,7 +1954,7 @@ void sqlite3EndTable( sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, addrTop); sqlite3SelectDestInit(&dest, SRT_Coroutine, regYield); sqlite3Select(pParse, pSelect, &dest); - sqlite3VdbeAddOp1(v, OP_EndCoroutine, regYield); + sqlite3VdbeEndCoroutine(v, regYield); sqlite3VdbeJumpHere(v, addrTop - 1); if( pParse->nErr ) return; pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect); diff --git a/src/insert.c b/src/insert.c index 729e0fedce..650f397de0 100644 --- a/src/insert.c +++ b/src/insert.c @@ -685,7 +685,7 @@ void sqlite3Insert( rc = sqlite3Select(pParse, pSelect, &dest); regFromSelect = dest.iSdst; if( rc || db->mallocFailed || pParse->nErr ) goto insert_cleanup; - sqlite3VdbeAddOp1(v, OP_EndCoroutine, regYield); + sqlite3VdbeEndCoroutine(v, regYield); sqlite3VdbeJumpHere(v, addrTop - 1); /* label B: */ assert( pSelect->pEList ); nColumn = pSelect->pEList->nExpr; diff --git a/src/select.c b/src/select.c index ea3e920b9f..c3132c2325 100644 --- a/src/select.c +++ b/src/select.c @@ -2952,7 +2952,7 @@ static int multiSelectOrderBy( pPrior->iLimit = regLimitA; explainSetInteger(iSub1, pParse->iNextSelectId); sqlite3Select(pParse, pPrior, &destA); - sqlite3VdbeAddOp1(v, OP_EndCoroutine, regAddrA); + sqlite3VdbeEndCoroutine(v, regAddrA); sqlite3VdbeJumpHere(v, addr1); /* Generate a coroutine to evaluate the SELECT statement on @@ -2969,7 +2969,7 @@ static int multiSelectOrderBy( sqlite3Select(pParse, p, &destB); p->iLimit = savedLimit; p->iOffset = savedOffset; - sqlite3VdbeAddOp1(v, OP_EndCoroutine, regAddrB); + sqlite3VdbeEndCoroutine(v, regAddrB); /* Generate a subroutine that outputs the current row of the A ** select as the next output row of the compound select. @@ -4990,7 +4990,7 @@ int sqlite3Select( pItem->pTab->nRowLogEst = sqlite3LogEst(pSub->nSelectRow); pItem->fg.viaCoroutine = 1; pItem->regResult = dest.iSdst; - sqlite3VdbeAddOp1(v, OP_EndCoroutine, pItem->regReturn); + sqlite3VdbeEndCoroutine(v, pItem->regReturn); sqlite3VdbeJumpHere(v, addrTop-1); sqlite3ClearTempRegCache(pParse); }else{ diff --git a/src/vdbe.h b/src/vdbe.h index f09997bf94..4c02f5844d 100644 --- a/src/vdbe.h +++ b/src/vdbe.h @@ -180,6 +180,7 @@ int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int); int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int); int sqlite3VdbeAddOp4Dup8(Vdbe*,int,int,int,int,const u8*,int); int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int); +void sqlite3VdbeEndCoroutine(Vdbe*,int); #if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS) void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N); #else diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 8eb3141daf..ce98edd0a5 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -324,6 +324,21 @@ int sqlite3VdbeAddOp4Int( return addr; } +/* Insert the end of a co-routine +*/ +void sqlite3VdbeEndCoroutine(Vdbe *v, int regYield){ + sqlite3VdbeAddOp1(v, OP_EndCoroutine, regYield); + + /* Clear the temporary register cache, thereby ensuring that each + ** co-routine has its own independent set of registers, because co-routines + ** might expect their registers to be preserved across an OP_Yield, and + ** that could cause problems if two or more co-routines are using the same + ** temporary register. + */ + v->pParse->nTempReg = 0; + v->pParse->nRangeReg = 0; +} + /* ** Create a new symbolic label for an instruction that has yet to be ** coded. The symbolic label is really just a negative number. The diff --git a/test/select4.test b/test/select4.test index a7b1af20a5..be8d0e0ab1 100644 --- a/test/select4.test +++ b/test/select4.test @@ -916,4 +916,24 @@ do_execsql_test select4-14.17 { VALUES(1),(2),(3),(4) UNION ALL SELECT 5 LIMIT 3; } {1 2 3} +# Ticket https://www.sqlite.org/src/info/d06a25c84454a372 +# Incorrect answer due to two co-routines using the same registers and expecting +# those register values to be preserved across a Yield. +# +do_execsql_test select4-15.1 { + DROP TABLE IF EXISTS tx; + CREATE TABLE tx(id INTEGER PRIMARY KEY, a, b); + INSERT INTO tx(a,b) VALUES(33,456); + INSERT INTO tx(a,b) VALUES(33,789); + + SELECT DISTINCT t0.id, t0.a, t0.b + FROM tx AS t0, tx AS t1 + WHERE t0.a=t1.a AND t1.a=33 AND t0.b=456 + UNION + SELECT DISTINCT t0.id, t0.a, t0.b + FROM tx AS t0, tx AS t1 + WHERE t0.a=t1.a AND t1.a=33 AND t0.b=789 + ORDER BY 1; +} {1 33 456 2 33 789} + finish_test