mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Merge all recent trunk changes.
FossilOrigin-Name: abfef254721ca29b653f24bfe80e88adaa92dc6c
This commit is contained in:
@@ -3116,6 +3116,7 @@ static int fts3FilterMethod(
|
||||
/* In case the cursor has been used before, clear it now. */
|
||||
sqlite3_finalize(pCsr->pStmt);
|
||||
sqlite3_free(pCsr->aDoclist);
|
||||
sqlite3_free(pCsr->aMatchinfo);
|
||||
sqlite3Fts3ExprFree(pCsr->pExpr);
|
||||
memset(&pCursor[1], 0, sizeof(Fts3Cursor)-sizeof(sqlite3_vtab_cursor));
|
||||
|
||||
@@ -4426,7 +4427,7 @@ static int fts3EvalIncrPhraseNext(
|
||||
bMaxSet = 1;
|
||||
}
|
||||
}
|
||||
assert( rc!=SQLITE_OK || a[p->nToken-1].bIgnore==0 );
|
||||
assert( rc!=SQLITE_OK || (p->nToken>=1 && a[p->nToken-1].bIgnore==0) );
|
||||
assert( rc!=SQLITE_OK || bMaxSet );
|
||||
|
||||
/* Keep advancing iterators until they all point to the same document */
|
||||
|
@@ -190,7 +190,7 @@ static int getNextToken(
|
||||
/* Set variable i to the maximum number of bytes of input to tokenize. */
|
||||
for(i=0; i<n; i++){
|
||||
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break;
|
||||
if( z[i]=='*' || z[i]=='"' ) break;
|
||||
if( z[i]=='"' ) break;
|
||||
}
|
||||
|
||||
*pnConsumed = i;
|
||||
|
71
manifest
71
manifest
@@ -1,5 +1,5 @@
|
||||
C Merge\sthe\slatest\senhancements\sfrom\strunk.
|
||||
D 2014-10-01T01:52:42.892
|
||||
C Merge\sall\srecent\strunk\schanges.
|
||||
D 2014-10-10T12:56:35.492
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in dd5f245aa8c741bc65845747203c8ce2f3fb6c83
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@@ -78,11 +78,11 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c 2f5e925bdb9d6d3e488c5a981af60cad4f9cdfe7
|
||||
F ext/fts3/fts3.c 8b6cceb3e0be22da26d83a3cec0e0e337e6b8ec6
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h 53d4eca1fb23eab00681fb028fb82eb5705c1e21
|
||||
F ext/fts3/fts3_aux.c 5c211e17a64885faeb16b9ba7772f9d5445c2365
|
||||
F ext/fts3/fts3_expr.c 351395fad6fcb16ecfc61db0861008a70101330c
|
||||
F ext/fts3/fts3_expr.c 40123785eaa3ebd4c45c9b23407cc44ac0c49905
|
||||
F ext/fts3/fts3_hash.c 29b986e43f4e9dd40110eafa377dc0d63c422c60
|
||||
F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf
|
||||
F ext/fts3/fts3_icu.c e319e108661147bcca8dd511cd562f33a1ba81b5
|
||||
@@ -182,26 +182,26 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 3d8b83c91651f53472ca17599dae3457b8b89494
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c ba266a779bc7ce10e52e59e7d3dc79fa342e8fdb
|
||||
F src/analyze.c 6290a109be876daaa242cd7216f97240f5401776
|
||||
F src/analyze.c 8c322e1ecc08909526dbd5ab4421889d05f2263d
|
||||
F src/attach.c f4e94df2d1826feda65eb0939f7f6f5f923a0ad9
|
||||
F src/auth.c d8abcde53426275dab6243b441256fcd8ccbebb2
|
||||
F src/backup.c a31809c65623cc41849b94d368917f8bb66e6a7e
|
||||
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
|
||||
F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5
|
||||
F src/btree.c ede8348a7d623257ee6c06ca4796ceaee13b8657
|
||||
F src/btree.c fa00618117fb6bb46c243452c56997c0d22d4fc9
|
||||
F src/btree.h a79aa6a71e7f1055f01052b7f821bd1c2dce95c8
|
||||
F src/btreeInt.h 1bd7957161a1346a914f1f09231610e777a8e58d
|
||||
F src/build.c bde83dd5cf812e310a7e5ad2846790a14745bef4
|
||||
F src/build.c 9e5205db9a0c8a1a4ce7379d60a2a34cb0b7339c
|
||||
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
|
||||
F src/complete.c 535183afb3c75628b78ce82612931ac7cdf26f14
|
||||
F src/ctime.c bb434068b5308a857b181c2d204a320ff0d6c638
|
||||
F src/date.c 57a7f9ba9f6b4d5268f5e411739066a611f99036
|
||||
F src/delete.c de3d07d6602b90ae6e8bdebeb7b3265bb846377f
|
||||
F src/expr.c 46a8ca93361d09f2ec6d9b7d524751510569d737
|
||||
F src/expr.c fc204d08af06437ddaffe5a1b1f1f6f9e1a55d6d
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c da985ae673efef2c712caef825a5d2edb087ead7
|
||||
F src/func.c ba47c1671ab3cfdafa6e9d6ee490939ea578adee
|
||||
F src/global.c 5110fa12e09729b84eee0191c984ec4008e21937
|
||||
F src/global.c 01c1f36ecfcf10770db648422a8852c222308bb9
|
||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||
F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
|
||||
@@ -210,11 +210,11 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
|
||||
F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
|
||||
F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
|
||||
F src/loadext.c de741e66e5ddc1598d904d7289239696e40ed994
|
||||
F src/main.c c603e28922b78643c4e0747cac356cfb23d599b9
|
||||
F src/malloc.c 5bb99ee1e08ad58e457063cf79ce521db0e24195
|
||||
F src/main.c c67be3c356abdf33d00b2345e653c41b4049bee1
|
||||
F src/malloc.c 3c3ac67969612493d435e14b6832793209afd2ec
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f
|
||||
F src/mem2.c dce31758da87ec2cfa52ba4c5df1aed6e07d8e8f
|
||||
F src/mem2.c f1940d9e91948dd6a908fbb9ce3835c36b5d83c3
|
||||
F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534
|
||||
F src/mem5.c 61eeb90134f9a5be6c2e68d8daae7628b25953fb
|
||||
F src/memjournal.c 3eb2c0b51adbd869cb6a44780323f05fa904dc85
|
||||
@@ -231,9 +231,9 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||
F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7
|
||||
F src/os_win.c 0a4042ef35f322e86fa01f6c8884c5e645b911e7
|
||||
F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21
|
||||
F src/pager.c caab007743821d96752597c9cfd7351654697b06
|
||||
F src/pager.c a171cf9dd09c6cb162b262c328d4dfd198e04f80
|
||||
F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428
|
||||
F src/parse.y ce1494308578d2f10a68cd8debc9fc156dda1094
|
||||
F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45
|
||||
F src/pcache.c 4121a0571c18581ee9f82f086d5e2030051ebd6a
|
||||
F src/pcache.h 9b559127b83f84ff76d735c8262f04853be0c59a
|
||||
F src/pcache1.c dab8ab930d4a73b99768d881185994f34b80ecaa
|
||||
@@ -245,15 +245,15 @@ F src/resolve.c a3466128b52a86c466e47ac1a19e2174f7b5cf89
|
||||
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
||||
F src/select.c f11533162b57ed5ed37f549add34cbcdf51f6712
|
||||
F src/shell.c 801af09adf9bc64dea59b62880bfb72b42c5f5f2
|
||||
F src/sqlite.h.in 2d5eca136aeac3126da4fb3051bb000c6625047b
|
||||
F src/sqlite.h.in 514eeb7b0845840c132736e714ddd98ab9216e6c
|
||||
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
|
||||
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
|
||||
F src/sqliteInt.h c0e679f9be4081a88c734a357986fe6ffe2fcab7
|
||||
F src/sqliteInt.h eaacd377fa2eb4761dbad3b762b0483886f76565
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 7ac05a5c7017d0b9f0b4bcd701228b784f987158
|
||||
F src/status.c 961d5926e5a8fda611d385ec22c226b8635cd1cb
|
||||
F src/table.c 2e99ef7ef16187e17033d9398dc962ce22dab5cb
|
||||
F src/tclsqlite.c 684c317b85f4729de12909bfad80d3f5500357cf
|
||||
F src/test1.c 523cd70ded28db71af9a30ec184cbe0957de9575
|
||||
F src/test1.c 518db4305d76b29dd9da3f022ca899c8fcdf9fc7
|
||||
F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712
|
||||
F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c
|
||||
F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df
|
||||
@@ -266,7 +266,7 @@ F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8
|
||||
F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
|
||||
F src/test_backup.c 3875e899222b651e18b662f86e0e50daa946344e
|
||||
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
|
||||
F src/test_config.c 5a2a9a580f9c2dfd2ffd52966fd361f2148909d1
|
||||
F src/test_config.c 6ff73defc3db475059a9d7ca8023f05f99242c8e
|
||||
F src/test_demovfs.c 69b2085076654ebc18014cbc6386f04409c959a9
|
||||
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
|
||||
F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f
|
||||
@@ -305,20 +305,20 @@ F src/update.c b9e5295d3a78e96b7c2978c4f9d224d06880f031
|
||||
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
|
||||
F src/util.c 4006c01772bd8d8ac4306d523bbcee41d3e392d8
|
||||
F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a
|
||||
F src/vdbe.c a96171a2d025cf3dfcea4f0d94232f4bfa192f34
|
||||
F src/vdbe.c 10880af9bbd7e19eda4db1ed7a3f2dd1b645f858
|
||||
F src/vdbe.h d61daeffed696e21630759de9e135ee298ad9573
|
||||
F src/vdbeInt.h 6d4bf3fd28699b5c81a68398e9d23720da58fcd8
|
||||
F src/vdbeapi.c cdded67e36d2a20f6d1c7d56f008a646557d2bf0
|
||||
F src/vdbeapi.c 30a1c991147fdf4334900b5fed8a312ae7678707
|
||||
F src/vdbeaux.c ea20bde8cad7b15198879255af849f105daa2fa0
|
||||
F src/vdbeblob.c d65b01f439df63911ac3d7a9a85c15503965f2c3
|
||||
F src/vdbemem.c 5096fe50a1bd12bc2294a8b27ca6e6d1b15ef607
|
||||
F src/vdbemem.c 1731e1db2b71e62243cf825b920d14adefaba3c7
|
||||
F src/vdbesort.c 5c1bacf90578d22b630fbf6ed98ccf60d83435ef
|
||||
F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010
|
||||
F src/vtab.c 019dbfd0406a7447c990e1f7bd1dfcdb8895697f
|
||||
F src/wal.c 10e7de7ce90865a68153f001a61f1d985cd17983
|
||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
|
||||
F src/where.c 2f42fe0d19303e0f5ce29aff3afbd3e43cbd6efb
|
||||
F src/where.c 6fe21e0f60a449af5d75d00e6d480370464a9a48
|
||||
F src/whereInt.h 124d970450955a6982e174b07c320ae6d62a595c
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
@@ -342,6 +342,8 @@ F test/analyze9.test 72795c8113604b5dcd47a1498a61d6d7fb5d041a
|
||||
F test/analyzeA.test 3335697f6700c7052295cfd0067fc5b2aacddf9a
|
||||
F test/analyzeB.test 8bf35ee0a548aea831bf56762cb8e7fdb1db083d
|
||||
F test/analyzeC.test 555a6cc388b9818b6eda6df816f01ce0a75d3a93
|
||||
F test/analyzeD.test 08f9d0bee4e118a66fff3a32d02dbe0ee0a2b594
|
||||
F test/analyzeE.test 8684e8ac5722fb97c251887ad97e5d496a98af1d
|
||||
F test/async.test 1d0e056ba1bb9729283a0f22718d3a25e82c277b
|
||||
F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b
|
||||
F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
|
||||
@@ -435,7 +437,7 @@ F test/corruptE.test 193b4ca4e927e77c1d5f4f56203ddc998432a7ee
|
||||
F test/corruptF.test be9fde98e4c93648f1ba52b74e5318edc8f59fe4
|
||||
F test/corruptG.test 1ab3bf97ee7bdba70e0ff3ba2320657df55d1804
|
||||
F test/corruptH.test 88ed71a086e13591c917aac6de32750e7c7281cb
|
||||
F test/corruptI.test 0afbba50bfae006094cc548b4605f521c1179502
|
||||
F test/corruptI.test 221ad8b7f0a9ac6b80fc577e73b5ad8cdea31243
|
||||
F test/cost.test 19d314526616ce4473eb4e4e450fcb94499ce318
|
||||
F test/count.test 42a251178e32f617eda33f76236a7f79825a50b5
|
||||
F test/coveridxscan.test cdb47d01acc4a634a34fd25abe85189e0d0f1e62
|
||||
@@ -464,7 +466,7 @@ F test/descidx3.test 09ddbe3f5295f482d2f8b687cf6db8bad7acd9a2
|
||||
F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e
|
||||
F test/distinct.test 086e70c765f172e8974e9f83b9ac5ca03c154e77
|
||||
F test/distinctagg.test 1a6ef9c87a58669438fc771450d7a72577417376
|
||||
F test/e_createtable.test 181653f6f45e3adde73f8686600ce5ad7515466b
|
||||
F test/e_createtable.test c7e67b49e6cf92473c8fb30ab26143e9e2128cf7
|
||||
F test/e_delete.test d5186e2f5478b659f16a2c8b66c09892823e542a
|
||||
F test/e_droptrigger.test 3cd080807622c13e5bbb61fc9a57bd7754da2412
|
||||
F test/e_dropview.test 0c9f7f60989164a70a67a9d9c26d1083bc808306
|
||||
@@ -477,7 +479,7 @@ F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6
|
||||
F test/e_select.test 52692ff3849541e828ad4661fe3773a9b8711763
|
||||
F test/e_select2.test aceb80ab927d46fba5ce7586ebabf23e2bb0604f
|
||||
F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52
|
||||
F test/e_uri.test a2c92d80093a7efdcfbb11093651cbea87097b6b
|
||||
F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585
|
||||
F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9
|
||||
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
|
||||
F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473
|
||||
@@ -490,7 +492,7 @@ F test/exclusive.test c7ebbc756eacf544c108b15eed64d7d4e5f86b75
|
||||
F test/exclusive2.test 32798111aae78a5deec980eee383213f189df308
|
||||
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/exists.test 8f7b27b61c2fbe5822f0a1f899c715d14e416e30
|
||||
F test/expr.test 67c9fd6f8f829e239dc8b0f4a08a73c08b09196d
|
||||
F test/expr.test c4b9bf0cc60b26862475e19999fbd2609ca8259c
|
||||
F test/extension01.test 00d13cec817f331a687a243e0e5a2d87b0e358c9
|
||||
F test/fallocate.test 3e979af17dfa7e5e9dda5eba1a696c04fa9d47f7
|
||||
F test/filectrl.test 14fa712e42c4cb791e09dfd58a6a03efb47ef13a
|
||||
@@ -576,13 +578,13 @@ F test/fts3e.test 1f6c6ac9cc8b772ca256e6b22aaeed50c9350851
|
||||
F test/fts3expr.test 3401d47b229c4504424caf362cc4ff704cad4162
|
||||
F test/fts3expr2.test 18da930352e5693eaa163a3eacf96233b7290d1a
|
||||
F test/fts3expr3.test 9e91b8edbcb197bf2e92161aa7696446d96dce5f
|
||||
F test/fts3expr4.test 0713d94ab951ed88a8c3629a4889a48c55c4067c
|
||||
F test/fts3expr4.test e1be1248566f43c252d4404d52914f1fc4bfa065
|
||||
F test/fts3fault.test cb72dccb0a3b9f730f16c5240f3fcb9303eb1660
|
||||
F test/fts3fault2.test 3198eef2804deea7cac8403e771d9cbcb752d887
|
||||
F test/fts3first.test dbdedd20914c8d539aa3206c9b34a23775644641
|
||||
F test/fts3join.test 53e66a0c21eb568580674a43b21c059acb26f499
|
||||
F test/fts3malloc.test b0e4c133b8d61d4f6d112d8110f8320e9e453ef6
|
||||
F test/fts3matchinfo.test ff423e73faab8fc6d7adeefedf74dd8e2b0b14e0
|
||||
F test/fts3matchinfo.test 58544fa4d254000fa4e7f494b0a832f7ba61d45e
|
||||
F test/fts3near.test 7e3354d46f155a822b59c0e957fd2a70c1d7e905
|
||||
F test/fts3prefix.test b36d4f00b128a51e7b386cc013a874246d9d7dc1
|
||||
F test/fts3prefix2.test e1f0a822ca661dced7f12ce392e14eaf65609dce
|
||||
@@ -706,7 +708,7 @@ F test/malloc6.test 2f039d9821927eacae43e1831f815e157659a151
|
||||
F test/malloc7.test 7c68a32942858bc715284856c5507446bba88c3a
|
||||
F test/malloc8.test 9b7a3f8cb9cf0b12fff566e80a980b1767bd961d
|
||||
F test/malloc9.test 2307c6ee3703b0a21391f3ea92388b4b73f9105e
|
||||
F test/mallocA.test c049224adeb0244b8f6eb770c1fa6ac40f9b3518
|
||||
F test/mallocA.test 672cd7dedb63771bade3a6f557f851a4ad161d4a
|
||||
F test/mallocAll.test 98f1be74bc9f49a858bc4f361fc58e26486798be
|
||||
F test/mallocB.test bc475ab850cda896142ab935bbfbc74c24e51ed6
|
||||
F test/mallocC.test 3dffe16532f109293ce1ccecd0c31dca55ef08c4
|
||||
@@ -765,6 +767,7 @@ F test/orderby5.test 8f08a54836d21fb7c70245360751aedd1c2286fb
|
||||
F test/orderby6.test 8b38138ab0972588240b3fca0985d2e400432859
|
||||
F test/orderby7.test 3d1383d52ade5b9eb3a173b3147fdd296f0202da
|
||||
F test/oserror.test 50417780d0e0d7cd23cf12a8277bb44024765df3
|
||||
F test/ovfl.test 4f7ca651cba5c059a12d8c67dddd49bec5747799
|
||||
F test/pager1.test 1acbdb14c5952a72dd43129cabdbf69aaa3ed1fa
|
||||
F test/pager2.test 67b8f40ae98112bcdba1f2b2d03ea83266418c71
|
||||
F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f
|
||||
@@ -876,7 +879,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
|
||||
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
|
||||
F test/speedtest1.c 83f6b3318f7ee60e52b978b5a5e5dd7e83dfb7ee
|
||||
F test/spellfix.test 24f676831acddd2f4056a598fd731a72c6311f49
|
||||
F test/sqllimits1.test b1aae27cc98eceb845e7f7adf918561256e31298
|
||||
F test/sqllimits1.test 9014524e7ab16e2a4976b13397db4c29cc29c6d9
|
||||
F test/stat.test 76fd746b85459e812a0193410fb599f0531f22de
|
||||
F test/stmt.test 25d64e3dbf9a3ce89558667d7f39d966fe2a71b9
|
||||
F test/subquery.test 666fdecceac258f5fd84bed09a64e49d9f37edd9
|
||||
@@ -1217,7 +1220,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 1f44bfdc237ee6304f4aa56e5c5d1c0d74fcc944 5ce05757aac80b99c3b2141cd301809f8e28e661
|
||||
R 7b6778125f5d37e90ebb0b670b3bd514
|
||||
P 2695772c984c215649a16e1e3e18a8048a6a60dd 49dfee7cd1c9ab2901b8a871a6cd00b2ead76801
|
||||
R 0a03cea1a4d1a941b11aa663569e1d01
|
||||
U drh
|
||||
Z 7aa260299f51330d2234a568308a124e
|
||||
Z 20a722d001f64c3e0f0d27d851d3747e
|
||||
|
@@ -1 +1 @@
|
||||
2695772c984c215649a16e1e3e18a8048a6a60dd
|
||||
abfef254721ca29b653f24bfe80e88adaa92dc6c
|
@@ -1437,7 +1437,7 @@ static void decodeIntArray(
|
||||
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
|
||||
if( z==0 ) z = "";
|
||||
#else
|
||||
if( NEVER(z==0) ) z = "";
|
||||
assert( z!=0 );
|
||||
#endif
|
||||
for(i=0; *z && i<nOut; i++){
|
||||
v = 0;
|
||||
@@ -1446,16 +1446,14 @@ static void decodeIntArray(
|
||||
z++;
|
||||
}
|
||||
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
|
||||
if( aOut ){
|
||||
aOut[i] = v;
|
||||
}else
|
||||
if( aOut ) aOut[i] = v;
|
||||
if( aLog ) aLog[i] = sqlite3LogEst(v);
|
||||
#else
|
||||
assert( aOut==0 );
|
||||
UNUSED_PARAMETER(aOut);
|
||||
#endif
|
||||
{
|
||||
assert( aLog!=0 );
|
||||
aLog[i] = sqlite3LogEst(v);
|
||||
}
|
||||
#endif
|
||||
if( *z==' ' ) z++;
|
||||
}
|
||||
#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
|
||||
@@ -1516,8 +1514,17 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
|
||||
z = argv[2];
|
||||
|
||||
if( pIndex ){
|
||||
int nCol = pIndex->nKeyCol+1;
|
||||
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
|
||||
tRowcnt * const aiRowEst = pIndex->aiRowEst = (tRowcnt*)sqlite3MallocZero(
|
||||
sizeof(tRowcnt) * nCol
|
||||
);
|
||||
if( aiRowEst==0 ) pInfo->db->mallocFailed = 1;
|
||||
#else
|
||||
tRowcnt * const aiRowEst = 0;
|
||||
#endif
|
||||
pIndex->bUnordered = 0;
|
||||
decodeIntArray((char*)z, pIndex->nKeyCol+1, 0, pIndex->aiRowLogEst, pIndex);
|
||||
decodeIntArray((char*)z, nCol, aiRowEst, pIndex->aiRowLogEst, pIndex);
|
||||
if( pIndex->pPartIdxWhere==0 ) pTable->nRowLogEst = pIndex->aiRowLogEst[0];
|
||||
}else{
|
||||
Index fakeIdx;
|
||||
@@ -1576,25 +1583,38 @@ static void initAvgEq(Index *pIdx){
|
||||
pIdx->aAvgEq[nCol] = 1;
|
||||
}
|
||||
for(iCol=0; iCol<nCol; iCol++){
|
||||
int nSample = pIdx->nSample;
|
||||
int i; /* Used to iterate through samples */
|
||||
tRowcnt sumEq = 0; /* Sum of the nEq values */
|
||||
tRowcnt nSum = 0; /* Number of terms contributing to sumEq */
|
||||
tRowcnt avgEq = 0;
|
||||
tRowcnt nDLt = pFinal->anDLt[iCol];
|
||||
tRowcnt nRow; /* Number of rows in index */
|
||||
i64 nSum100 = 0; /* Number of terms contributing to sumEq */
|
||||
i64 nDist100; /* Number of distinct values in index */
|
||||
|
||||
if( pIdx->aiRowEst==0 || pIdx->aiRowEst[iCol+1]==0 ){
|
||||
nRow = pFinal->anLt[iCol];
|
||||
nDist100 = (i64)100 * pFinal->anDLt[iCol];
|
||||
nSample--;
|
||||
}else{
|
||||
nRow = pIdx->aiRowEst[0];
|
||||
nDist100 = ((i64)100 * pIdx->aiRowEst[0]) / pIdx->aiRowEst[iCol+1];
|
||||
}
|
||||
|
||||
/* Set nSum to the number of distinct (iCol+1) field prefixes that
|
||||
** occur in the stat4 table for this index before pFinal. Set
|
||||
** sumEq to the sum of the nEq values for column iCol for the same
|
||||
** set (adding the value only once where there exist duplicate
|
||||
** prefixes). */
|
||||
for(i=0; i<(pIdx->nSample-1); i++){
|
||||
if( aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] ){
|
||||
** occur in the stat4 table for this index. Set sumEq to the sum of
|
||||
** the nEq values for column iCol for the same set (adding the value
|
||||
** only once where there exist duplicate prefixes). */
|
||||
for(i=0; i<nSample; i++){
|
||||
if( i==(pIdx->nSample-1)
|
||||
|| aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol]
|
||||
){
|
||||
sumEq += aSample[i].anEq[iCol];
|
||||
nSum++;
|
||||
nSum100 += 100;
|
||||
}
|
||||
}
|
||||
if( nDLt>nSum ){
|
||||
avgEq = (pFinal->anLt[iCol] - sumEq)/(nDLt - nSum);
|
||||
|
||||
if( nDist100>nSum100 ){
|
||||
avgEq = ((i64)100 * (nRow - sumEq))/(nDist100 - nSum100);
|
||||
}
|
||||
if( avgEq==0 ) avgEq = 1;
|
||||
pIdx->aAvgEq[iCol] = avgEq;
|
||||
@@ -1846,6 +1866,11 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
|
||||
rc = loadStat4(db, sInfo.zDatabase);
|
||||
db->lookaside.bEnabled = lookasideEnabled;
|
||||
}
|
||||
for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
|
||||
Index *pIdx = sqliteHashData(i);
|
||||
sqlite3_free(pIdx->aiRowEst);
|
||||
pIdx->aiRowEst = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( rc==SQLITE_NOMEM ){
|
||||
|
@@ -4022,6 +4022,7 @@ static int accessPayload(
|
||||
MemPage *pPage = pCur->apPage[pCur->iPage]; /* Btree page of current entry */
|
||||
BtShared *pBt = pCur->pBt; /* Btree this cursor belongs to */
|
||||
#ifdef SQLITE_DIRECT_OVERFLOW_READ
|
||||
unsigned char * const pBufStart = pBuf;
|
||||
int bEnd; /* True if reading to end of data */
|
||||
#endif
|
||||
|
||||
@@ -4149,6 +4150,7 @@ static int accessPayload(
|
||||
** 4) there is no open write-transaction, and
|
||||
** 5) the database is not a WAL database,
|
||||
** 6) all data from the page is being read.
|
||||
** 7) at least 4 bytes have already been read into the output buffer
|
||||
**
|
||||
** then data can be read directly from the database file into the
|
||||
** output buffer, bypassing the page-cache altogether. This speeds
|
||||
@@ -4160,9 +4162,11 @@ static int accessPayload(
|
||||
&& pBt->inTransaction==TRANS_READ /* (4) */
|
||||
&& (fd = sqlite3PagerFile(pBt->pPager))->pMethods /* (3) */
|
||||
&& pBt->pPage1->aData[19]==0x01 /* (5) */
|
||||
&& &pBuf[-4]>=pBufStart /* (7) */
|
||||
){
|
||||
u8 aSave[4];
|
||||
u8 *aWrite = &pBuf[-4];
|
||||
assert( aWrite>=pBufStart ); /* hence (7) */
|
||||
memcpy(aSave, aWrite, 4);
|
||||
rc = sqlite3OsRead(fd, aWrite, a+4, (i64)pBt->pageSize*(nextPage-1));
|
||||
nextPage = get4byte(aWrite);
|
||||
|
@@ -435,6 +435,9 @@ static void freeIndex(sqlite3 *db, Index *p){
|
||||
sqlite3ExprDelete(db, p->pPartIdxWhere);
|
||||
sqlite3DbFree(db, p->zColAff);
|
||||
if( p->isResized ) sqlite3DbFree(db, p->azColl);
|
||||
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
|
||||
sqlite3_free(p->aiRowEst);
|
||||
#endif
|
||||
sqlite3DbFree(db, p);
|
||||
}
|
||||
|
||||
|
@@ -3339,6 +3339,7 @@ void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 moreToFollow){
|
||||
case TK_LSHIFT: zBinOp = "LSHIFT"; break;
|
||||
case TK_RSHIFT: zBinOp = "RSHIFT"; break;
|
||||
case TK_CONCAT: zBinOp = "CONCAT"; break;
|
||||
case TK_DOT: zBinOp = "DOT"; break;
|
||||
|
||||
case TK_UMINUS: zUniOp = "UMINUS"; break;
|
||||
case TK_UPLUS: zUniOp = "UPLUS"; break;
|
||||
|
@@ -129,6 +129,13 @@ const unsigned char sqlite3CtypeMap[256] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
/* EVIDENCE-OF: R-02982-34736 In order to maintain full backwards
|
||||
** compatibility for legacy applications, the URI filename capability is
|
||||
** disabled by default.
|
||||
**
|
||||
** EVIDENCE-OF: R-38799-08373 URI filenames can be enabled or disabled
|
||||
** using the SQLITE_USE_URI=1 or SQLITE_USE_URI=0 compile-time options.
|
||||
*/
|
||||
#ifndef SQLITE_USE_URI
|
||||
# define SQLITE_USE_URI 0
|
||||
#endif
|
||||
|
11
src/main.c
11
src/main.c
@@ -476,6 +476,11 @@ int sqlite3_config(int op, ...){
|
||||
break;
|
||||
}
|
||||
|
||||
/* EVIDENCE-OF: R-55548-33817 The compile-time setting for URI filenames
|
||||
** can be changed at start-time using the
|
||||
** sqlite3_config(SQLITE_CONFIG_URI,1) or
|
||||
** sqlite3_config(SQLITE_CONFIG_URI,0) configuration calls.
|
||||
*/
|
||||
case SQLITE_CONFIG_URI: {
|
||||
sqlite3GlobalConfig.bOpenUri = va_arg(ap, int);
|
||||
break;
|
||||
@@ -2234,7 +2239,7 @@ int sqlite3ParseUri(
|
||||
assert( *pzErrMsg==0 );
|
||||
|
||||
if( ((flags & SQLITE_OPEN_URI) || sqlite3GlobalConfig.bOpenUri)
|
||||
&& nUri>=5 && memcmp(zUri, "file:", 5)==0
|
||||
&& nUri>=5 && memcmp(zUri, "file:", 5)==0 /* IMP: R-57884-37496 */
|
||||
){
|
||||
char *zOpt;
|
||||
int eState; /* Parser state when parsing URI */
|
||||
@@ -2464,7 +2469,9 @@ static int openDatabase(
|
||||
testcase( (1<<(flags&7))==0x02 ); /* READONLY */
|
||||
testcase( (1<<(flags&7))==0x04 ); /* READWRITE */
|
||||
testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */
|
||||
if( ((1<<(flags&7)) & 0x46)==0 ) return SQLITE_MISUSE_BKPT;
|
||||
if( ((1<<(flags&7)) & 0x46)==0 ){
|
||||
return SQLITE_MISUSE_BKPT; /* IMP: R-65497-44594 */
|
||||
}
|
||||
|
||||
if( sqlite3GlobalConfig.bCoreMutex==0 ){
|
||||
isThreadsafe = 0;
|
||||
|
41
src/malloc.c
41
src/malloc.c
@@ -310,7 +310,7 @@ void *sqlite3Malloc(u64 n){
|
||||
}else{
|
||||
p = sqlite3GlobalConfig.m.xMalloc((int)n);
|
||||
}
|
||||
assert( EIGHT_BYTE_ALIGNMENT(p) ); /* IMP: R-04675-44850 */
|
||||
assert( EIGHT_BYTE_ALIGNMENT(p) ); /* IMP: R-11148-40995 */
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -447,25 +447,27 @@ static int isLookaside(sqlite3 *db, void *p){
|
||||
*/
|
||||
int sqlite3MallocSize(void *p){
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugNoType(p, MEMTYPE_DB) );
|
||||
return sqlite3GlobalConfig.m.xSize(p);
|
||||
}
|
||||
int sqlite3DbMallocSize(sqlite3 *db, void *p){
|
||||
if( db==0 ){
|
||||
assert( sqlite3MemdebugNoType(p, ~MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
|
||||
return sqlite3MallocSize(p);
|
||||
}else{
|
||||
assert( sqlite3_mutex_held(db->mutex) );
|
||||
if( isLookaside(db, p) ){
|
||||
return db->lookaside.sz;
|
||||
}else{
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) );
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) );
|
||||
assert( db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE) );
|
||||
assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
|
||||
assert( sqlite3MemdebugNoType(p, ~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
|
||||
return sqlite3GlobalConfig.m.xSize(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3_uint64 sqlite3_msize(void *p){
|
||||
assert( sqlite3MemdebugNoType(p, ~MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
|
||||
return (sqlite3_uint64)sqlite3GlobalConfig.m.xSize(p);
|
||||
}
|
||||
|
||||
@@ -474,8 +476,8 @@ sqlite3_uint64 sqlite3_msize(void *p){
|
||||
*/
|
||||
void sqlite3_free(void *p){
|
||||
if( p==0 ) return; /* IMP: R-49053-54554 */
|
||||
assert( sqlite3MemdebugNoType(p, MEMTYPE_DB) );
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugNoType(p, ~MEMTYPE_HEAP) );
|
||||
if( sqlite3GlobalConfig.bMemstat ){
|
||||
sqlite3_mutex_enter(mem0.mutex);
|
||||
sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, -sqlite3MallocSize(p));
|
||||
@@ -519,8 +521,8 @@ void sqlite3DbFree(sqlite3 *db, void *p){
|
||||
return;
|
||||
}
|
||||
}
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) );
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
|
||||
assert( sqlite3MemdebugNoType(p, ~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
|
||||
assert( db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE) );
|
||||
sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
|
||||
sqlite3_free(p);
|
||||
@@ -532,11 +534,13 @@ void sqlite3DbFree(sqlite3 *db, void *p){
|
||||
void *sqlite3Realloc(void *pOld, u64 nBytes){
|
||||
int nOld, nNew, nDiff;
|
||||
void *pNew;
|
||||
assert( sqlite3MemdebugHasType(pOld, MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugNoType(pOld, ~MEMTYPE_HEAP) );
|
||||
if( pOld==0 ){
|
||||
return sqlite3Malloc(nBytes); /* IMP: R-28354-25769 */
|
||||
return sqlite3Malloc(nBytes); /* IMP: R-04300-56712 */
|
||||
}
|
||||
if( nBytes==0 ){
|
||||
sqlite3_free(pOld); /* IMP: R-31593-10574 */
|
||||
sqlite3_free(pOld); /* IMP: R-26507-47431 */
|
||||
return 0;
|
||||
}
|
||||
if( nBytes>=0x7fffff00 ){
|
||||
@@ -558,8 +562,6 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){
|
||||
mem0.alarmThreshold-nDiff ){
|
||||
sqlite3MallocAlarm(nDiff);
|
||||
}
|
||||
assert( sqlite3MemdebugHasType(pOld, MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugNoType(pOld, ~MEMTYPE_HEAP) );
|
||||
pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
|
||||
if( pNew==0 && mem0.alarmCallback ){
|
||||
sqlite3MallocAlarm((int)nBytes);
|
||||
@@ -573,7 +575,7 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){
|
||||
}else{
|
||||
pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
|
||||
}
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pNew) ); /* IMP: R-04675-44850 */
|
||||
assert( EIGHT_BYTE_ALIGNMENT(pNew) ); /* IMP: R-11148-40995 */
|
||||
return pNew;
|
||||
}
|
||||
|
||||
@@ -585,7 +587,7 @@ void *sqlite3_realloc(void *pOld, int n){
|
||||
#ifndef SQLITE_OMIT_AUTOINIT
|
||||
if( sqlite3_initialize() ) return 0;
|
||||
#endif
|
||||
if( n<0 ) n = 0;
|
||||
if( n<0 ) n = 0; /* IMP: R-26507-47431 */
|
||||
return sqlite3Realloc(pOld, n);
|
||||
}
|
||||
void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
|
||||
@@ -672,8 +674,8 @@ void *sqlite3DbMallocRaw(sqlite3 *db, u64 n){
|
||||
if( !p && db ){
|
||||
db->mallocFailed = 1;
|
||||
}
|
||||
sqlite3MemdebugSetType(p, MEMTYPE_DB |
|
||||
((db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
|
||||
sqlite3MemdebugSetType(p,
|
||||
(db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -699,15 +701,14 @@ void *sqlite3DbRealloc(sqlite3 *db, void *p, u64 n){
|
||||
sqlite3DbFree(db, p);
|
||||
}
|
||||
}else{
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) );
|
||||
assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) );
|
||||
assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
|
||||
assert( sqlite3MemdebugNoType(p, ~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
|
||||
sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
|
||||
pNew = sqlite3_realloc64(p, n);
|
||||
if( !pNew ){
|
||||
sqlite3MemdebugSetType(p, MEMTYPE_DB|MEMTYPE_HEAP);
|
||||
db->mallocFailed = 1;
|
||||
}
|
||||
sqlite3MemdebugSetType(pNew, MEMTYPE_DB |
|
||||
sqlite3MemdebugSetType(pNew,
|
||||
(db->lookaside.bEnabled ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
|
||||
}
|
||||
}
|
||||
|
@@ -394,7 +394,7 @@ void sqlite3MemdebugSetType(void *p, u8 eType){
|
||||
** This routine is designed for use within an assert() statement, to
|
||||
** verify the type of an allocation. For example:
|
||||
**
|
||||
** assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) );
|
||||
** assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) );
|
||||
*/
|
||||
int sqlite3MemdebugHasType(void *p, u8 eType){
|
||||
int rc = 1;
|
||||
@@ -416,7 +416,7 @@ int sqlite3MemdebugHasType(void *p, u8 eType){
|
||||
** This routine is designed for use within an assert() statement, to
|
||||
** verify the type of an allocation. For example:
|
||||
**
|
||||
** assert( sqlite3MemdebugNoType(p, MEMTYPE_DB) );
|
||||
** assert( sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE) );
|
||||
*/
|
||||
int sqlite3MemdebugNoType(void *p, u8 eType){
|
||||
int rc = 1;
|
||||
|
@@ -3618,13 +3618,15 @@ int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
pager_reset(pPager);
|
||||
sqlite3PageFree(pPager->pTmpSpace);
|
||||
pPager->pTmpSpace = pNew;
|
||||
rc = sqlite3PcacheSetPageSize(pPager->pPCache, pageSize);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3PageFree(pPager->pTmpSpace);
|
||||
pPager->pTmpSpace = pNew;
|
||||
pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
|
||||
pPager->pageSize = pageSize;
|
||||
}else{
|
||||
sqlite3PageFree(pNew);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -961,7 +961,7 @@ expr(A) ::= expr(X) NOT NULL(E). {spanUnaryPostfix(&A,pParse,TK_NOTNULL,&X,&E);}
|
||||
** unary TK_ISNULL or TK_NOTNULL expression. */
|
||||
static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
|
||||
sqlite3 *db = pParse->db;
|
||||
if( db->mallocFailed==0 && pY->op==TK_NULL ){
|
||||
if( pY && pA && pY->op==TK_NULL ){
|
||||
pA->op = (u8)op;
|
||||
sqlite3ExprDelete(db, pA->pRight);
|
||||
pA->pRight = 0;
|
||||
|
@@ -2664,9 +2664,9 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** an English language description of the error following a failure of any
|
||||
** of the sqlite3_open() routines.
|
||||
**
|
||||
** ^The default encoding for the database will be UTF-8 if
|
||||
** sqlite3_open() or sqlite3_open_v2() is called and
|
||||
** UTF-16 in the native byte order if sqlite3_open16() is used.
|
||||
** ^The default encoding will be UTF-8 for databases created using
|
||||
** sqlite3_open() or sqlite3_open_v2(). ^The default encoding for databases
|
||||
** created using sqlite3_open16() will be UTF-16 in the native byte order.
|
||||
**
|
||||
** Whether or not an error occurs when it is opened, resources
|
||||
** associated with the [database connection] handle should be released by
|
||||
@@ -2754,13 +2754,14 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** then it is interpreted as an absolute path. ^If the path does not begin
|
||||
** with a '/' (meaning that the authority section is omitted from the URI)
|
||||
** then the path is interpreted as a relative path.
|
||||
** ^On windows, the first component of an absolute path
|
||||
** is a drive specification (e.g. "C:").
|
||||
** ^(On windows, the first component of an absolute path
|
||||
** is a drive specification (e.g. "C:").)^
|
||||
**
|
||||
** [[core URI query parameters]]
|
||||
** The query component of a URI may contain parameters that are interpreted
|
||||
** either by SQLite itself, or by a [VFS | custom VFS implementation].
|
||||
** SQLite interprets the following three query parameters:
|
||||
** SQLite and its built-in [VFSes] interpret the
|
||||
** following query parameters:
|
||||
**
|
||||
** <ul>
|
||||
** <li> <b>vfs</b>: ^The "vfs" parameter may be used to specify the name of
|
||||
@@ -2795,11 +2796,9 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||
** a URI filename, its value overrides any behavior requested by setting
|
||||
** SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
|
||||
**
|
||||
** <li> <b>psow</b>: ^The psow parameter may be "true" (or "on" or "yes" or
|
||||
** "1") or "false" (or "off" or "no" or "0") to indicate that the
|
||||
** <li> <b>psow</b>: ^The psow parameter indicates whether or not the
|
||||
** [powersafe overwrite] property does or does not apply to the
|
||||
** storage media on which the database file resides. ^The psow query
|
||||
** parameter only works for the built-in unix and Windows VFSes.
|
||||
** storage media on which the database file resides.
|
||||
**
|
||||
** <li> <b>nolock</b>: ^The nolock parameter is a boolean query parameter
|
||||
** which if set disables file locking in rollback journal modes. This
|
||||
@@ -3394,11 +3393,10 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
** contain embedded NULs. The result of expressions involving strings
|
||||
** with embedded NULs is undefined.
|
||||
**
|
||||
** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and
|
||||
** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or
|
||||
** ^The fifth argument to the BLOB and string binding interfaces
|
||||
** is a destructor used to dispose of the BLOB or
|
||||
** string after SQLite has finished with it. ^The destructor is called
|
||||
** to dispose of the BLOB or string even if the call to sqlite3_bind_blob(),
|
||||
** sqlite3_bind_text(), or sqlite3_bind_text16() fails.
|
||||
** to dispose of the BLOB or string even if the call to bind API fails.
|
||||
** ^If the fifth argument is
|
||||
** the special value [SQLITE_STATIC], then SQLite assumes that the
|
||||
** information is in static, unmanaged space and does not need to be freed.
|
||||
@@ -3409,7 +3407,7 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
** ^The sixth argument to sqlite3_bind_text64() must be one of
|
||||
** [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]
|
||||
** to specify the encoding of the text in the third parameter. If
|
||||
** the sixth argument to sqlite3_bind_text64() is not how of the
|
||||
** the sixth argument to sqlite3_bind_text64() is not one of the
|
||||
** allowed values shown above, or if the text encoding is different
|
||||
** from the encoding specified by the sixth parameter, then the behavior
|
||||
** is undefined.
|
||||
@@ -4445,7 +4443,7 @@ typedef void (*sqlite3_destructor_type)(void*);
|
||||
** of the application-defined function to be NULL.
|
||||
**
|
||||
** ^The sqlite3_result_text(), sqlite3_result_text16(),
|
||||
** sqlite3_result_text16le(), and sqlite3_result_text16be()
|
||||
** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces
|
||||
** set the return value of the application-defined function to be
|
||||
** a text string which is represented as UTF-8, UTF-16 native byte order,
|
||||
** UTF-16 little endian, or UTF-16 big endian, respectively.
|
||||
|
@@ -1809,6 +1809,7 @@ struct Index {
|
||||
int nSampleCol; /* Size of IndexSample.anEq[] and so on */
|
||||
tRowcnt *aAvgEq; /* Average nEq values for keys not in aSample */
|
||||
IndexSample *aSample; /* Samples of the left-most key */
|
||||
tRowcnt *aiRowEst; /* Non-logarithmic stat1 data for this table */
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -3811,10 +3812,9 @@ SQLITE_EXTERN void (*sqlite3IoTrace)(const char*,...);
|
||||
# define sqlite3MemdebugNoType(X,Y) 1
|
||||
#endif
|
||||
#define MEMTYPE_HEAP 0x01 /* General heap allocations */
|
||||
#define MEMTYPE_LOOKASIDE 0x02 /* Might have been lookaside memory */
|
||||
#define MEMTYPE_LOOKASIDE 0x02 /* Heap that might have been lookaside */
|
||||
#define MEMTYPE_SCRATCH 0x04 /* Scratch allocations */
|
||||
#define MEMTYPE_PCACHE 0x08 /* Page cache allocations */
|
||||
#define MEMTYPE_DB 0x10 /* Uses sqlite3DbMalloc, not sqlite_malloc */
|
||||
|
||||
/*
|
||||
** Threading interface
|
||||
|
@@ -213,7 +213,7 @@ int sqlite3_db_status(
|
||||
}
|
||||
db->pnBytesFreed = 0;
|
||||
|
||||
*pHighwater = 0;
|
||||
*pHighwater = 0; /* IMP: R-64479-57858 */
|
||||
*pCurrent = nByte;
|
||||
|
||||
break;
|
||||
@@ -238,7 +238,9 @@ int sqlite3_db_status(
|
||||
sqlite3PagerCacheStat(pPager, op, resetFlag, &nRet);
|
||||
}
|
||||
}
|
||||
*pHighwater = 0;
|
||||
*pHighwater = 0; /* IMP: R-42420-56072 */
|
||||
/* IMP: R-54100-20147 */
|
||||
/* IMP: R-29431-39229 */
|
||||
*pCurrent = nRet;
|
||||
break;
|
||||
}
|
||||
@@ -248,7 +250,7 @@ int sqlite3_db_status(
|
||||
** have been satisfied. The *pHighwater is always set to zero.
|
||||
*/
|
||||
case SQLITE_DBSTATUS_DEFERRED_FKS: {
|
||||
*pHighwater = 0;
|
||||
*pHighwater = 0; /* IMP: R-11967-56545 */
|
||||
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0;
|
||||
break;
|
||||
}
|
||||
|
@@ -5513,10 +5513,11 @@ static int test_limit(
|
||||
{ "SQLITE_LIMIT_LIKE_PATTERN_LENGTH", SQLITE_LIMIT_LIKE_PATTERN_LENGTH },
|
||||
{ "SQLITE_LIMIT_VARIABLE_NUMBER", SQLITE_LIMIT_VARIABLE_NUMBER },
|
||||
{ "SQLITE_LIMIT_TRIGGER_DEPTH", SQLITE_LIMIT_TRIGGER_DEPTH },
|
||||
{ "SQLITE_LIMIT_WORKER_THREADS", SQLITE_LIMIT_WORKER_THREADS },
|
||||
|
||||
/* Out of range test cases */
|
||||
{ "SQLITE_LIMIT_TOOSMALL", -1, },
|
||||
{ "SQLITE_LIMIT_TOOBIG", SQLITE_LIMIT_TRIGGER_DEPTH+1 },
|
||||
{ "SQLITE_LIMIT_TOOBIG", SQLITE_LIMIT_WORKER_THREADS+1 },
|
||||
};
|
||||
int i, id;
|
||||
int val;
|
||||
|
@@ -656,6 +656,7 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
|
||||
LINKVAR( DEFAULT_FILE_FORMAT );
|
||||
LINKVAR( MAX_ATTACHED );
|
||||
LINKVAR( MAX_DEFAULT_PAGE_SIZE );
|
||||
LINKVAR( MAX_WORKER_THREADS );
|
||||
|
||||
{
|
||||
static const int cv_TEMP_STORE = SQLITE_TEMP_STORE;
|
||||
|
@@ -1568,7 +1568,7 @@ case OP_Function: {
|
||||
ctx.pVdbe = p;
|
||||
MemSetTypeFlag(ctx.pOut, MEM_Null);
|
||||
ctx.fErrorOrAux = 0;
|
||||
assert( db->lastRowid==lastRowid );
|
||||
db->lastRowid = lastRowid;
|
||||
(*ctx.pFunc->xFunc)(&ctx, n, apVal); /* IMP: R-24505-23230 */
|
||||
lastRowid = db->lastRowid; /* Remember rowid changes made by xFunc */
|
||||
|
||||
@@ -4394,7 +4394,8 @@ case OP_RowData: {
|
||||
goto too_big;
|
||||
}
|
||||
}
|
||||
if( sqlite3VdbeMemClearAndResize(pOut, n) ){
|
||||
testcase( n==0 );
|
||||
if( sqlite3VdbeMemClearAndResize(pOut, MAX(n,32)) ){
|
||||
goto no_mem;
|
||||
}
|
||||
pOut->n = n;
|
||||
|
@@ -318,6 +318,7 @@ void sqlite3_result_text64(
|
||||
){
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
assert( xDel!=SQLITE_DYNAMIC );
|
||||
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
|
||||
if( n>0x7fffffff ){
|
||||
(void)invokeValueDestructor(z, xDel, pCtx);
|
||||
}else{
|
||||
|
@@ -31,7 +31,10 @@ int sqlite3VdbeCheckMemInvariants(Mem *p){
|
||||
*/
|
||||
assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 );
|
||||
|
||||
/* MEM_Dyn may only be set if Mem.szMalloc==0 */
|
||||
/* MEM_Dyn may only be set if Mem.szMalloc==0. In this way we
|
||||
** ensure that if Mem.szMalloc>0 then it is safe to do
|
||||
** Mem.z = Mem.zMalloc without having to check Mem.flags&MEM_Dyn.
|
||||
** That saves a few cycles in inner loops. */
|
||||
assert( (p->flags & MEM_Dyn)==0 || p->szMalloc==0 );
|
||||
|
||||
/* Cannot be both MEM_Int and MEM_Real at the same time */
|
||||
@@ -167,7 +170,8 @@ SQLITE_NOINLINE int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPreserve){
|
||||
** if unable to complete the resizing.
|
||||
*/
|
||||
int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){
|
||||
assert( szNew>=0 );
|
||||
assert( szNew>0 );
|
||||
assert( (pMem->flags & MEM_Dyn)==0 || pMem->szMalloc==0 );
|
||||
if( pMem->szMalloc<szNew ){
|
||||
return sqlite3VdbeMemGrow(pMem, szNew, 0);
|
||||
}
|
||||
@@ -890,7 +894,10 @@ int sqlite3VdbeMemSetStr(
|
||||
if( nByte>iLimit ){
|
||||
return SQLITE_TOOBIG;
|
||||
}
|
||||
if( sqlite3VdbeMemClearAndResize(pMem, nAlloc) ){
|
||||
testcase( nAlloc==0 );
|
||||
testcase( nAlloc==31 );
|
||||
testcase( nAlloc==32 );
|
||||
if( sqlite3VdbeMemClearAndResize(pMem, MAX(nAlloc,32)) ){
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
memcpy(pMem->z, z, nAlloc);
|
||||
@@ -993,7 +1000,7 @@ int sqlite3VdbeMemFromBtree(
|
||||
** Convert it into a string with encoding enc and return a pointer
|
||||
** to a zero-terminated version of that string.
|
||||
*/
|
||||
SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
|
||||
static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
|
||||
assert( pVal!=0 );
|
||||
assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
|
||||
assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
|
||||
|
22
src/where.c
22
src/where.c
@@ -2207,16 +2207,23 @@ static int whereRangeScanEst(
|
||||
iUpper = a[0] + a[1];
|
||||
}
|
||||
|
||||
assert( pLower==0 || (pLower->eOperator & (WO_GT|WO_GE))!=0 );
|
||||
assert( pUpper==0 || (pUpper->eOperator & (WO_LT|WO_LE))!=0 );
|
||||
assert( p->pKeyInfo!=0 && p->pKeyInfo->aSortOrder!=0 );
|
||||
if( p->pKeyInfo->aSortOrder[nEq] ){
|
||||
/* The roles of pLower and pUpper are swapped for a DESC index */
|
||||
SWAP(WhereTerm*, pLower, pUpper);
|
||||
}
|
||||
|
||||
/* If possible, improve on the iLower estimate using ($P:$L). */
|
||||
if( pLower ){
|
||||
int bOk; /* True if value is extracted from pExpr */
|
||||
Expr *pExpr = pLower->pExpr->pRight;
|
||||
assert( (pLower->eOperator & (WO_GT|WO_GE))!=0 );
|
||||
rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk);
|
||||
if( rc==SQLITE_OK && bOk ){
|
||||
tRowcnt iNew;
|
||||
whereKeyStats(pParse, p, pRec, 0, a);
|
||||
iNew = a[0] + ((pLower->eOperator & WO_GT) ? a[1] : 0);
|
||||
iNew = a[0] + ((pLower->eOperator & (WO_GT|WO_LE)) ? a[1] : 0);
|
||||
if( iNew>iLower ) iLower = iNew;
|
||||
nOut--;
|
||||
pLower = 0;
|
||||
@@ -2227,12 +2234,11 @@ static int whereRangeScanEst(
|
||||
if( pUpper ){
|
||||
int bOk; /* True if value is extracted from pExpr */
|
||||
Expr *pExpr = pUpper->pExpr->pRight;
|
||||
assert( (pUpper->eOperator & (WO_LT|WO_LE))!=0 );
|
||||
rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, aff, nEq, &bOk);
|
||||
if( rc==SQLITE_OK && bOk ){
|
||||
tRowcnt iNew;
|
||||
whereKeyStats(pParse, p, pRec, 1, a);
|
||||
iNew = a[0] + ((pUpper->eOperator & WO_LE) ? a[1] : 0);
|
||||
iNew = a[0] + ((pUpper->eOperator & (WO_GT|WO_LE)) ? a[1] : 0);
|
||||
if( iNew<iUpper ) iUpper = iNew;
|
||||
nOut--;
|
||||
pUpper = 0;
|
||||
@@ -4139,7 +4145,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
|
||||
** than pTemplate, so just ignore pTemplate */
|
||||
#if WHERETRACE_ENABLED /* 0x8 */
|
||||
if( sqlite3WhereTrace & 0x8 ){
|
||||
sqlite3DebugPrintf("ins-noop: ");
|
||||
sqlite3DebugPrintf(" skip: ");
|
||||
whereLoopPrint(pTemplate, pBuilder->pWC);
|
||||
}
|
||||
#endif
|
||||
@@ -4155,10 +4161,10 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
|
||||
#if WHERETRACE_ENABLED /* 0x8 */
|
||||
if( sqlite3WhereTrace & 0x8 ){
|
||||
if( p!=0 ){
|
||||
sqlite3DebugPrintf("ins-del: ");
|
||||
sqlite3DebugPrintf("replace: ");
|
||||
whereLoopPrint(p, pBuilder->pWC);
|
||||
}
|
||||
sqlite3DebugPrintf("ins-new: ");
|
||||
sqlite3DebugPrintf(" add: ");
|
||||
whereLoopPrint(pTemplate, pBuilder->pWC);
|
||||
}
|
||||
#endif
|
||||
@@ -4182,7 +4188,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
|
||||
*ppTail = pToDel->pNextLoop;
|
||||
#if WHERETRACE_ENABLED /* 0x8 */
|
||||
if( sqlite3WhereTrace & 0x8 ){
|
||||
sqlite3DebugPrintf("ins-del: ");
|
||||
sqlite3DebugPrintf(" delete: ");
|
||||
whereLoopPrint(pToDel, pBuilder->pWC);
|
||||
}
|
||||
#endif
|
||||
|
117
test/analyzeD.test
Normal file
117
test/analyzeD.test
Normal file
@@ -0,0 +1,117 @@
|
||||
# 2005 July 22
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library.
|
||||
# This file implements tests for the ANALYZE command.
|
||||
#
|
||||
# $Id: analyze.test,v 1.9 2008/08/11 18:44:58 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set ::testprefix analyzeD
|
||||
|
||||
ifcapable {!stat4} {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
# Set up a table with the following properties:
|
||||
#
|
||||
# * Contains 1000 rows.
|
||||
# * Column a contains even integers between 0 and 18, inclusive (so that
|
||||
# a=? for any such integer matches 100 rows).
|
||||
# * Column b contains integers between 0 and 9, inclusive.
|
||||
# * Column c contains integers between 0 and 199, inclusive (so that
|
||||
# for any such integer, c=? matches 5 rows).
|
||||
# * Then add 7 rows with a new value for "a" - 3001. The stat4 table will
|
||||
# not contain any samples with a=3001.
|
||||
#
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(a, b, c);
|
||||
}
|
||||
do_test 1.1 {
|
||||
for {set i 1} {$i < 1000} {incr i} {
|
||||
set c [expr $i % 200]
|
||||
execsql { INSERT INTO t1(a, b, c) VALUES( 2*($i/100), $i%10, $c ) }
|
||||
}
|
||||
|
||||
execsql {
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3001);
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3002);
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3003);
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3004);
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3005);
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3006);
|
||||
INSERT INTO t1 VALUES(3001, 3001, 3007);
|
||||
|
||||
CREATE INDEX t1_ab ON t1(a, b);
|
||||
CREATE INDEX t1_c ON t1(c);
|
||||
|
||||
ANALYZE;
|
||||
}
|
||||
} {}
|
||||
|
||||
# With full ANALYZE data, SQLite sees that c=150 (5 rows) is better than
|
||||
# a=3001 (7 rows).
|
||||
#
|
||||
do_eqp_test 1.2 {
|
||||
SELECT * FROM t1 WHERE a=3001 AND c=150;
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1_c (c=?)}
|
||||
}
|
||||
|
||||
do_test 1.3 {
|
||||
execsql { DELETE FROM sqlite_stat1 }
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
} {}
|
||||
|
||||
# Without stat1, because 3001 is larger than all samples in the stat4
|
||||
# table, SQLite things that a=3001 matches just 1 row. So it (incorrectly)
|
||||
# chooses it over the c=150 index (5 rows). Even with stat1 data, things
|
||||
# worked this way before commit [e6f7f97dbc].
|
||||
#
|
||||
do_eqp_test 1.4 {
|
||||
SELECT * FROM t1 WHERE a=3001 AND c=150;
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1_ab (a=?)}
|
||||
}
|
||||
|
||||
do_test 1.5 {
|
||||
execsql {
|
||||
UPDATE t1 SET a=13 WHERE a = 3001;
|
||||
ANALYZE;
|
||||
}
|
||||
} {}
|
||||
|
||||
do_eqp_test 1.6 {
|
||||
SELECT * FROM t1 WHERE a=13 AND c=150;
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1_c (c=?)}
|
||||
}
|
||||
|
||||
do_test 1.7 {
|
||||
execsql { DELETE FROM sqlite_stat1 }
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
} {}
|
||||
|
||||
# Same test as 1.4, except this time the 7 rows that match the a=? condition
|
||||
# do not feature larger values than all rows in the stat4 table. So SQLite
|
||||
# gets this right, even without stat1 data.
|
||||
do_eqp_test 1.8 {
|
||||
SELECT * FROM t1 WHERE a=13 AND c=150;
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1_c (c=?)}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
242
test/analyzeE.test
Normal file
242
test/analyzeE.test
Normal file
@@ -0,0 +1,242 @@
|
||||
# 2014-10-08
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements tests for using STAT4 information
|
||||
# on a descending index in a range query.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set ::testprefix analyzeE
|
||||
|
||||
ifcapable {!stat4} {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
# Verify that range queries on an ASCENDING index will use the
|
||||
# index only if the range covers only a small fraction of the
|
||||
# entries.
|
||||
#
|
||||
do_execsql_test analyzeE-1.0 {
|
||||
CREATE TABLE t1(a,b);
|
||||
WITH RECURSIVE
|
||||
cnt(x) AS (VALUES(1000) UNION ALL SELECT x+1 FROM cnt WHERE x<2000)
|
||||
INSERT INTO t1(a,b) SELECT x, x FROM cnt;
|
||||
CREATE INDEX t1a ON t1(a);
|
||||
ANALYZE;
|
||||
} {}
|
||||
do_execsql_test analyzeE-1.1 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 500 AND 2500;
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-1.2 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 2900 AND 3000;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.3 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1700 AND 1750;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.4 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1 AND 500
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.5 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 3000 AND 3000000
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.6 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<500
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.7 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>2500
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.8 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1900
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.9 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1100
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-1.10 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1100
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-1.11 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1900
|
||||
} {/SCAN TABLE t1/}
|
||||
|
||||
# Verify that everything works the same on a DESCENDING index.
|
||||
#
|
||||
do_execsql_test analyzeE-2.0 {
|
||||
DROP INDEX t1a;
|
||||
CREATE INDEX t1a ON t1(a DESC);
|
||||
ANALYZE;
|
||||
} {}
|
||||
do_execsql_test analyzeE-2.1 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 500 AND 2500;
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-2.2 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 2900 AND 3000;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.3 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1700 AND 1750;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.4 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1 AND 500
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.5 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 3000 AND 3000000
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.6 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<500
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.7 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>2500
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.8 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1900
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.9 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1100
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-2.10 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1100
|
||||
} {/SEARCH TABLE t1 USING INDEX t1a/}
|
||||
do_execsql_test analyzeE-2.11 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1900
|
||||
} {/SCAN TABLE t1/}
|
||||
|
||||
# Now do a range query on the second term of an ASCENDING index
|
||||
# where the first term is constrained by equality.
|
||||
#
|
||||
do_execsql_test analyzeE-3.0 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,b,c);
|
||||
WITH RECURSIVE
|
||||
cnt(x) AS (VALUES(1000) UNION ALL SELECT x+1 FROM cnt WHERE x<2000)
|
||||
INSERT INTO t1(a,b,c) SELECT x, x, 123 FROM cnt;
|
||||
CREATE INDEX t1ca ON t1(c,a);
|
||||
ANALYZE;
|
||||
} {}
|
||||
do_execsql_test analyzeE-3.1 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 500 AND 2500 AND c=123;
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-3.2 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 2900 AND 3000 AND c=123;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.3 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1700 AND 1750 AND c=123;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.4 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1 AND 500 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.5 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 3000 AND 3000000 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.6 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<500 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.7 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>2500 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.8 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1900 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.9 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1100 AND c=123
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-3.10 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1100 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-3.11 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1900 AND c=123
|
||||
} {/SCAN TABLE t1/}
|
||||
|
||||
# Repeat the 3.x tests using a DESCENDING index
|
||||
#
|
||||
do_execsql_test analyzeE-4.0 {
|
||||
DROP INDEX t1ca;
|
||||
CREATE INDEX t1ca ON t1(c ASC,a DESC);
|
||||
ANALYZE;
|
||||
} {}
|
||||
do_execsql_test analyzeE-4.1 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 500 AND 2500 AND c=123;
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-4.2 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 2900 AND 3000 AND c=123;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.3 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1700 AND 1750 AND c=123;
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.4 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 1 AND 500 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.5 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a BETWEEN 3000 AND 3000000 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.6 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<500 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.7 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>2500 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.8 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1900 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.9 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a>1100 AND c=123
|
||||
} {/SCAN TABLE t1/}
|
||||
do_execsql_test analyzeE-4.10 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1100 AND c=123
|
||||
} {/SEARCH TABLE t1 USING INDEX t1ca/}
|
||||
do_execsql_test analyzeE-4.11 {
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT * FROM t1 WHERE a<1900 AND c=123
|
||||
} {/SCAN TABLE t1/}
|
||||
|
||||
finish_test
|
@@ -75,9 +75,12 @@ do_test 2.2 {
|
||||
catchsql { SELECT * FROM r WHERE x >= 10 }
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
if {[db one {SELECT sqlite_compileoption_used('ENABLE_OVERSIZE_CELL_CHECK')}]} {
|
||||
# The following tests only work if OVERSIZE_CELL_CHECK is disabled
|
||||
} else {
|
||||
reset_db
|
||||
|
||||
do_execsql_test 3.1 {
|
||||
PRAGMA auto_vacuum=0;
|
||||
PRAGMA page_size = 512;
|
||||
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
|
||||
WITH s(a, b) AS (
|
||||
@@ -98,8 +101,8 @@ do_test 3.2 {
|
||||
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
do_catchsql_test 3.2 {
|
||||
do_catchsql_test 3.3 {
|
||||
INSERT INTO t1 VALUES(9, 'klmnopqrst');
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
} ;# end-if !defined(ENABLE_OVERSIZE_CELL_CHECK)
|
||||
finish_test
|
||||
|
@@ -862,11 +862,11 @@ do_createtable_tests 3.2.3 -query {
|
||||
3 "INSERT INTO t1 DEFAULT VALUES" {NULL NULL NULL}
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-62940-43005 An explicit DEFAULT clause may specify that
|
||||
# EVIDENCE-OF: R-07343-35026 An explicit DEFAULT clause may specify that
|
||||
# the default value is NULL, a string constant, a blob constant, a
|
||||
# signed-number, or any constant expression enclosed in parentheses. An
|
||||
# explicit default value may also be one of the special case-independent
|
||||
# keywords CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP.
|
||||
# signed-number, or any constant expression enclosed in parentheses. A
|
||||
# default value may also be one of the special case-independent keywords
|
||||
# CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP.
|
||||
#
|
||||
do_execsql_test e_createtable-3.3.1 {
|
||||
CREATE TABLE t4(
|
||||
@@ -884,9 +884,9 @@ do_execsql_test e_createtable-3.3.1 {
|
||||
);
|
||||
} {}
|
||||
|
||||
# EVIDENCE-OF: R-36381-62919 For the purposes of the DEFAULT clause, an
|
||||
# expression is considered constant provided that it does not contain
|
||||
# any sub-queries, column or table references, or string literals
|
||||
# EVIDENCE-OF: R-18415-27776 For the purposes of the DEFAULT clause, an
|
||||
# expression is considered constant if it does contains no sub-queries,
|
||||
# column or table references, bound parameters, or string literals
|
||||
# enclosed in double-quotes instead of single-quotes.
|
||||
#
|
||||
do_createtable_tests 3.4.1 -error {
|
||||
@@ -896,6 +896,7 @@ do_createtable_tests 3.4.1 -error {
|
||||
2 {CREATE TABLE t5(x DEFAULT ( "abc" ))} {}
|
||||
3 {CREATE TABLE t5(x DEFAULT ( 1 IN (SELECT 1) ))} {}
|
||||
4 {CREATE TABLE t5(x DEFAULT ( EXISTS (SELECT 1) ))} {}
|
||||
5 {CREATE TABLE t5(x DEFAULT ( x!=?1 ))} {}
|
||||
}
|
||||
do_createtable_tests 3.4.2 -repair {
|
||||
catchsql { DROP TABLE t5 }
|
||||
|
@@ -125,6 +125,9 @@ if {$tcl_platform(platform) == "unix"} {
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_uri 1
|
||||
|
||||
# EVIDENCE-OF: R-06842-00595 If the URI contains an authority, then it
|
||||
# must be either an empty string or the string "localhost".
|
||||
#
|
||||
# EVIDENCE-OF: R-17482-00398 If the authority is not an empty string or
|
||||
# "localhost", an error is returned to the caller.
|
||||
#
|
||||
|
@@ -205,6 +205,10 @@ test_expr expr-1.125 {i1=6, i2=NULL} \
|
||||
test_expr expr-1.126 {i1=8, i2=8} \
|
||||
{CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no
|
||||
|
||||
do_catchsql_test expr-1.127 {
|
||||
SELECT 1 IS #1;
|
||||
} {1 {near "#1": syntax error}}
|
||||
|
||||
ifcapable floatingpoint {if {[working_64bit_int]} {
|
||||
test_expr expr-1.200\
|
||||
{i1=9223372036854775806, i2=1} {i1+i2} 9223372036854775807
|
||||
|
@@ -24,12 +24,16 @@ ifcapable !fts3||!icu {
|
||||
|
||||
set sqlite_fts3_enable_parentheses 1
|
||||
|
||||
proc test_icu_fts3expr {expr} {
|
||||
db one {SELECT fts3_exprtest('icu', $expr, 'a', 'b', 'c')}
|
||||
proc test_fts3expr {tokenizer expr} {
|
||||
db one {SELECT fts3_exprtest($tokenizer, $expr, 'a', 'b', 'c')}
|
||||
}
|
||||
|
||||
proc do_icu_expr_test {tn expr res} {
|
||||
uplevel [list do_test $tn [list test_icu_fts3expr $expr] $res]
|
||||
uplevel [list do_test $tn [list test_fts3expr icu $expr] [list {*}$res]]
|
||||
}
|
||||
|
||||
proc do_simple_expr_test {tn expr res} {
|
||||
uplevel [list do_test $tn [list test_fts3expr simple $expr] [list {*}$res]]
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -53,5 +57,26 @@ do_icu_expr_test 2.1 {
|
||||
f (e NEAR/2 a)
|
||||
} {AND {AND {AND {PHRASE 3 0 f} {PHRASE 3 0 (}} {NEAR/2 {PHRASE 3 0 e} {PHRASE 3 0 a}}} {PHRASE 3 0 )}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
do_simple_expr_test 3.1 {*lOl* *h4h*} {
|
||||
AND {PHRASE 3 0 lol+} {PHRASE 3 0 h4h+}
|
||||
}
|
||||
|
||||
do_icu_expr_test 3.2 {*lOl* *h4h*} {
|
||||
AND {AND {AND {PHRASE 3 0 *} {PHRASE 3 0 lol+}} {PHRASE 3 0 *}} {PHRASE 3 0 h4h+}
|
||||
}
|
||||
|
||||
do_simple_expr_test 3.3 { * } { }
|
||||
do_simple_expr_test 3.4 { *a } { PHRASE 3 0 a }
|
||||
do_simple_expr_test 3.5 { a*b } { AND {PHRASE 3 0 a+} {PHRASE 3 0 b} }
|
||||
do_simple_expr_test 3.6 { *a*b } { AND {PHRASE 3 0 a+} {PHRASE 3 0 b} }
|
||||
do_simple_expr_test 3.7 { *"abc" } { PHRASE 3 0 abc }
|
||||
do_simple_expr_test 3.8 { "abc"* } { PHRASE 3 0 abc }
|
||||
do_simple_expr_test 3.8 { "ab*c" } { PHRASE 3 0 ab+ c }
|
||||
|
||||
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
|
||||
|
||||
|
@@ -433,4 +433,21 @@ do_execsql_test 9.1 {
|
||||
SELECT snippet(ft2, '[', ']', '', -1, 1) FROM ft2 WHERE ft2 MATCH 'c';
|
||||
} {{[c]} {[c]}}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Test for a memory leak
|
||||
#
|
||||
do_execsql_test 10.1 {
|
||||
DROP TABLE t10;
|
||||
CREATE VIRTUAL TABLE t10 USING fts4(idx, value);
|
||||
INSERT INTO t10 values (1, 'one'),(2, 'two'),(3, 'three');
|
||||
SELECT docId, t10.*
|
||||
FROM t10
|
||||
JOIN (SELECT 1 AS idx UNION SELECT 2 UNION SELECT 3) AS x
|
||||
WHERE t10 MATCH x.idx
|
||||
AND matchinfo(t10) not null
|
||||
GROUP BY docId
|
||||
ORDER BY 1;
|
||||
} {1 1 one 2 2 two 3 3 three}
|
||||
|
||||
|
||||
finish_test
|
||||
|
@@ -119,8 +119,6 @@ do_execsql_test 7.0 {
|
||||
PRAGMA cache_size = 5;
|
||||
}
|
||||
do_faultsim_test 7 -faults oom-trans* -prep {
|
||||
if {$iFail < 500} { set iFail 2000 }
|
||||
if {$iFail > 1215} { set iFail 2000 }
|
||||
} -body {
|
||||
execsql {
|
||||
WITH r(x,y) AS (
|
||||
|
49
test/ovfl.test
Normal file
49
test/ovfl.test
Normal file
@@ -0,0 +1,49 @@
|
||||
# 2014 October 01
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the SQLITE_DIRECT_OVERFLOW_READ logic.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix ovfl
|
||||
|
||||
# Populate table t2:
|
||||
#
|
||||
# CREATE TABLE t1(c1 TEXT, c2 TEXT);
|
||||
#
|
||||
# with 2000 rows. In each row, c2 spans multiple overflow pages. The text
|
||||
# value of c1 ranges in size from 1 to 2000 bytes. The idea is to create
|
||||
# at least one row where the first byte of c2 is also the first byte of
|
||||
# an overflow page. This was at one point exposing an obscure bug in the
|
||||
# SQLITE_DIRECT_OVERFLOW_READ logic.
|
||||
#
|
||||
do_test 1.1 {
|
||||
set c2 [string repeat abcdefghij 200]
|
||||
execsql {
|
||||
PRAGMA cache_size = 10;
|
||||
CREATE TABLE t1(c1 TEXT, c2 TEXT);
|
||||
BEGIN;
|
||||
}
|
||||
for {set i 1} {$i <= 2000} {incr i} {
|
||||
set c1 [string repeat . $i]
|
||||
execsql { INSERT INTO t1 VALUES($c1, $c2) }
|
||||
}
|
||||
execsql COMMIT
|
||||
} {}
|
||||
|
||||
do_execsql_test 1.2 {
|
||||
SELECT sum(length(c2)) FROM t1;
|
||||
} [expr 2000 * 2000]
|
||||
|
||||
finish_test
|
||||
|
||||
|
@@ -51,6 +51,13 @@ do_test sqllimits1-1.9 {
|
||||
do_test sqllimits1-1.10 {
|
||||
sqlite3_limit db SQLITE_LIMIT_VARIABLE_NUMBER -1
|
||||
} $SQLITE_MAX_VARIABLE_NUMBER
|
||||
do_test sqllimits1-1.11 {
|
||||
sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH -1
|
||||
} $SQLITE_MAX_TRIGGER_DEPTH
|
||||
do_test sqllimits1-1.12 {
|
||||
sqlite3_limit db SQLITE_LIMIT_WORKER_THREADS 99999
|
||||
sqlite3_limit db SQLITE_LIMIT_WORKER_THREADS -1
|
||||
} $SQLITE_MAX_WORKER_THREADS
|
||||
|
||||
# Limit parameters out of range.
|
||||
#
|
||||
|
Reference in New Issue
Block a user