Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7547f78889 |
+8
-21
@@ -70,26 +70,17 @@ static int fts3auxConnectMethod(
|
||||
|
||||
UNUSED_PARAMETER(pUnused);
|
||||
|
||||
/* The user should invoke this in one of two forms:
|
||||
**
|
||||
** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table);
|
||||
** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table-db, fts4-table);
|
||||
*/
|
||||
if( argc!=4 && argc!=5 ) goto bad_args;
|
||||
/* The user should specify a single argument - the name of an fts3 table. */
|
||||
if( argc!=4 ){
|
||||
*pzErr = sqlite3_mprintf(
|
||||
"wrong number of arguments to fts4aux constructor"
|
||||
);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
zDb = argv[1];
|
||||
nDb = (int)strlen(zDb);
|
||||
if( argc==5 ){
|
||||
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){
|
||||
zDb = argv[3];
|
||||
nDb = (int)strlen(zDb);
|
||||
zFts3 = argv[4];
|
||||
}else{
|
||||
goto bad_args;
|
||||
}
|
||||
}else{
|
||||
zFts3 = argv[3];
|
||||
}
|
||||
zFts3 = argv[3];
|
||||
nFts3 = (int)strlen(zFts3);
|
||||
|
||||
rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA);
|
||||
@@ -112,10 +103,6 @@ static int fts3auxConnectMethod(
|
||||
|
||||
*ppVtab = (sqlite3_vtab *)p;
|
||||
return SQLITE_OK;
|
||||
|
||||
bad_args:
|
||||
*pzErr = sqlite3_mprintf("invalid arguments to fts4aux constructor");
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
C Make\sthe\sSQLITE_EXTENSION_INIT1\sand\sSQLITE_EXTENSION_INIT2\smacros\sinto\nno-ops\sif\sthe\sextension\sis\sstatically\slinked.
|
||||
D 2013-04-19T01:23:06.788
|
||||
C Expand\sscope\sof\sthe\sSQLITE_DISABLE_MMAP\sdefine\sfor\sthe\sWin32\sVFS.
|
||||
D 2013-04-11T22:52:44.089
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 3dd3fcb87b70c78d99b2c8a03e44ec86d6ca9ce2
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@@ -58,7 +58,7 @@ F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c 0eaedfc6d2eb22563ef1d044dcfed93b70ec79f2
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h 1e58825246b56259267382d2f9902774c049460a
|
||||
F ext/fts3/fts3_aux.c b02632f6dd0e375ce97870206d914ea6d8df5ccd
|
||||
F ext/fts3/fts3_aux.c 5205182bd8f372782597888156404766edf5781e
|
||||
F ext/fts3/fts3_expr.c 6cb4410f87676ae633bd7923bbc78526cb839c4d
|
||||
F ext/fts3/fts3_hash.c 8dd2d06b66c72c628c2732555a32bc0943114914
|
||||
F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf
|
||||
@@ -110,11 +110,11 @@ F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
|
||||
F mkopcodec.awk f6fccee29e68493bfd90a2e0466ede5fa94dd2fc
|
||||
F mkopcodeh.awk 29b84656502eee5f444c3147f331ee686956ab0e
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/config01.test 3f4ddeb152a4f83872f0fa7fcb48d9fd609893da
|
||||
F mptest/config02.test 962913ed2b537d60de4126db7fe54716865cdd22
|
||||
F mptest/crash01.test a5f31998ed48de8267d6620e8af107ec148e5f12
|
||||
F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
|
||||
F mptest/mptest.c 499a74af4be293b7c1c7c3d40f332b67227dd739
|
||||
F mptest/mptest.c 53066ffe4ae6f0c4de451cc77985b88d0fee2aec
|
||||
F mptest/multiwrite01.test 81fbc17657964889b60750bd7bbb1deffe8f4d42
|
||||
F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
@@ -127,20 +127,20 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
|
||||
F src/backup.c b266767351ae2d847716c56fcb2a1fea7c761c03
|
||||
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
|
||||
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
|
||||
F src/btree.c 480a6d255cc4f066029daf23dd54acf152cd0e13
|
||||
F src/btree.c 5f2c4fe72f663bba837c5d01a732799c1d1c93f8
|
||||
F src/btree.h d9490cd37aaeb530a41b07f06e1262950b1be916
|
||||
F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2
|
||||
F src/build.c 083da8466fd7e481cb8bd5264398f537507f6176
|
||||
F src/callback.c d7e46f40c3cf53c43550b7da7a1d0479910b62cc
|
||||
F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
|
||||
F src/ctime.c 4262c227bc91cecc61ae37ed3a40f08069cfa267
|
||||
F src/ctime.c 61a53c7e0db5e7ba60cf23b73deaf6779aa715d3
|
||||
F src/date.c 067a81c9942c497aafd2c260e13add8a7d0c7dd4
|
||||
F src/delete.c aeabdabeeeaa0584127f291baa9617153d334778
|
||||
F src/expr.c 48048fca951eedbc74aa32262154410d56c83812
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c e16942bd5c8a868ac53287886464a5ed0e72b179
|
||||
F src/func.c d3fdcff9274bc161152e67ed3f626841c247f4b9
|
||||
F src/global.c 5caf4deab621abb45b4c607aad1bd21c20aac759
|
||||
F src/global.c d2494a1cea8f66a2cab8258449df07f8f0ae6330
|
||||
F src/hash.c ac3470bbf1ca4ae4e306a8ecb0fdf1731810ffe4
|
||||
F src/hash.h 8890a25af81fb85a9ad7790d32eedab4b994da22
|
||||
F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
|
||||
@@ -148,8 +148,8 @@ F src/insert.c f7cb141e8ce257cb6b15c497f09e4e23d6055599
|
||||
F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
|
||||
F src/legacy.c 0df0b1550b9cc1f58229644735e317ac89131f12
|
||||
F src/lempar.c cdf0a000315332fc9b50b62f3b5e22e080a0952b
|
||||
F src/loadext.c c48f7f3f170e502fe0cc20748e03c6e0b5a016c2
|
||||
F src/main.c de47c3e6b68f512b9e64ba2533ee4eecc9d501c1
|
||||
F src/loadext.c 1422eba4aa2b1fb5f7b3aef574752272477d21e2
|
||||
F src/main.c 54a841854734b6731c4d026834788cac6a19f3d1
|
||||
F src/malloc.c fe085aa851b666b7c375c1ff957643dc20a04bf6
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 437c7c4af964895d4650f29881df63535caaa1fa
|
||||
@@ -163,30 +163,30 @@ F src/mutex_noop.c 7682796b7d8d39bf1c138248858efcd10c9e1553
|
||||
F src/mutex_unix.c c3a4e00f96ba068a8dbef34084465979aaf369cc
|
||||
F src/mutex_w32.c 32a9b3841e2d757355f0012b860b1bc5e01eafa0
|
||||
F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30
|
||||
F src/os.c b4ad71336fd96f97776f75587cd9e8218288f5be
|
||||
F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
|
||||
F src/os.c ca679b293a6233327e418fd1dde2cd5db3e90932
|
||||
F src/os.h ae08bcc5f6ec6b339f4a2adf3931bb88cc14c3e4
|
||||
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
||||
F src/os_unix.c 0a561eae5965c9371300b0419027f5ae9f847af2
|
||||
F src/os_win.c 673b3e3d1fa3040d8d95a7f1f5e0e553aed56cfb
|
||||
F src/pager.c 6c3a8a5d665498b0344395a2c9f82d5abc4cc771
|
||||
F src/os_unix.c 5707fcb125f043e2d3376ea862e8ec83633c5e0e
|
||||
F src/os_win.c 190be0e689be61b3dcb8c1d253bc967e09c1866e
|
||||
F src/pager.c 28f45e60d9a173368872d6e688e7a848c3926344
|
||||
F src/pager.h 5cb78b8e1adfd5451e600be7719f5a99d87ac3b1
|
||||
F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
|
||||
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
|
||||
F src/pcache.h a5e4f5d9f5d592051d91212c5949517971ae6222
|
||||
F src/pcache1.c 9fd22671c270b35131ef480bbc00392b8b5f8ab9
|
||||
F src/pragma.c 3eacf001cbf4becbd494f8d82d08fdf1648cf8cb
|
||||
F src/pragma.c 216d6c24520f7b2e267a2356e5d3269d28690f49
|
||||
F src/prepare.c 743e484233c51109666d402f470523553b41797c
|
||||
F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f
|
||||
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
|
||||
F src/resolve.c 10a1b332e3eb36e5d561085e18c58a8578cd7d73
|
||||
F src/resolve.c 9079da7d59aed2bb14ec8315bc7f720dd85b5b65
|
||||
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
|
||||
F src/select.c 01540bcd3df3c8f1187158e77986028b1c667258
|
||||
F src/shell.c aca9d94653decd4496846dee0c7ba83eaf96a46d
|
||||
F src/sqlite.h.in a291a999d28ebc16cd1fe7fdd010dfe5266ef767
|
||||
F src/shell.c 319b7791cee6c763b60fde1b590bfaf62613cf37
|
||||
F src/sqlite.h.in f606903594d314d1b63e677affb1a03e3c9a49c7
|
||||
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
|
||||
F src/sqlite3ext.h d936f797812c28b81b26ed18345baf8db28a21a5
|
||||
F src/sqliteInt.h 2a83cfec9963372b636b0cabd4b200c1f1074a99
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/sqlite3ext.h 7183ab832e23db0f934494f16928da127a571d75
|
||||
F src/sqliteInt.h 1c517a89cfdba28084093607ec79af70359c7f9b
|
||||
F src/sqliteLimit.h 3ea5c07b370b8033c30f66515ccf4e875c252429
|
||||
F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
F src/tclsqlite.c 9a716c737590d2f129d71c8fc7065e5aba0e7222
|
||||
@@ -200,10 +200,10 @@ F src/test7.c f4b894b7931f8cf9f5cbf37cfa0727703f526a40
|
||||
F src/test8.c 58ea1d9698f3947e4662107ef98f429e84ae20e0
|
||||
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
|
||||
F src/test_async.c 0612a752896fad42d55c3999a5122af10dcf22ad
|
||||
F src/test_autoext.c 5c95b5d435eaa09d6c0e7d90371c5ca8cd567701
|
||||
F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e
|
||||
F src/test_backup.c c129c91127e9b46e335715ae2e75756e25ba27de
|
||||
F src/test_btree.c 5b89601dcb42a33ba8b820a6b763cc9cb48bac16
|
||||
F src/test_config.c 95bb33e9dcaa340a296c0bf0e0ba3d1a1c8004c0
|
||||
F src/test_config.c b6f5d680f0cf03d0ae9d6165bd2e447d9b356e4a
|
||||
F src/test_demovfs.c 20a4975127993f4959890016ae9ce5535a880094
|
||||
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
|
||||
F src/test_fs.c 8f786bfd0ad48030cf2a06fb1f050e9c60a150d7
|
||||
@@ -258,7 +258,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
|
||||
F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
|
||||
F src/wal.h a4d3da523d55a226a0b28e9058ef88d0a8051887
|
||||
F src/walker.c 3d75ba73de15e0f8cd0737643badbeb0e002f07b
|
||||
F src/where.c e63f84e5583133c77573b78d3696dccd97bfd00d
|
||||
F src/where.c 4ad2329c439a30ddb915a780f6f80bdffafe3a64
|
||||
F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
|
||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
|
||||
@@ -376,7 +376,7 @@ F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c
|
||||
F test/ctime.test 7bd009071e242aac4f18521581536b652b789a47
|
||||
F test/date.test f3228180c87bbe5d39c9397bf001c0095c3821b9
|
||||
F test/dbstatus.test 207e5b63fcb7b9c3bb8e1fdf38ebd4654ad0e54b
|
||||
F test/dbstatus2.test 10418e62b3db5dca070f0c3eef3ea13946f339c2
|
||||
F test/dbstatus2.test f329941d5f4a8bc0ba6ec5735897ef0cf34e2f5f
|
||||
F test/default.test 6faf23ccb300114924353007795aa9a8ec0aa9dc
|
||||
F test/delete.test a065b05d2ebf60fd16639c579a4adfb7c381c701
|
||||
F test/delete2.test 3a03f2cca1f9a67ec469915cb8babd6485db43fa
|
||||
@@ -410,7 +410,7 @@ F test/eqp.test 46aa946dd55c90635327898275d3e533d23a9845
|
||||
F test/errmsg.test 050717f1c6a5685de9c79f5f9f6b83d7c592f73a
|
||||
F test/eval.test bc269c365ba877554948441e91ad5373f9f91be3
|
||||
F test/exclusive.test a1b324cb21834a490cd052d409d34789cfef57cb
|
||||
F test/exclusive2.test 881193eccec225cfed9d7f744b65e57f26adee25
|
||||
F test/exclusive2.test 354bdabe299a2546c898dff42f79079ff1590d88
|
||||
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/exists.test 8f7b27b61c2fbe5822f0a1f899c715d14e416e30
|
||||
F test/expr.test 67c9fd6f8f829e239dc8b0f4a08a73c08b09196d
|
||||
@@ -478,7 +478,7 @@ F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
|
||||
F test/fts3ao.test e7b80272efcced57d1d087a9da5c690dd7c21fd9
|
||||
F test/fts3atoken.test fb398ab50aa232489e2a17f9b29d7ad3a3885f36
|
||||
F test/fts3auto.test 74315a7377403a57ba82a652a33704197fe1e4be
|
||||
F test/fts3aux1.test 03cec2dea379931c219dd4406817485caa69d1d8
|
||||
F test/fts3aux1.test 0b02743955d56fc0d4d66236a26177bd1b726de0
|
||||
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
|
||||
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
|
||||
F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c
|
||||
@@ -515,7 +515,7 @@ F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891
|
||||
F test/fts4merge3.test aab02a09f50fe6baaddc2e159c3eabc116d45fc7
|
||||
F test/fts4unicode.test 25ccad45896f8e50f6a694cff738a35f798cdb40
|
||||
F test/full.test 6b3c8fb43c6beab6b95438c1675374b95fab245d
|
||||
F test/func.test b0fc34fdc36897769651975a2b0a606312753643
|
||||
F test/func.test a4f24707e6af0bcd4cb5b856af4462db40b047b1
|
||||
F test/func2.test 772d66227e4e6684b86053302e2d74a2500e1e0f
|
||||
F test/func3.test 001021e5b88bd02a3b365a5c5fd8f6f49d39744a
|
||||
F test/fuzz-oss1.test 4912e528ec9cf2f42134456933659d371c9e0d74
|
||||
@@ -533,7 +533,7 @@ F test/in2.test 5d4c61d17493c832f7d2d32bef785119e87bde75
|
||||
F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
|
||||
F test/in4.test 64f3cc1acde1b9161ccdd8e5bde3daefdb5b2617
|
||||
F test/in5.test 99f9a40af01711b06d2d614ecfe96129f334fba3
|
||||
F test/incrblob.test e81846d214f3637622620fbde7cd526781cfe328
|
||||
F test/incrblob.test 2100cb8964e4a106e5ca9bf80e2c5c3e8be33f77
|
||||
F test/incrblob2.test edc3a96e557bd61fb39acc8d2edd43371fbbaa19
|
||||
F test/incrblob3.test aedbb35ea1b6450c33b98f2b6ed98e5020be8dc7
|
||||
F test/incrblob4.test 09be37d3dd996a31ea6993bba7837ece549414a8
|
||||
@@ -637,7 +637,7 @@ F test/misc5.test 528468b26d03303b1f047146e5eefc941b9069f5
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test dd82ec9250b89178b96cd28b2aca70639d21e5b3
|
||||
F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054
|
||||
F test/mmap1.test 0b5802cf64acaa509ea889b3c708196cc6eb9d31
|
||||
F test/mmap1.test f064a9025136cd688c982ccdae81c7b4fac95724
|
||||
F test/mmap2.test a5ba639f90b5fc487400a49e158e14e465943e98
|
||||
F test/multiplex.test e08cc7177bd6d85990ee1d71100bb6c684c02256
|
||||
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
||||
@@ -657,17 +657,17 @@ F test/orderby2.test bc11009f7cd99d96b1b11e57b199b00633eb5b04
|
||||
F test/orderby3.test 8619d06a3debdcd80a27c0fdea5c40b468854b99
|
||||
F test/orderby4.test 4d39bfbaaa3ae64d026ca2ff166353d2edca4ba4
|
||||
F test/oserror.test 50417780d0e0d7cd23cf12a8277bb44024765df3
|
||||
F test/pager1.test 30e63afd425fea12285e9ec5fa1fd000808031f1
|
||||
F test/pager1.test 134144862f6a98f862dc2edda1b10ff499141bfa
|
||||
F test/pager2.test 67b8f40ae98112bcdba1f2b2d03ea83266418c71
|
||||
F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f
|
||||
F test/pagerfault.test 8483e65d33d5636e5b7656204bb274d826e728d9
|
||||
F test/pagerfault.test bba948be0564254b823ec6ca1fd95fbbfb0839a3
|
||||
F test/pagerfault2.test 1f79ea40d1133b2683a2f811b00f2399f7ec2401
|
||||
F test/pagerfault3.test f16e2efcb5fc9996d1356f7cbc44c998318ae1d7
|
||||
F test/pageropt.test 6b8f6a123a5572c195ad4ae40f2987007923bbd6
|
||||
F test/pageropt.test d6b695e6c12290c406150fc51eec32878d48df4c
|
||||
F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
|
||||
F test/pcache.test 065aa286e722ab24f2e51792c1f093bf60656b16
|
||||
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
|
||||
F test/permutations.test d2918e9ee6d0008292e5a70e90eed23b0440ca88
|
||||
F test/permutations.test b6cb45ce4d3193b831231025c9d30c77317dd240
|
||||
F test/pragma.test 60d29cd3d8098a2c20bf4c072810f99e3bf2757a
|
||||
F test/pragma2.test 3a55f82b954242c642f8342b17dffc8b47472947
|
||||
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
|
||||
@@ -685,7 +685,6 @@ F test/regexp1.test 5cbb6e7122ca51260d71079cf9245b63b8f64e1a
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a
|
||||
F test/releasetest.tcl 06d289d8255794073a58d2850742f627924545ce
|
||||
F test/resolver01.test d1b487fc567bdb70b5dd09ccaaa877ddc61a233e
|
||||
F test/rollback.test a1b4784b864331eae8b2a98c189efa2a8b11ff07
|
||||
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
|
||||
F test/rowid.test f777404492adb0e00868fd706a3721328fd3af48
|
||||
@@ -758,7 +757,7 @@ F test/substr.test 18f57c4ca8a598805c4d64e304c418734d843c1a
|
||||
F test/superlock.test 1cde669f68d2dd37d6c9bd35eee1d95491ae3fc2
|
||||
F test/sync.test a34cd43e98b7fb84eabbf38f7ed8f7349b3f3d85
|
||||
F test/syscall.test a653783d985108c4912cc64d341ffbbb55ad2806
|
||||
F test/sysfault.test fa776e60bf46bdd3ae69f0b73e46ee3977a58ae6
|
||||
F test/sysfault.test 503f72712b2b21cb80dc9899e53c2e39484d0313
|
||||
F test/table.test a59d985ca366e39b17b175f387f9d5db5a18d4e2
|
||||
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
|
||||
F test/tclsqlite.test 37a61c2da7e3bfe3b8c1a2867199f6b860df5d43
|
||||
@@ -855,7 +854,7 @@ F test/tkt2686.test 6ee01c9b9e9c48f6d3a1fdd553b1cc4258f903d6
|
||||
F test/tkt2767.test 569000d842678f9cf2db7e0d1b27cbc9011381b0
|
||||
F test/tkt2817.test f31839e01f4243cff7399ef654d3af3558cb8d8d
|
||||
F test/tkt2820.test 39940276b3436d125deb7d8ebeee053e4cf13213
|
||||
F test/tkt2822.test c3589494fba643e039bcf0bfde7554ff6028406d
|
||||
F test/tkt2822.test f391776423a7c0d0949edfce375708bfb0f3141e
|
||||
F test/tkt2832.test a9b0b74a02dca166a04d9e37739c414b10929caa
|
||||
F test/tkt2854.test e432965db29e27e16f539b2ba7f502eb2ccc49af
|
||||
F test/tkt2920.test a8737380e4ae6424e00c0273dc12775704efbebf
|
||||
@@ -962,11 +961,11 @@ F test/vtabF.test fd5ad376f5a34fe0891df1f3cddb4fe7c3eb077e
|
||||
F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
|
||||
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
|
||||
F test/vtab_shared.test 82f463886e18d7f8395a4b6167c91815efe54839
|
||||
F test/wal.test 0b4837cd5e9283c116d30810a6859bed7425a95e
|
||||
F test/wal.test 20fb8d0f8e65e50eb675994cc3a4f0e692fd4faf
|
||||
F test/wal2.test d4b470f13c87f6d8268b004380afa04c3c67cb90
|
||||
F test/wal3.test b22eb662bcbc148c5f6d956eaf94b047f7afe9c0
|
||||
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
|
||||
F test/wal5.test 8f888b50f66b78821e61ed0e233ded5de378224b
|
||||
F test/wal5.test 13c980d4d8d2d6b558361f19bed4ab31d41a2c7c
|
||||
F test/wal6.test 2e3bc767d9c2ce35c47106148d43fcbd072a93b3
|
||||
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
|
||||
F test/wal8.test b3ee739fe8f7586aaebdc2367f477ebcf3e3b034
|
||||
@@ -1004,7 +1003,7 @@ F test/whereD.test 3f3ee93825c94804f1fc91eef2de0d365981759a
|
||||
F test/whereE.test 7bd34945797efef15819368479bacc34215e4e1d
|
||||
F test/whereF.test a0e296643cabe5278379bc1a0aa158cf3c54a1c9
|
||||
F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31
|
||||
F test/win32lock.test 7a6bd73a5dcdee39b5bb93e92395e1773a194361
|
||||
F test/win32lock.test 21810396eee150680cc398970839e6abdcb807b9
|
||||
F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688
|
||||
F test/zerodamage.test e7f77fded01dfcdf92ac2c5400f1e35d7a21463c
|
||||
F tool/build-all-msvc.bat 74fb6e5cca66ebdb6c9bbafb2f8b802f08146d38 x
|
||||
@@ -1051,7 +1050,10 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
||||
P 6cfa1d73d79b9f0be8157f0a37c264dd95b031c8
|
||||
R 6c3fdd8d85d98822b9ca8decd52bbb5c
|
||||
U drh
|
||||
Z 311c6fc82989346d7dcdfa6c2765eba0
|
||||
P f1b524b9d9ea3db96d54ac55c39f15e6879085bd
|
||||
R 81fda886c4b87168bc8522f21db6569f
|
||||
T *branch * winDisableMmap
|
||||
T *sym-winDisableMmap *
|
||||
T -sym-trunk *
|
||||
U mistachkin
|
||||
Z d00cd2eed7d26c94b83b76365b3988fe
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
86eb3eed4c70730dba0e319f243f8cb4fa8de06c
|
||||
daa168f3dad995c4b7dd60e7717db90639e167c2
|
||||
@@ -5,11 +5,11 @@
|
||||
PRAGMA page_size=8192;
|
||||
--task 1
|
||||
PRAGMA journal_mode=PERSIST;
|
||||
PRAGMA mmap_size=0;
|
||||
PRAGMA mmap_limit=0;
|
||||
--end
|
||||
--task 2
|
||||
PRAGMA journal_mode=TRUNCATE;
|
||||
PRAGMA mmap_size=28672;
|
||||
PRAGMA mmap_limit=28672;
|
||||
--end
|
||||
--task 3
|
||||
PRAGMA journal_mode=MEMORY;
|
||||
@@ -17,9 +17,6 @@ PRAGMA page_size=8192;
|
||||
--task 4
|
||||
PRAGMA journal_mode=OFF;
|
||||
--end
|
||||
--task 4
|
||||
PRAGMA mmap_size(268435456);
|
||||
--end
|
||||
--source multiwrite01.test
|
||||
--wait all
|
||||
PRAGMA page_size=16384;
|
||||
|
||||
@@ -3,19 +3,16 @@
|
||||
*/
|
||||
PRAGMA page_size=512;
|
||||
--task 1
|
||||
PRAGMA mmap_size=0;
|
||||
PRAGMA mmap_limit=0;
|
||||
--end
|
||||
--task 2
|
||||
PRAGMA mmap_size=28672;
|
||||
PRAGMA mmap_limit=28672;
|
||||
--end
|
||||
--task 3
|
||||
PRAGMA mmap_size=8192;
|
||||
PRAGMA mmap_limit=8192;
|
||||
--end
|
||||
--task 4
|
||||
PRAGMA mmap_size=65536;
|
||||
--end
|
||||
--task 5
|
||||
PRAGMA mmap_size=268435456;
|
||||
PRAGMA mmap_limit=65536;
|
||||
--end
|
||||
--source multiwrite01.test
|
||||
--source crash02.subtest
|
||||
|
||||
+11
-97
@@ -48,8 +48,10 @@
|
||||
|
||||
/* The suffix to append to the child command lines, if any */
|
||||
#if defined(_WIN32)
|
||||
# define CMDLINE_SUFFIX ""
|
||||
# define GETPID (int)GetCurrentProcessId
|
||||
#else
|
||||
# define CMDLINE_SUFFIX "&"
|
||||
# define GETPID getpid
|
||||
#endif
|
||||
|
||||
@@ -71,7 +73,6 @@ static struct Global {
|
||||
int taskId; /* Task ID. 0 means supervisor. */
|
||||
int iTrace; /* Tracing level */
|
||||
int bSqlTrace; /* True to trace SQL commands */
|
||||
int bIgnoreSqlErrors; /* Ignore errors in SQL statements */
|
||||
int nError; /* Number of errors */
|
||||
int nTest; /* Number of --match operators */
|
||||
int iTimeout; /* Milliseconds until a busy timeout */
|
||||
@@ -330,7 +331,6 @@ static void sqlTraceCallback(void *NotUsed1, const char *zSql){
|
||||
*/
|
||||
static void sqlErrorCallback(void *pArg, int iErrCode, const char *zMsg){
|
||||
UNUSED_PARAMETER(pArg);
|
||||
if( iErrCode==SQLITE_ERROR && g.bIgnoreSqlErrors ) return;
|
||||
if( (iErrCode&0xff)==SQLITE_SCHEMA && g.iTrace<3 ) return;
|
||||
if( g.iTimeout==0 && (iErrCode&0xff)==SQLITE_BUSY && g.iTrace<3 ) return;
|
||||
if( (iErrCode&0xff)==SQLITE_NOTICE ){
|
||||
@@ -629,20 +629,14 @@ static void startClient(int iClient){
|
||||
if( sqlite3_changes(g.db) ){
|
||||
char *zSys;
|
||||
int rc;
|
||||
zSys = sqlite3_mprintf("%s \"%s\" --client %d --trace %d",
|
||||
g.argv0, g.zDbFile, iClient, g.iTrace);
|
||||
if( g.bSqlTrace ){
|
||||
zSys = sqlite3_mprintf("%z --sqltrace", zSys);
|
||||
}
|
||||
if( g.bSync ){
|
||||
zSys = sqlite3_mprintf("%z --sync", zSys);
|
||||
}
|
||||
if( g.zVfs ){
|
||||
zSys = sqlite3_mprintf("%z --vfs \"%s\"", zSys, g.zVfs);
|
||||
}
|
||||
if( g.iTrace>=2 ) logMessage("system('%q')", zSys);
|
||||
zSys = sqlite3_mprintf(
|
||||
"%s \"%s\" --client %d --trace %d %s%s%s",
|
||||
g.argv0, g.zDbFile, iClient, g.iTrace,
|
||||
g.bSqlTrace ? "--sqltrace " : "",
|
||||
g.bSync ? "--sync " : "",
|
||||
CMDLINE_SUFFIX
|
||||
);
|
||||
#if !defined(_WIN32)
|
||||
zSys = sqlite3_mprintf("%z &", zSys);
|
||||
rc = system(zSys);
|
||||
if( rc ) errorMessage("system() fails with error code %d", rc);
|
||||
#else
|
||||
@@ -828,30 +822,6 @@ static char *filenameTail(char *z){
|
||||
return z+j;
|
||||
}
|
||||
|
||||
/*
|
||||
** Interpret zArg as a boolean value. Return either 0 or 1.
|
||||
*/
|
||||
static int booleanValue(char *zArg){
|
||||
int i;
|
||||
if( zArg==0 ) return 0;
|
||||
for(i=0; zArg[i]>='0' && zArg[i]<='9'; i++){}
|
||||
if( i>0 && zArg[i]==0 ) return atoi(zArg);
|
||||
if( sqlite3_stricmp(zArg, "on")==0 || sqlite3_stricmp(zArg,"yes")==0 ){
|
||||
return 1;
|
||||
}
|
||||
if( sqlite3_stricmp(zArg, "off")==0 || sqlite3_stricmp(zArg,"no")==0 ){
|
||||
return 0;
|
||||
}
|
||||
errorMessage("unknown boolean: [%s]", zArg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* This routine exists as a convenient place to set a debugger
|
||||
** breakpoint.
|
||||
*/
|
||||
static void test_breakpoint(void){ static volatile int cnt = 0; cnt++; }
|
||||
|
||||
/* Maximum number of arguments to a --command */
|
||||
#define MX_ARG 2
|
||||
|
||||
@@ -924,24 +894,13 @@ static void runScript(
|
||||
** Exit this process. If N>0 then exit without shutting down
|
||||
** SQLite. (In other words, simulate a crash.)
|
||||
*/
|
||||
if( strcmp(zCmd, "exit")==0 ){
|
||||
if( strcmp(zCmd, "exit")==0 && iClient>0 ){
|
||||
int rc = atoi(azArg[0]);
|
||||
finishScript(iClient, taskId, 1);
|
||||
if( rc==0 ) sqlite3_close(g.db);
|
||||
exit(rc);
|
||||
}else
|
||||
|
||||
/*
|
||||
** --testcase NAME
|
||||
**
|
||||
** Begin a new test case. Announce in the log that the test case
|
||||
** has begun.
|
||||
*/
|
||||
if( strcmp(zCmd, "testcase")==0 ){
|
||||
if( g.iTrace==1 ) logMessage("%.*s", len - 1, zScript+ii);
|
||||
stringReset(&sResult);
|
||||
}else
|
||||
|
||||
/*
|
||||
** --finish
|
||||
**
|
||||
@@ -971,7 +930,7 @@ static void runScript(
|
||||
char *zAns = zScript+ii;
|
||||
for(jj=7; jj<len-1 && isspace(zAns[jj]); jj++){}
|
||||
zAns += jj;
|
||||
if( len-jj-1!=sResult.n || strncmp(sResult.z, zAns, len-jj-1) ){
|
||||
if( strncmp(sResult.z, zAns, len-jj-1) ){
|
||||
errorMessage("line %d of %s:\nExpected [%.*s]\n Got [%s]",
|
||||
prevLine, zFilename, len-jj-1, zAns, sResult.z);
|
||||
}
|
||||
@@ -979,30 +938,6 @@ static void runScript(
|
||||
stringReset(&sResult);
|
||||
}else
|
||||
|
||||
/*
|
||||
** --glob ANSWER...
|
||||
** --notglob ANSWER....
|
||||
**
|
||||
** Check to see if output does or does not match the glob pattern
|
||||
** ANSWER.
|
||||
*/
|
||||
if( strcmp(zCmd, "glob")==0 || strcmp(zCmd, "notglob")==0 ){
|
||||
int jj;
|
||||
char *zAns = zScript+ii;
|
||||
char *zCopy;
|
||||
int isGlob = (zCmd[0]=='g');
|
||||
for(jj=9-3*isGlob; jj<len-1 && isspace(zAns[jj]); jj++){}
|
||||
zAns += jj;
|
||||
zCopy = sqlite3_mprintf("%.*s", len-jj-1, zAns);
|
||||
if( (sqlite3_strglob(zCopy, sResult.z)==0)^isGlob ){
|
||||
errorMessage("line %d of %s:\nExpected [%s]\n Got [%s]",
|
||||
prevLine, zFilename, zCopy, sResult.z);
|
||||
}
|
||||
sqlite3_free(zCopy);
|
||||
g.nTest++;
|
||||
stringReset(&sResult);
|
||||
}else
|
||||
|
||||
/*
|
||||
** --output
|
||||
**
|
||||
@@ -1145,26 +1080,6 @@ static void runScript(
|
||||
iBegin = ii+len;
|
||||
}else
|
||||
|
||||
/*
|
||||
** --breakpoint
|
||||
**
|
||||
** This command calls "test_breakpoint()" which is a routine provided
|
||||
** as a convenient place to set a debugger breakpoint.
|
||||
*/
|
||||
if( strcmp(zCmd, "breakpoint")==0 ){
|
||||
test_breakpoint();
|
||||
}else
|
||||
|
||||
/*
|
||||
** --show-sql-errors BOOLEAN
|
||||
**
|
||||
** Turn display of SQL errors on and off.
|
||||
*/
|
||||
if( strcmp(zCmd, "show-sql-errors")==0 ){
|
||||
g.bIgnoreSqlErrors = nArg>=1 ? !booleanValue(azArg[0]) : 1;
|
||||
}else
|
||||
|
||||
|
||||
/* error */{
|
||||
errorMessage("line %d of %s: unknown command --%s",
|
||||
prevLine, zFilename, zCmd);
|
||||
@@ -1317,7 +1232,6 @@ int main(int argc, char **argv){
|
||||
}
|
||||
rc = sqlite3_open_v2(g.zDbFile, &g.db, openFlags, g.zVfs);
|
||||
if( rc ) fatalError("cannot open [%s]", g.zDbFile);
|
||||
sqlite3_enable_load_extension(g.db, 1);
|
||||
sqlite3_busy_handler(g.db, busyHandler, 0);
|
||||
sqlite3_create_function(g.db, "vfsname", 0, SQLITE_UTF8, 0,
|
||||
vfsNameFunc, 0, 0);
|
||||
|
||||
+3
-3
@@ -1876,7 +1876,7 @@ int sqlite3BtreeOpen(
|
||||
rc = sqlite3PagerOpen(pVfs, &pBt->pPager, zFilename,
|
||||
EXTRA_SIZE, flags, vfsFlags, pageReinit);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3PagerSetMmapLimit(pBt->pPager, db->szMmap);
|
||||
sqlite3PagerSetMmapLimit(pBt->pPager, db->mxMmap);
|
||||
rc = sqlite3PagerReadFileheader(pBt->pPager,sizeof(zDbHeader),zDbHeader);
|
||||
}
|
||||
if( rc!=SQLITE_OK ){
|
||||
@@ -2147,11 +2147,11 @@ int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
|
||||
** Change the limit on the amount of the database file that may be
|
||||
** memory mapped.
|
||||
*/
|
||||
int sqlite3BtreeSetMmapLimit(Btree *p, sqlite3_int64 szMmap){
|
||||
int sqlite3BtreeSetMmapLimit(Btree *p, sqlite3_int64 mxMmap){
|
||||
BtShared *pBt = p->pBt;
|
||||
assert( sqlite3_mutex_held(p->db->mutex) );
|
||||
sqlite3BtreeEnter(p);
|
||||
sqlite3PagerSetMmapLimit(pBt->pPager, szMmap);
|
||||
sqlite3PagerSetMmapLimit(pBt->pPager, mxMmap);
|
||||
sqlite3BtreeLeave(p);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
+17
-12
@@ -48,14 +48,17 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_COVERAGE_TEST
|
||||
"COVERAGE_TEST",
|
||||
#endif
|
||||
#ifdef SQLITE_CURDIR
|
||||
"CURDIR",
|
||||
#endif
|
||||
#ifdef SQLITE_DEBUG
|
||||
"DEBUG",
|
||||
#endif
|
||||
#ifdef SQLITE_DEFAULT_LOCKING_MODE
|
||||
"DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE),
|
||||
#endif
|
||||
#if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc)
|
||||
"DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE),
|
||||
#ifdef SQLITE_DEFAULT_MMAP_LIMIT
|
||||
"DEFAULT_MMAP_LIMIT=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_LIMIT),
|
||||
#endif
|
||||
#ifdef SQLITE_DISABLE_DIRSYNC
|
||||
"DISABLE_DIRSYNC",
|
||||
@@ -63,6 +66,9 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_DISABLE_LFS
|
||||
"DISABLE_LFS",
|
||||
#endif
|
||||
#ifdef SQLITE_DISABLE_MMAP
|
||||
"DISABLE_MMAP",
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
|
||||
"ENABLE_ATOMIC_WRITE",
|
||||
#endif
|
||||
@@ -147,9 +153,6 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_LOCK_TRACE
|
||||
"LOCK_TRACE",
|
||||
#endif
|
||||
#if defined(SQLITE_MAX_MMAP_SIZE) && !defined(SQLITE_MAX_MMAP_SIZE_xc)
|
||||
"MAX_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_MAX_MMAP_SIZE),
|
||||
#endif
|
||||
#ifdef SQLITE_MAX_SCHEMA_RETRY
|
||||
"MAX_SCHEMA_RETRY=" CTIMEOPT_VAL(SQLITE_MAX_SCHEMA_RETRY),
|
||||
#endif
|
||||
@@ -207,6 +210,11 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_OMIT_CHECK
|
||||
"OMIT_CHECK",
|
||||
#endif
|
||||
/* // redundant
|
||||
** #ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS
|
||||
** "OMIT_COMPILEOPTION_DIAGS",
|
||||
** #endif
|
||||
*/
|
||||
#ifdef SQLITE_OMIT_COMPLETE
|
||||
"OMIT_COMPLETE",
|
||||
#endif
|
||||
@@ -348,13 +356,13 @@ static const char * const azCompileOpt[] = {
|
||||
#ifdef SQLITE_TCL
|
||||
"TCL",
|
||||
#endif
|
||||
#if defined(SQLITE_TEMP_STORE) && !defined(SQLITE_TEMP_STORE_xc)
|
||||
#ifdef SQLITE_TEMP_STORE
|
||||
"TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE),
|
||||
#endif
|
||||
#ifdef SQLITE_TEST
|
||||
"TEST",
|
||||
#endif
|
||||
#if defined(SQLITE_THREADSAFE)
|
||||
#ifdef SQLITE_THREADSAFE
|
||||
"THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE),
|
||||
#endif
|
||||
#ifdef SQLITE_USE_ALLOCA
|
||||
@@ -380,11 +388,8 @@ int sqlite3_compileoption_used(const char *zOptName){
|
||||
/* Since ArraySize(azCompileOpt) is normally in single digits, a
|
||||
** linear search is adequate. No need for a binary search. */
|
||||
for(i=0; i<ArraySize(azCompileOpt); i++){
|
||||
if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0
|
||||
&& sqlite3CtypeMap[(unsigned char)azCompileOpt[i][n]]==0
|
||||
){
|
||||
return 1;
|
||||
}
|
||||
if( (sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0)
|
||||
&& ( (azCompileOpt[i][n]==0) || (azCompileOpt[i][n]=='=') ) ) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-2
@@ -156,8 +156,7 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = {
|
||||
(void*)0, /* pHeap */
|
||||
0, /* nHeap */
|
||||
0, 0, /* mnHeap, mxHeap */
|
||||
SQLITE_DEFAULT_MMAP_SIZE, /* szMmap */
|
||||
SQLITE_MAX_MMAP_SIZE, /* mxMmap */
|
||||
SQLITE_DEFAULT_MMAP_LIMIT, /* mxMmap */
|
||||
(void*)0, /* pScratch */
|
||||
0, /* szScratch */
|
||||
0, /* nScratch */
|
||||
|
||||
+8
-66
@@ -415,23 +415,8 @@ static int sqlite3LoadExtension(
|
||||
void *handle;
|
||||
int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
char *zErrmsg = 0;
|
||||
const char *zEntry;
|
||||
char *zAltEntry = 0;
|
||||
void **aHandle;
|
||||
int nMsg = 300 + sqlite3Strlen30(zFile);
|
||||
int ii;
|
||||
|
||||
/* Shared library endings to try if zFile cannot be loaded as written */
|
||||
static const char *azEndings[] = {
|
||||
#if SQLITE_OS_WIN
|
||||
"dll"
|
||||
#elif defined(__APPLE__)
|
||||
"dylib"
|
||||
#else
|
||||
"so"
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
if( pzErrMsg ) *pzErrMsg = 0;
|
||||
|
||||
@@ -448,17 +433,11 @@ static int sqlite3LoadExtension(
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
zEntry = zProc ? zProc : "sqlite3_extension_init";
|
||||
if( zProc==0 ){
|
||||
zProc = "sqlite3_extension_init";
|
||||
}
|
||||
|
||||
handle = sqlite3OsDlOpen(pVfs, zFile);
|
||||
#if SQLITE_OS_UNIX || SQLITE_OS_WIN
|
||||
for(ii=0; ii<ArraySize(azEndings) && handle==0; ii++){
|
||||
char *zAltFile = sqlite3_mprintf("%s.%s", zFile, azEndings[ii]);
|
||||
if( zAltFile==0 ) return SQLITE_NOMEM;
|
||||
handle = sqlite3OsDlOpen(pVfs, zAltFile);
|
||||
sqlite3_free(zAltFile);
|
||||
}
|
||||
#endif
|
||||
if( handle==0 ){
|
||||
if( pzErrMsg ){
|
||||
*pzErrMsg = zErrmsg = sqlite3_malloc(nMsg);
|
||||
@@ -471,57 +450,20 @@ static int sqlite3LoadExtension(
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
|
||||
sqlite3OsDlSym(pVfs, handle, zEntry);
|
||||
|
||||
/* If no entry point was specified and the default legacy
|
||||
** entry point name "sqlite3_extension_init" was not found, then
|
||||
** construct an entry point name "sqlite3_X_init" where the X is
|
||||
** replaced by the lowercase value of every ASCII alphabetic
|
||||
** character in the filename after the last "/" upto the first ".",
|
||||
** and eliding the first three characters if they are "lib".
|
||||
** Examples:
|
||||
**
|
||||
** /usr/local/lib/libExample5.4.3.so ==> sqlite3_example_init
|
||||
** C:/lib/mathfuncs.dll ==> sqlite3_mathfuncs_init
|
||||
*/
|
||||
if( xInit==0 && zProc==0 ){
|
||||
int iFile, iEntry, c;
|
||||
int ncFile = sqlite3Strlen30(zFile);
|
||||
zAltEntry = sqlite3_malloc(ncFile+30);
|
||||
if( zAltEntry==0 ){
|
||||
sqlite3OsDlClose(pVfs, handle);
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
memcpy(zAltEntry, "sqlite3_", 8);
|
||||
for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){}
|
||||
iFile++;
|
||||
if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3;
|
||||
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
|
||||
if( sqlite3Isalpha(c) ){
|
||||
zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
|
||||
}
|
||||
}
|
||||
memcpy(zAltEntry+iEntry, "_init", 6);
|
||||
zEntry = zAltEntry;
|
||||
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
|
||||
sqlite3OsDlSym(pVfs, handle, zEntry);
|
||||
}
|
||||
sqlite3OsDlSym(pVfs, handle, zProc);
|
||||
if( xInit==0 ){
|
||||
if( pzErrMsg ){
|
||||
nMsg += sqlite3Strlen30(zEntry);
|
||||
nMsg += sqlite3Strlen30(zProc);
|
||||
*pzErrMsg = zErrmsg = sqlite3_malloc(nMsg);
|
||||
if( zErrmsg ){
|
||||
sqlite3_snprintf(nMsg, zErrmsg,
|
||||
"no entry point [%s] in shared library [%s]", zEntry, zFile);
|
||||
"no entry point [%s] in shared library [%s]", zProc,zFile);
|
||||
sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
|
||||
}
|
||||
sqlite3OsDlClose(pVfs, handle);
|
||||
}
|
||||
sqlite3OsDlClose(pVfs, handle);
|
||||
sqlite3_free(zAltEntry);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
sqlite3_free(zAltEntry);
|
||||
if( xInit(db, &zErrmsg, &sqlite3Apis) ){
|
||||
}else if( xInit(db, &zErrmsg, &sqlite3Apis) ){
|
||||
if( pzErrMsg ){
|
||||
*pzErrMsg = sqlite3_mprintf("error during initialization: %s", zErrmsg);
|
||||
}
|
||||
|
||||
+3
-9
@@ -496,16 +496,10 @@ int sqlite3_config(int op, ...){
|
||||
}
|
||||
#endif
|
||||
|
||||
case SQLITE_CONFIG_MMAP_SIZE: {
|
||||
sqlite3_int64 szMmap = va_arg(ap, sqlite3_int64);
|
||||
case SQLITE_CONFIG_MMAP_LIMIT: {
|
||||
sqlite3_int64 mxMmap = va_arg(ap, sqlite3_int64);
|
||||
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){
|
||||
mxMmap = SQLITE_MAX_MMAP_SIZE;
|
||||
}
|
||||
if( mxMmap<0 ) mxMmap = SQLITE_DEFAULT_MMAP_LIMIT;
|
||||
sqlite3GlobalConfig.mxMmap = mxMmap;
|
||||
if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE;
|
||||
if( szMmap>mxMmap) szMmap = mxMmap;
|
||||
sqlite3GlobalConfig.szMmap = szMmap;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2329,7 +2323,7 @@ static int openDatabase(
|
||||
memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
|
||||
db->autoCommit = 1;
|
||||
db->nextAutovac = -1;
|
||||
db->szMmap = sqlite3GlobalConfig.szMmap;
|
||||
db->mxMmap = sqlite3GlobalConfig.mxMmap;
|
||||
db->nextPagesize = 0;
|
||||
db->flags |= SQLITE_ShortColNames | SQLITE_AutoIndex | SQLITE_EnableTrigger
|
||||
#if SQLITE_DEFAULT_FILE_FORMAT<4
|
||||
|
||||
@@ -141,7 +141,7 @@ int sqlite3OsShmMap(
|
||||
return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp);
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
/* The real implementation of xFetch and xUnfetch */
|
||||
int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
|
||||
DO_OS_MALLOC_TEST(id);
|
||||
|
||||
@@ -99,6 +99,14 @@
|
||||
# define SQLITE_OS_WINRT 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** When compiled for WinCE or WinRT, there is no concept of the current
|
||||
** directory.
|
||||
*/
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
# define SQLITE_CURDIR 1
|
||||
#endif
|
||||
|
||||
/* If the SET_FULLSYNC macro is not defined above, then make it
|
||||
** a no-op
|
||||
*/
|
||||
|
||||
+27
-30
@@ -227,8 +227,8 @@ struct unixFile {
|
||||
int szChunk; /* Configured by FCNTL_CHUNK_SIZE */
|
||||
int nFetchOut; /* Number of outstanding xFetch refs */
|
||||
sqlite3_int64 mmapSize; /* Usable size of mapping at pMapRegion */
|
||||
sqlite3_int64 mmapSizeActual; /* Actual size of mapping at pMapRegion */
|
||||
sqlite3_int64 mmapSizeMax; /* Configured FCNTL_MMAP_SIZE value */
|
||||
sqlite3_int64 mmapOrigsize; /* Actual size of mapping at pMapRegion */
|
||||
sqlite3_int64 mmapLimit; /* Configured FCNTL_MMAP_LIMIT value */
|
||||
void *pMapRegion; /* Memory mapped region */
|
||||
#ifdef __QNXNTO__
|
||||
int sectorSize; /* Device sector size */
|
||||
@@ -3162,7 +3162,7 @@ static int unixRead(
|
||||
);
|
||||
#endif
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
/* Deal with as much of this read request as possible by transfering
|
||||
** data from the memory mapping using memcpy(). */
|
||||
if( offset<pFile->mmapSize ){
|
||||
@@ -3283,7 +3283,7 @@ static int unixWrite(
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
/* Deal with as much of this write request as possible by transfering
|
||||
** data from the memory mapping using memcpy(). */
|
||||
if( offset<pFile->mmapSize ){
|
||||
@@ -3678,7 +3678,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
|
||||
}
|
||||
}
|
||||
|
||||
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
|
||||
if( pFile->mmapLimit>0 && nByte>pFile->mmapSize ){
|
||||
int rc;
|
||||
if( pFile->szChunk<=0 ){
|
||||
if( robust_ftruncate(pFile->h, nByte) ){
|
||||
@@ -3758,14 +3758,11 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_MMAP_SIZE: {
|
||||
case SQLITE_FCNTL_MMAP_LIMIT: {
|
||||
i64 newLimit = *(i64*)pArg;
|
||||
if( newLimit>sqlite3GlobalConfig.mxMmap ){
|
||||
newLimit = sqlite3GlobalConfig.mxMmap;
|
||||
}
|
||||
*(i64*)pArg = pFile->mmapSizeMax;
|
||||
*(i64*)pArg = pFile->mmapLimit;
|
||||
if( newLimit>=0 ){
|
||||
pFile->mmapSizeMax = newLimit;
|
||||
pFile->mmapLimit = newLimit;
|
||||
if( newLimit<pFile->mmapSize ) pFile->mmapSize = newLimit;
|
||||
}
|
||||
return SQLITE_OK;
|
||||
@@ -4577,17 +4574,17 @@ static int unixShmUnmap(
|
||||
*/
|
||||
static void unixUnmapfile(unixFile *pFd){
|
||||
assert( pFd->nFetchOut==0 );
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#ifndef SQLITE_DISABLE_MMAP
|
||||
if( pFd->pMapRegion ){
|
||||
osMunmap(pFd->pMapRegion, pFd->mmapSizeActual);
|
||||
osMunmap(pFd->pMapRegion, pFd->mmapOrigsize);
|
||||
pFd->pMapRegion = 0;
|
||||
pFd->mmapSize = 0;
|
||||
pFd->mmapSizeActual = 0;
|
||||
pFd->mmapOrigsize = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#ifndef SQLITE_DISABLE_MMAP
|
||||
/*
|
||||
** Return the system page size.
|
||||
*/
|
||||
@@ -4600,9 +4597,9 @@ static int unixGetPagesize(void){
|
||||
return (int)sysconf(_SC_PAGESIZE);
|
||||
#endif
|
||||
}
|
||||
#endif /* SQLITE_MAX_MMAP_SIZE>0 */
|
||||
#endif /* SQLITE_DISABLE_MMAP */
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#ifndef SQLITE_DISABLE_MMAP
|
||||
/*
|
||||
** Attempt to set the size of the memory mapping maintained by file
|
||||
** descriptor pFd to nNew bytes. Any existing mapping is discarded.
|
||||
@@ -4611,7 +4608,7 @@ static int unixGetPagesize(void){
|
||||
**
|
||||
** unixFile.pMapRegion
|
||||
** unixFile.mmapSize
|
||||
** unixFile.mmapSizeActual
|
||||
** unixFile.mmapOrigsize
|
||||
**
|
||||
** If unsuccessful, an error message is logged via sqlite3_log() and
|
||||
** the three variables above are zeroed. In this case SQLite should
|
||||
@@ -4625,15 +4622,15 @@ static void unixRemapfile(
|
||||
const char *zErr = "mmap";
|
||||
int h = pFd->h; /* File descriptor open on db file */
|
||||
u8 *pOrig = (u8 *)pFd->pMapRegion; /* Pointer to current file mapping */
|
||||
i64 nOrig = pFd->mmapSizeActual; /* Size of pOrig region in bytes */
|
||||
i64 nOrig = pFd->mmapOrigsize; /* Size of pOrig region in bytes */
|
||||
u8 *pNew = 0; /* Location of new mapping */
|
||||
int flags = PROT_READ; /* Flags to pass to mmap() */
|
||||
|
||||
assert( pFd->nFetchOut==0 );
|
||||
assert( nNew>pFd->mmapSize );
|
||||
assert( nNew<=pFd->mmapSizeMax );
|
||||
assert( nNew<=pFd->mmapLimit );
|
||||
assert( nNew>0 );
|
||||
assert( pFd->mmapSizeActual>=pFd->mmapSize );
|
||||
assert( pFd->mmapOrigsize>=pFd->mmapSize );
|
||||
assert( MAP_FAILED!=0 );
|
||||
|
||||
if( (pFd->ctrlFlags & UNIXFILE_RDONLY)==0 ) flags |= PROT_WRITE;
|
||||
@@ -4682,10 +4679,10 @@ static void unixRemapfile(
|
||||
/* If the mmap() above failed, assume that all subsequent mmap() calls
|
||||
** will probably fail too. Fall back to using xRead/xWrite exclusively
|
||||
** in this case. */
|
||||
pFd->mmapSizeMax = 0;
|
||||
pFd->mmapLimit = 0;
|
||||
}
|
||||
pFd->pMapRegion = (void *)pNew;
|
||||
pFd->mmapSize = pFd->mmapSizeActual = nNew;
|
||||
pFd->mmapSize = pFd->mmapOrigsize = nNew;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4706,7 +4703,7 @@ static void unixRemapfile(
|
||||
** code otherwise.
|
||||
*/
|
||||
static int unixMapfile(unixFile *pFd, i64 nByte){
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#ifndef SQLITE_DISABLE_MMAP
|
||||
i64 nMap = nByte;
|
||||
int rc;
|
||||
|
||||
@@ -4721,8 +4718,8 @@ static int unixMapfile(unixFile *pFd, i64 nByte){
|
||||
}
|
||||
nMap = statbuf.st_size;
|
||||
}
|
||||
if( nMap>pFd->mmapSizeMax ){
|
||||
nMap = pFd->mmapSizeMax;
|
||||
if( nMap>pFd->mmapLimit ){
|
||||
nMap = pFd->mmapLimit;
|
||||
}
|
||||
|
||||
if( nMap!=pFd->mmapSize ){
|
||||
@@ -4750,13 +4747,13 @@ static int unixMapfile(unixFile *pFd, i64 nByte){
|
||||
** release the reference by calling unixUnfetch().
|
||||
*/
|
||||
static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#ifndef SQLITE_DISABLE_MMAP
|
||||
unixFile *pFd = (unixFile *)fd; /* The underlying database file */
|
||||
#endif
|
||||
*pp = 0;
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
if( pFd->mmapSizeMax>0 ){
|
||||
#ifndef SQLITE_DISABLE_MMAP
|
||||
if( pFd->mmapLimit>0 ){
|
||||
if( pFd->pMapRegion==0 ){
|
||||
int rc = unixMapfile(pFd, -1);
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
@@ -5129,7 +5126,7 @@ static int fillInUnixFile(
|
||||
pNew->pVfs = pVfs;
|
||||
pNew->zPath = zFilename;
|
||||
pNew->ctrlFlags = (u8)ctrlFlags;
|
||||
pNew->mmapSizeMax = sqlite3GlobalConfig.mxMmap;
|
||||
pNew->mmapLimit = sqlite3GlobalConfig.mxMmap;
|
||||
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0),
|
||||
"psow", SQLITE_POWERSAFE_OVERWRITE) ){
|
||||
pNew->ctrlFlags |= UNIXFILE_PSOW;
|
||||
|
||||
+29
-34
@@ -150,13 +150,13 @@ struct winFile {
|
||||
winceLock local; /* Locks obtained by this instance of winFile */
|
||||
winceLock *shared; /* Global shared lock memory for the file */
|
||||
#endif
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
int nFetchOut; /* Number of outstanding xFetch references */
|
||||
HANDLE hMap; /* Handle for accessing memory mapping */
|
||||
void *pMapRegion; /* Area memory mapped */
|
||||
sqlite3_int64 mmapSize; /* Usable size of mapped region */
|
||||
sqlite3_int64 mmapSizeActual; /* Actual size of mapped region */
|
||||
sqlite3_int64 mmapSizeMax; /* Configured FCNTL_MMAP_SIZE value */
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
int nFetchOut; /* Number of outstanding xFetch references */
|
||||
HANDLE hMap; /* Handle for accessing memory mapping */
|
||||
void *pMapRegion; /* Area memory mapped */
|
||||
sqlite3_int64 mmapSize; /* Usable size of mapped region */
|
||||
sqlite3_int64 mmapOrigsize; /* Actual size of mapped region */
|
||||
sqlite3_int64 mmapLimit; /* Configured FCNTL_MMAP_LIMIT value */
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -2070,10 +2070,8 @@ static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
/* Forward references to VFS methods */
|
||||
static int winUnmapfile(winFile*);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Close a file.
|
||||
@@ -2097,7 +2095,7 @@ static int winClose(sqlite3_file *id){
|
||||
OSTRACE(("CLOSE %d\n", pFile->h));
|
||||
assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
rc = winUnmapfile(pFile);
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
#endif
|
||||
@@ -2154,7 +2152,7 @@ static int winRead(
|
||||
SimulateIOError(return SQLITE_IOERR_READ);
|
||||
OSTRACE(("READ %d lock=%d\n", pFile->h, pFile->locktype));
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
/* Deal with as much of this read request as possible by transfering
|
||||
** data from the memory mapping using memcpy(). */
|
||||
if( offset<pFile->mmapSize ){
|
||||
@@ -2220,7 +2218,7 @@ static int winWrite(
|
||||
|
||||
OSTRACE(("WRITE %d lock=%d\n", pFile->h, pFile->locktype));
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
/* Deal with as much of this write request as possible by transfering
|
||||
** data from the memory mapping using memcpy(). */
|
||||
if( offset<pFile->mmapSize ){
|
||||
@@ -2331,7 +2329,7 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
|
||||
"winTruncate2", pFile->zPath);
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
/* If the file was truncated to a size smaller than the currently
|
||||
** mapped region, reduce the effective mapping size as well. SQLite will
|
||||
** use read() and write() to access data beyond this point from now on.
|
||||
@@ -2848,14 +2846,11 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
case SQLITE_FCNTL_MMAP_SIZE: {
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
case SQLITE_FCNTL_MMAP_LIMIT: {
|
||||
i64 newLimit = *(i64*)pArg;
|
||||
if( newLimit>sqlite3GlobalConfig.mxMmap ){
|
||||
newLimit = sqlite3GlobalConfig.mxMmap;
|
||||
}
|
||||
*(i64*)pArg = pFile->mmapSizeMax;
|
||||
if( newLimit>=0 ) pFile->mmapSizeMax = newLimit;
|
||||
*(i64*)pArg = pFile->mmapLimit;
|
||||
if( newLimit>=0 ) pFile->mmapLimit = newLimit;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#endif
|
||||
@@ -3532,7 +3527,7 @@ shmpage_out:
|
||||
/*
|
||||
** Cleans up the mapped region of the specified file, if any.
|
||||
*/
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
static int winUnmapfile(winFile *pFile){
|
||||
assert( pFile!=0 );
|
||||
if( pFile->pMapRegion ){
|
||||
@@ -3543,7 +3538,7 @@ static int winUnmapfile(winFile *pFile){
|
||||
}
|
||||
pFile->pMapRegion = 0;
|
||||
pFile->mmapSize = 0;
|
||||
pFile->mmapSizeActual = 0;
|
||||
pFile->mmapOrigsize = 0;
|
||||
}
|
||||
if( pFile->hMap!=NULL ){
|
||||
if( !osCloseHandle(pFile->hMap) ){
|
||||
@@ -3566,7 +3561,7 @@ static int winUnmapfile(winFile *pFile){
|
||||
** the mapping to create. Otherwise, if nByte is less than zero, then the
|
||||
** requested size is the size of the file on disk. The actual size of the
|
||||
** created mapping is either the requested size or the value configured
|
||||
** using SQLITE_FCNTL_MMAP_SIZE, whichever is smaller.
|
||||
** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller.
|
||||
**
|
||||
** SQLITE_OK is returned if no error occurs (even if the mapping is not
|
||||
** recreated as a result of outstanding references) or an SQLite error
|
||||
@@ -3585,8 +3580,8 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
|
||||
return SQLITE_IOERR_FSTAT;
|
||||
}
|
||||
}
|
||||
if( nMap>pFd->mmapSizeMax ){
|
||||
nMap = pFd->mmapSizeMax;
|
||||
if( nMap>pFd->mmapLimit ){
|
||||
nMap = pFd->mmapLimit;
|
||||
}
|
||||
nMap &= ~(sqlite3_int64)(winSysInfo.dwPageSize - 1);
|
||||
|
||||
@@ -3638,12 +3633,12 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
|
||||
}
|
||||
pFd->pMapRegion = pNew;
|
||||
pFd->mmapSize = nMap;
|
||||
pFd->mmapSizeActual = nMap;
|
||||
pFd->mmapOrigsize = nMap;
|
||||
}
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#endif /* SQLITE_MAX_MMAP_SIZE>0 */
|
||||
#endif /* !defined(SQLITE_DISABLE_MMAP) */
|
||||
|
||||
/*
|
||||
** If possible, return a pointer to a mapping of file fd starting at offset
|
||||
@@ -3658,13 +3653,13 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
|
||||
** release the reference by calling unixUnfetch().
|
||||
*/
|
||||
static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
winFile *pFd = (winFile*)fd; /* The underlying database file */
|
||||
#endif
|
||||
*pp = 0;
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
if( pFd->mmapSizeMax>0 ){
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
if( pFd->mmapLimit>0 ){
|
||||
if( pFd->pMapRegion==0 ){
|
||||
int rc = winMapfile(pFd, -1);
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
@@ -3689,7 +3684,7 @@ static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
|
||||
** may now be invalid and should be unmapped.
|
||||
*/
|
||||
static int winUnfetch(sqlite3_file *fd, i64 iOff, void *p){
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
winFile *pFd = (winFile*)fd; /* The underlying database file */
|
||||
|
||||
/* If p==0 (unmap the entire file) then there must be no outstanding
|
||||
@@ -4139,12 +4134,12 @@ static int winOpen(
|
||||
}
|
||||
pFile->lastErrno = NO_ERROR;
|
||||
pFile->zPath = zName;
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
pFile->hMap = NULL;
|
||||
pFile->pMapRegion = 0;
|
||||
pFile->mmapSize = 0;
|
||||
pFile->mmapSizeActual = 0;
|
||||
pFile->mmapSizeMax = sqlite3GlobalConfig.mxMmap;
|
||||
pFile->mmapOrigsize = 0;
|
||||
pFile->mmapLimit = sqlite3GlobalConfig.mxMmap;
|
||||
#endif
|
||||
|
||||
OpenCounter(+1);
|
||||
|
||||
+13
-16
@@ -658,7 +658,7 @@ struct Pager {
|
||||
|
||||
u8 bUseFetch; /* True to use xFetch() */
|
||||
int nMmapOut; /* Number of mmap pages currently outstanding */
|
||||
sqlite3_int64 szMmap; /* Desired maximum mmap size */
|
||||
sqlite3_int64 mxMmap; /* Desired maximum mmap size */
|
||||
PgHdr *pMmapFreelist; /* List of free mmap page headers (pDirty) */
|
||||
/*
|
||||
** End of the routinely-changing class members
|
||||
@@ -774,10 +774,10 @@ static const unsigned char aJournalMagic[] = {
|
||||
** The macro USEFETCH is true if we are allowed to use the xFetch and xUnfetch
|
||||
** interfaces to access the database using memory-mapped I/O.
|
||||
*/
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
# define USEFETCH(x) ((x)->bUseFetch)
|
||||
#else
|
||||
#ifdef SQLITE_DISABLE_MMAP
|
||||
# define USEFETCH(x) 0
|
||||
#else
|
||||
# define USEFETCH(x) ((x)->bUseFetch)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -3370,16 +3370,16 @@ void sqlite3PagerSetCachesize(Pager *pPager, int mxPage){
|
||||
}
|
||||
|
||||
/*
|
||||
** Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
|
||||
** Invoke SQLITE_FCNTL_MMAP_LIMIT based on the current value of mxMmap.
|
||||
*/
|
||||
static void pagerFixMaplimit(Pager *pPager){
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
#if !defined(SQLITE_DISABLE_MMAP)
|
||||
sqlite3_file *fd = pPager->fd;
|
||||
if( isOpen(fd) ){
|
||||
sqlite3_int64 sz;
|
||||
pPager->bUseFetch = (fd->pMethods->iVersion>=3) && pPager->szMmap>0;
|
||||
sz = pPager->szMmap;
|
||||
sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_MMAP_SIZE, &sz);
|
||||
sqlite3_int64 mx;
|
||||
pPager->bUseFetch = (fd->pMethods->iVersion>=3) && pPager->mxMmap>0;
|
||||
mx = pPager->mxMmap;
|
||||
sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_MMAP_LIMIT, &mx);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3387,8 +3387,8 @@ static void pagerFixMaplimit(Pager *pPager){
|
||||
/*
|
||||
** Change the maximum size of any memory mapping made of the database file.
|
||||
*/
|
||||
void sqlite3PagerSetMmapLimit(Pager *pPager, sqlite3_int64 szMmap){
|
||||
pPager->szMmap = szMmap;
|
||||
void sqlite3PagerSetMmapLimit(Pager *pPager, sqlite3_int64 mxMmap){
|
||||
pPager->mxMmap = mxMmap;
|
||||
pagerFixMaplimit(pPager);
|
||||
}
|
||||
|
||||
@@ -4766,7 +4766,7 @@ int sqlite3PagerOpen(
|
||||
/* pPager->pBusyHandlerArg = 0; */
|
||||
pPager->xReiniter = xReinit;
|
||||
/* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
|
||||
/* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */
|
||||
/* pPager->mxMmap = SQLITE_DEFAULT_MMAP_LIMIT // will be set by btree.c */
|
||||
|
||||
*ppPager = pPager;
|
||||
return SQLITE_OK;
|
||||
@@ -5220,9 +5220,6 @@ int sqlite3PagerAcquire(
|
||||
** temporary or in-memory database. */
|
||||
const int bMmapOk = (pgno!=1 && USEFETCH(pPager)
|
||||
&& (pPager->eState==PAGER_READER || (flags & PAGER_ACQUIRE_READONLY))
|
||||
#ifdef SQLITE_HAS_CODEC
|
||||
&& pPager->xCodec==0
|
||||
#endif
|
||||
);
|
||||
|
||||
assert( pPager->eState>=PAGER_READER );
|
||||
|
||||
+13
-13
@@ -746,39 +746,39 @@ void sqlite3Pragma(
|
||||
}else
|
||||
|
||||
/*
|
||||
** PRAGMA [database.]mmap_size(N)
|
||||
** PRAGMA [database.]mmap_limit(N)
|
||||
**
|
||||
** Used to set mapping size limit. The mapping size limit is
|
||||
** used to limit the aggregate size of all memory mapped regions of the
|
||||
** database file. If this parameter is set to zero, then memory mapping
|
||||
** is not used at all. If N is negative, then the default memory map
|
||||
** limit determined by sqlite3_config(SQLITE_CONFIG_MMAP_SIZE) is set.
|
||||
** limit determined by sqlite3_config(SQLITE_CONFIG_MMAP_LIMIT) is set.
|
||||
** The parameter N is measured in bytes.
|
||||
**
|
||||
** This value is advisory. The underlying VFS is free to memory map
|
||||
** as little or as much as it wants. Except, if N is set to 0 then the
|
||||
** upper layers will never invoke the xFetch interfaces to the VFS.
|
||||
*/
|
||||
if( sqlite3StrICmp(zLeft,"mmap_size")==0 ){
|
||||
sqlite3_int64 sz;
|
||||
if( sqlite3StrICmp(zLeft,"mmap_limit")==0 ){
|
||||
sqlite3_int64 mx;
|
||||
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
|
||||
if( zRight ){
|
||||
int ii;
|
||||
sqlite3Atoi64(zRight, &sz, 1000, SQLITE_UTF8);
|
||||
if( sz<0 ) sz = sqlite3GlobalConfig.szMmap;
|
||||
if( pId2->n==0 ) db->szMmap = sz;
|
||||
sqlite3Atoi64(zRight, &mx, 1000, SQLITE_UTF8);
|
||||
if( mx<0 ) mx = sqlite3GlobalConfig.mxMmap;
|
||||
if( pId2->n==0 ) db->mxMmap = mx;
|
||||
for(ii=db->nDb-1; ii>=0; ii--){
|
||||
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){
|
||||
sqlite3BtreeSetMmapLimit(db->aDb[ii].pBt, sz);
|
||||
sqlite3BtreeSetMmapLimit(db->aDb[ii].pBt, mx);
|
||||
}
|
||||
}
|
||||
}
|
||||
sz = -1;
|
||||
if( sqlite3_file_control(db,zDb,SQLITE_FCNTL_MMAP_SIZE,&sz)==SQLITE_OK ){
|
||||
#if SQLITE_MAX_MMAP_SIZE==0
|
||||
sz = 0;
|
||||
mx = -1;
|
||||
if( sqlite3_file_control(db,zDb,SQLITE_FCNTL_MMAP_LIMIT,&mx)==SQLITE_OK ){
|
||||
#if defined(SQLITE_DISABLE_MMAP)
|
||||
mx = 0;
|
||||
#endif
|
||||
returnSingleInt(pParse, "mmap_size", sz);
|
||||
returnSingleInt(pParse, "mmap_limit", mx);
|
||||
}
|
||||
}else
|
||||
|
||||
|
||||
+7
-11
@@ -388,10 +388,7 @@ static int lookupName(
|
||||
** Note that the expression in the result set should have already been
|
||||
** resolved by the time the WHERE clause is resolved.
|
||||
*/
|
||||
if( (pEList = pNC->pEList)!=0
|
||||
&& zTab==0
|
||||
&& ((pNC->ncFlags & NC_AsMaybe)==0 || cnt==0)
|
||||
){
|
||||
if( cnt==0 && (pEList = pNC->pEList)!=0 && zTab==0 ){
|
||||
for(j=0; j<pEList->nExpr; j++){
|
||||
char *zAs = pEList->a[j].zName;
|
||||
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
|
||||
@@ -482,9 +479,7 @@ static int lookupName(
|
||||
lookupname_end:
|
||||
if( cnt==1 ){
|
||||
assert( pNC!=0 );
|
||||
if( pExpr->op!=TK_AS ){
|
||||
sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
|
||||
}
|
||||
sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
|
||||
/* Increment the nRef value on all name contexts from TopNC up to
|
||||
** the point where the name matched. */
|
||||
for(;;){
|
||||
@@ -1159,10 +1154,11 @@ static int resolveSelectStep(Walker *pWalker, Select *p){
|
||||
** re-evaluated for each reference to it.
|
||||
*/
|
||||
sNC.pEList = p->pEList;
|
||||
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
|
||||
sNC.ncFlags |= NC_AsMaybe;
|
||||
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
|
||||
sNC.ncFlags &= ~NC_AsMaybe;
|
||||
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ||
|
||||
sqlite3ResolveExprNames(&sNC, p->pHaving)
|
||||
){
|
||||
return WRC_Abort;
|
||||
}
|
||||
|
||||
/* The ORDER BY and GROUP BY clauses may not refer to terms in
|
||||
** outer queries
|
||||
|
||||
+2
-8
@@ -2784,10 +2784,6 @@ static int process_input(struct callback_data *p, FILE *in){
|
||||
free(zSql);
|
||||
zSql = 0;
|
||||
nSql = 0;
|
||||
}else if( zSql && _all_whitespace(zSql) ){
|
||||
free(zSql);
|
||||
zSql = 0;
|
||||
nSql = 0;
|
||||
}
|
||||
}
|
||||
if( zSql ){
|
||||
@@ -3064,8 +3060,7 @@ int main(int argc, char **argv){
|
||||
sqlite3_multiplex_initialize(0, 1);
|
||||
#endif
|
||||
}else if( strcmp(z,"-mmap")==0 ){
|
||||
sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i));
|
||||
sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, sz, sz);
|
||||
sqlite3_config(SQLITE_CONFIG_MMAP_LIMIT, integerValue(cmdline_option_value(argc,argv,++i)));
|
||||
}else if( strcmp(z,"-vfs")==0 ){
|
||||
sqlite3_vfs *pVfs = sqlite3_vfs_find(cmdline_option_value(argc,argv,++i));
|
||||
if( pVfs ){
|
||||
@@ -3170,7 +3165,7 @@ int main(int argc, char **argv){
|
||||
z = cmdline_option_value(argc,argv,++i);
|
||||
if( z[0]=='.' ){
|
||||
rc = do_meta_command(z, &data);
|
||||
if( rc && bail_on_error ) return rc==2 ? 0 : rc;
|
||||
if( rc && bail_on_error ) return rc;
|
||||
}else{
|
||||
open_db(&data);
|
||||
rc = shell_exec(data.db, z, shell_callback, &data, &zErrMsg);
|
||||
@@ -3194,7 +3189,6 @@ int main(int argc, char **argv){
|
||||
*/
|
||||
if( zFirstCmd[0]=='.' ){
|
||||
rc = do_meta_command(zFirstCmd, &data);
|
||||
if( rc==2 ) rc = 0;
|
||||
}else{
|
||||
open_db(&data);
|
||||
rc = shell_exec(data.db, zFirstCmd, shell_callback, &data, &zErrMsg);
|
||||
|
||||
+26
-37
@@ -892,15 +892,15 @@ struct sqlite3_io_methods {
|
||||
** written into memory obtained from [sqlite3_malloc()]. The caller should
|
||||
** invoke [sqlite3_free()] on the result to avoid a memory leak.
|
||||
**
|
||||
** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
|
||||
** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
|
||||
** <li>[[SQLITE_FCNTL_MMAP_LIMIT]]
|
||||
** The [SQLITE_FCNTL_MMAP_LIMIT] file control is used to query or set the
|
||||
** maximum number of bytes that will be used for memory-mapped I/O.
|
||||
** The argument is a pointer to a value of type sqlite3_int64 that
|
||||
** is an advisory maximum number of bytes in the file to memory map. The
|
||||
** pointer is overwritten with the old value. The limit is not changed if
|
||||
** the value originally pointed to is negative, and so the current limit
|
||||
** can be queried by passing in a pointer to a negative number. This
|
||||
** file-control is used internally to implement [PRAGMA mmap_size].
|
||||
** the originally pointed to is negative, and so the current limit can be
|
||||
** queried by passing in a pointer to a negative number. This file-control
|
||||
** is used internally to implement [PRAGMA mmap_limit].
|
||||
**
|
||||
** </ul>
|
||||
*/
|
||||
@@ -920,7 +920,7 @@ struct sqlite3_io_methods {
|
||||
#define SQLITE_FCNTL_PRAGMA 14
|
||||
#define SQLITE_FCNTL_BUSYHANDLER 15
|
||||
#define SQLITE_FCNTL_TEMPFILENAME 16
|
||||
#define SQLITE_FCNTL_MMAP_SIZE 18
|
||||
#define SQLITE_FCNTL_MMAP_LIMIT 18
|
||||
|
||||
/*
|
||||
** CAPI3REF: Mutex Handle
|
||||
@@ -1650,19 +1650,17 @@ struct sqlite3_mem_methods {
|
||||
** the connection being passed as the second parameter is being closed. The
|
||||
** third parameter is passed NULL In this case.
|
||||
**
|
||||
** [[SQLITE_CONFIG_MMAP_SIZE]]
|
||||
** <dt>SQLITE_CONFIG_MMAP_SIZE
|
||||
** <dd>SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
|
||||
** that are the default mmap size limit (the default setting for
|
||||
** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
|
||||
** [[SQLITE_CONFIG_MMAP_LIMIT]]
|
||||
** <dt>SQLITE_CONFIG_MMAP_LIMIT
|
||||
** <dd>The sole argument should be a 64-bit integer (an sqlite3_int64) that
|
||||
** is the default maximum number of bytes of process address space that
|
||||
** should be used for accessing each database file using memory mapping.
|
||||
** The default setting can be overridden by each database connection using
|
||||
** either the [PRAGMA mmap_size] command, or by using the
|
||||
** [SQLITE_FCNTL_MMAP_SIZE] file control. The maximum allowed mmap size
|
||||
** cannot be changed at run-time. Nor may the maximum allowed mmap size
|
||||
** exceed the compile-time maximum mmap size set by the
|
||||
** [SQLITE_MAX_MMAP_SIZE] compile-time option.
|
||||
** If either argument to this option is negative, then that argument is
|
||||
** changed to its compile-time default.
|
||||
** either the [PRAGMA mmap_limit] command, or by using the
|
||||
** [SQLITE_FCNTL_MMAP_LIMIT] file control. The value set here overrides the
|
||||
** compile-time default that is set using [SQLITE_DEFAULT_MMAP_LIMIT].
|
||||
** If the argument to this option is negative, then
|
||||
** the memory map limit is set to the compile-time default.
|
||||
** </dl>
|
||||
*/
|
||||
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
|
||||
@@ -1686,7 +1684,7 @@ struct sqlite3_mem_methods {
|
||||
#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
|
||||
#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
|
||||
#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
|
||||
#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
|
||||
#define SQLITE_CONFIG_MMAP_LIMIT 22 /* sqlite3_int64 */
|
||||
|
||||
/*
|
||||
** CAPI3REF: Database Connection Configuration Options
|
||||
@@ -4218,7 +4216,7 @@ void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
|
||||
** the content before returning.
|
||||
**
|
||||
** The typedef is necessary to work around problems in certain
|
||||
** C++ compilers.
|
||||
** C++ compilers. See ticket #2191.
|
||||
*/
|
||||
typedef void (*sqlite3_destructor_type)(void*);
|
||||
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
|
||||
@@ -5017,20 +5015,11 @@ int sqlite3_table_column_metadata(
|
||||
** ^This interface loads an SQLite extension library from the named file.
|
||||
**
|
||||
** ^The sqlite3_load_extension() interface attempts to load an
|
||||
** [SQLite extension] library contained in the file zFile. If
|
||||
** the file cannot be loaded directly, attempts are made to load
|
||||
** with various operating-system specific extensions added.
|
||||
** So for example, if "samplelib" cannot be loaded, then names like
|
||||
** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might
|
||||
** be tried also.
|
||||
** SQLite extension library contained in the file zFile.
|
||||
**
|
||||
** ^The entry point is zProc.
|
||||
** ^(zProc may be 0, in which case SQLite will try to come up with an
|
||||
** entry point name on its own. It first tries "sqlite3_extension_init".
|
||||
** If that does not work, it constructs a name "sqlite3_X_init" where the
|
||||
** X is consists of the lower-case equivalent of all ASCII alphabetic
|
||||
** characters in the filename from the last "/" to the first following
|
||||
** "." and omitting any initial "lib".)^
|
||||
** ^zProc may be 0, in which case the name of the entry point
|
||||
** defaults to "sqlite3_extension_init".
|
||||
** ^The sqlite3_load_extension() interface returns
|
||||
** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
|
||||
** ^If an error occurs and pzErrMsg is not 0, then the
|
||||
@@ -5056,11 +5045,11 @@ int sqlite3_load_extension(
|
||||
** CAPI3REF: Enable Or Disable Extension Loading
|
||||
**
|
||||
** ^So as not to open security holes in older applications that are
|
||||
** unprepared to deal with [extension loading], and as a means of disabling
|
||||
** [extension loading] while evaluating user-entered SQL, the following API
|
||||
** unprepared to deal with extension loading, and as a means of disabling
|
||||
** extension loading while evaluating user-entered SQL, the following API
|
||||
** is provided to turn the [sqlite3_load_extension()] mechanism on and off.
|
||||
**
|
||||
** ^Extension loading is off by default.
|
||||
** ^Extension loading is off by default. See ticket #1863.
|
||||
** ^Call the sqlite3_enable_load_extension() routine with onoff==1
|
||||
** to turn extension loading on and call it with onoff==0 to turn
|
||||
** it back off again.
|
||||
@@ -5072,7 +5061,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
|
||||
**
|
||||
** ^This interface causes the xEntryPoint() function to be invoked for
|
||||
** each new [database connection] that is created. The idea here is that
|
||||
** xEntryPoint() is the entry point for a statically linked [SQLite extension]
|
||||
** xEntryPoint() is the entry point for a statically linked SQLite extension
|
||||
** that is to be automatically loaded into all new database connections.
|
||||
**
|
||||
** ^(Even though the function prototype shows that xEntryPoint() takes
|
||||
@@ -6858,7 +6847,7 @@ int sqlite3_strnicmp(const char *, const char *, int);
|
||||
** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
|
||||
** the glob pattern P, and it returns non-zero if string X does not match
|
||||
** the glob pattern P. ^The definition of glob pattern matching used in
|
||||
** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the
|
||||
** [sqlite3_strglob(P,X) is the same as for the "X GLOB P" operator in the
|
||||
** SQL dialect used by SQLite. ^The sqlite3_strglob(P,X) function is case
|
||||
** sensitive.
|
||||
**
|
||||
|
||||
+2
-11
@@ -469,16 +469,7 @@ struct sqlite3_api_routines {
|
||||
#define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2
|
||||
#endif /* SQLITE_CORE */
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
/* This case when the file really is being compiled as a loadable
|
||||
** extension */
|
||||
# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
|
||||
# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
|
||||
#else
|
||||
/* This case when the file is being statically linked into the
|
||||
** application */
|
||||
# define SQLITE_EXTENSION_INIT1 /*no-op*/
|
||||
# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
|
||||
#endif
|
||||
#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0;
|
||||
#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
|
||||
|
||||
#endif /* _SQLITE3EXT_H_ */
|
||||
|
||||
+10
-49
@@ -122,11 +122,11 @@
|
||||
** We support that for legacy.
|
||||
*/
|
||||
#if !defined(SQLITE_THREADSAFE)
|
||||
# if defined(THREADSAFE)
|
||||
# define SQLITE_THREADSAFE THREADSAFE
|
||||
# else
|
||||
# define SQLITE_THREADSAFE 1 /* IMP: R-07272-22309 */
|
||||
# endif
|
||||
#if defined(THREADSAFE)
|
||||
# define SQLITE_THREADSAFE THREADSAFE
|
||||
#else
|
||||
# define SQLITE_THREADSAFE 1 /* IMP: R-07272-22309 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -392,7 +392,6 @@
|
||||
*/
|
||||
#ifndef SQLITE_TEMP_STORE
|
||||
# define SQLITE_TEMP_STORE 1
|
||||
# define SQLITE_TEMP_STORE_xc 1 /* Exclude from ctime.c */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -541,48 +540,13 @@ extern const int sqlite3one;
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Disable MMAP on platforms where it is known to not work
|
||||
** Disable MMAP on platforms where it is not supported
|
||||
*/
|
||||
#if defined(__OpenBSD__) || defined(__QNXNTO__)
|
||||
# undef SQLITE_MAX_MMAP_SIZE
|
||||
# define SQLITE_MAX_MMAP_SIZE 0
|
||||
# undef SQLITE_DISABLE_MMAP
|
||||
# define SQLITE_DISABLE_MMAP 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Default maximum size of memory used by memory-mapped I/O in the VFS
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
# include <TargetConditionals.h>
|
||||
# if TARGET_OS_IPHONE
|
||||
# undef SQLITE_MAX_MMAP_SIZE
|
||||
# define SQLITE_MAX_MMAP_SIZE 0
|
||||
# endif
|
||||
#endif
|
||||
#ifndef SQLITE_MAX_MMAP_SIZE
|
||||
# if defined(__linux__) \
|
||||
|| defined(_WIN32) \
|
||||
|| (defined(__APPLE__) && defined(__MACH__)) \
|
||||
|| defined(__sun)
|
||||
# define SQLITE_MAX_MMAP_SIZE 2147483648
|
||||
# else
|
||||
# define SQLITE_MAX_MMAP_SIZE 0
|
||||
# endif
|
||||
# define SQLITE_MAX_MMAP_SIZE_xc 1 /* exclude from ctime.c */
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The default MMAP_SIZE is zero on all platforms. Or, even if a larger
|
||||
** default MMAP_SIZE is specified at compile-time, make sure that it does
|
||||
** not exceed the maximum mmap size.
|
||||
*/
|
||||
#ifndef SQLITE_DEFAULT_MMAP_SIZE
|
||||
# define SQLITE_DEFAULT_MMAP_SIZE 0
|
||||
# define SQLITE_DEFAULT_MMAP_SIZE_xc 1 /* Exclude from ctime.c */
|
||||
#endif
|
||||
#if SQLITE_DEFAULT_MMAP_SIZE>SQLITE_MAX_MMAP_SIZE
|
||||
# undef SQLITE_DEFAULT_MMAP_SIZE
|
||||
# define SQLITE_DEFAULT_MMAP_SIZE SQLITE_MAX_MMAP_SIZE
|
||||
#endif
|
||||
|
||||
/*
|
||||
** An instance of the following structure is used to store the busy-handler
|
||||
@@ -878,7 +842,7 @@ struct sqlite3 {
|
||||
int nDb; /* Number of backends currently in use */
|
||||
int flags; /* Miscellaneous flags. See below */
|
||||
i64 lastRowid; /* ROWID of most recent insert (see above) */
|
||||
i64 szMmap; /* Default mmap_size setting */
|
||||
i64 mxMmap; /* Default mmap_limit setting */
|
||||
unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */
|
||||
int errCode; /* Most recent error code (SQLITE_*) */
|
||||
int errMask; /* & result codes with this before returning */
|
||||
@@ -2115,8 +2079,6 @@ struct NameContext {
|
||||
#define NC_HasAgg 0x02 /* One or more aggregate functions seen */
|
||||
#define NC_IsCheck 0x04 /* True if resolving names in a CHECK constraint */
|
||||
#define NC_InAggFunc 0x08 /* True if analyzing arguments to an agg func */
|
||||
#define NC_AsMaybe 0x10 /* Resolve to AS terms of the result set only
|
||||
** if no other resolution is available */
|
||||
|
||||
/*
|
||||
** An instance of the following structure contains all information
|
||||
@@ -2552,8 +2514,7 @@ struct Sqlite3Config {
|
||||
void *pHeap; /* Heap storage space */
|
||||
int nHeap; /* Size of pHeap[] */
|
||||
int mnReq, mxReq; /* Min and max heap requests sizes */
|
||||
sqlite3_int64 szMmap; /* mmap() space per open file */
|
||||
sqlite3_int64 mxMmap; /* Maximum value for szMmap */
|
||||
sqlite3_int64 mxMmap; /* Maximum mmap() space per open file */
|
||||
void *pScratch; /* Scratch memory */
|
||||
int szScratch; /* Size of each scratch buffer */
|
||||
int nScratch; /* Number of scratch buffers */
|
||||
|
||||
@@ -206,3 +206,27 @@
|
||||
#ifndef SQLITE_MAX_TRIGGER_DEPTH
|
||||
# define SQLITE_MAX_TRIGGER_DEPTH 1000
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Default maximum size of memory used by xFetch in the VFS.
|
||||
*/
|
||||
#ifdef SQLITE_DISABLE_MMAP
|
||||
# undef SQLITE_DEFAULT_MMAP_LIMIT
|
||||
# define SQLITE_DEFAULT_MMAP_LIMIT 0
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
# include <TargetConditionals.h>
|
||||
# if TARGET_OS_IPHONE
|
||||
# define SQLITE_DEFAULT_MMAP_LIMIT 0
|
||||
# endif
|
||||
#endif
|
||||
#ifndef SQLITE_DEFAULT_MMAP_LIMIT
|
||||
# if defined(__linux__) \
|
||||
|| defined(_WIN32) \
|
||||
|| (defined(__APPLE__) && defined(__MACH__)) \
|
||||
|| defined(__sun)
|
||||
# define SQLITE_DEFAULT_MMAP_LIMIT 268435456 /* = 256*1024*1024 */
|
||||
# else
|
||||
# define SQLITE_DEFAULT_MMAP_LIMIT 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
#include "sqlite3ext.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_LOAD_EXTENSION
|
||||
SQLITE_EXTENSION_INIT1
|
||||
static SQLITE_EXTENSION_INIT1
|
||||
|
||||
/*
|
||||
** The sqr() SQL function returns the square of its input value.
|
||||
|
||||
+4
-4
@@ -57,7 +57,7 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#ifdef SQLITE_CURDIR
|
||||
Tcl_SetVar2(interp, "sqlite_options", "curdir", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "curdir", "0", TCL_GLOBAL_ONLY);
|
||||
@@ -87,10 +87,10 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#if SQLITE_MAX_MMAP_SIZE>0
|
||||
Tcl_SetVar2(interp, "sqlite_options", "mmap", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
#ifdef SQLITE_DISABLE_MMAP
|
||||
Tcl_SetVar2(interp, "sqlite_options", "mmap", "0", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "mmap", "1", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#if 1 /* def SQLITE_MEMDEBUG */
|
||||
|
||||
+11
-8
@@ -2275,8 +2275,9 @@ static void bestVirtualIndex(WhereBestIdx *p){
|
||||
struct sqlite3_index_constraint *pIdxCons;
|
||||
struct sqlite3_index_constraint_usage *pUsage;
|
||||
WhereTerm *pTerm;
|
||||
int i, j;
|
||||
int i, j, k;
|
||||
int nOrderBy;
|
||||
int sortOrder; /* Sort order for IN clauses */
|
||||
int bAllowIN; /* Allow IN optimizations */
|
||||
double rCost;
|
||||
|
||||
@@ -2375,6 +2376,7 @@ static void bestVirtualIndex(WhereBestIdx *p){
|
||||
return;
|
||||
}
|
||||
|
||||
sortOrder = SQLITE_SO_ASC;
|
||||
pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
|
||||
for(i=0; i<pIdxInfo->nConstraint; i++, pIdxCons++){
|
||||
if( pUsage[i].argvIndex>0 ){
|
||||
@@ -2389,12 +2391,12 @@ static void bestVirtualIndex(WhereBestIdx *p){
|
||||
** repeated in the output. */
|
||||
break;
|
||||
}
|
||||
/* A virtual table that is constrained by an IN clause may not
|
||||
** consume the ORDER BY clause because (1) the order of IN terms
|
||||
** is not necessarily related to the order of output terms and
|
||||
** (2) Multiple outputs from a single IN value will not merge
|
||||
** together. */
|
||||
pIdxInfo->orderByConsumed = 0;
|
||||
for(k=0; k<pIdxInfo->nOrderBy; k++){
|
||||
if( pIdxInfo->aOrderBy[k].iColumn==pIdxCons->iColumn ){
|
||||
sortOrder = pIdxInfo->aOrderBy[k].desc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2424,7 +2426,8 @@ static void bestVirtualIndex(WhereBestIdx *p){
|
||||
}
|
||||
p->cost.plan.u.pVtabIdx = pIdxInfo;
|
||||
if( pIdxInfo->orderByConsumed ){
|
||||
p->cost.plan.wsFlags |= WHERE_ORDERED;
|
||||
assert( sortOrder==0 || sortOrder==1 );
|
||||
p->cost.plan.wsFlags |= WHERE_ORDERED + sortOrder*WHERE_REVERSE;
|
||||
p->cost.plan.nOBSat = nOrderBy;
|
||||
}else{
|
||||
p->cost.plan.nOBSat = p->i ? p->aLevel[p->i-1].plan.nOBSat : 0;
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ proc db_write {db {reset 0}} {
|
||||
do_test 1.1 {
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
execsql { PRAGMA mmap_size = 0 }
|
||||
execsql { PRAGMA mmap_limit = 0 }
|
||||
expr {[file size test.db] / 1024}
|
||||
} 6
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ ifcapable {!pager_pragmas} {
|
||||
# Tests in this file verify that locking_mode=exclusive causes SQLite to
|
||||
# use cached pages even if the database is changed on disk. This doesn't
|
||||
# work with mmap.
|
||||
if {[permutation]=="mmap"} {
|
||||
if {[permutation]!="nommap"} {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
+3
-63
@@ -354,10 +354,10 @@ do_execsql_test 3.1.1 {
|
||||
|
||||
do_catchsql_test 3.1.2 {
|
||||
CREATE VIRTUAL TABLE terms2 USING fts4aux;
|
||||
} {1 {invalid arguments to fts4aux constructor}}
|
||||
} {1 {wrong number of arguments to fts4aux constructor}}
|
||||
do_catchsql_test 3.1.3 {
|
||||
CREATE VIRTUAL TABLE terms2 USING fts4aux(t2, t2);
|
||||
} {1 {invalid arguments to fts4aux constructor}}
|
||||
} {1 {wrong number of arguments to fts4aux constructor}}
|
||||
|
||||
do_execsql_test 3.2.1 {
|
||||
CREATE VIRTUAL TABLE terms3 USING fts4aux(does_not_exist)
|
||||
@@ -444,6 +444,7 @@ do_plansql_test 4.5 {
|
||||
# odd name (one that requires quoting for use in SQL statements). And that
|
||||
# the argument to the fts4aux constructor is properly dequoted before use.
|
||||
#
|
||||
#
|
||||
do_execsql_test 5.1 {
|
||||
CREATE VIRTUAL TABLE "abc '!' def" USING fts4(x, y);
|
||||
INSERT INTO "abc '!' def" VALUES('XX', 'YY');
|
||||
@@ -457,66 +458,5 @@ do_execsql_test 5.2 {
|
||||
SELECT * FROM "%%^^%%";
|
||||
} {xx * 1 1 xx 0 1 1 yy * 1 1 yy 1 1 1}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test that we can create an fts4aux table in the temp database.
|
||||
#
|
||||
forcedelete test.db2
|
||||
do_execsql_test 6.1 {
|
||||
CREATE VIRTUAL TABLE ft1 USING fts4(x, y);
|
||||
INSERT INTO ft1 VALUES('a b', 'c d');
|
||||
INSERT INTO ft1 VALUES('e e', 'c d');
|
||||
INSERT INTO ft1 VALUES('a a', 'b b');
|
||||
CREATE VIRTUAL TABLE temp.aux1 USING fts4aux(main, ft1);
|
||||
SELECT * FROM aux1;
|
||||
} {
|
||||
a * 2 3 a 0 2 3
|
||||
b * 2 3 b 0 1 1 b 1 1 2
|
||||
c * 2 2 c 1 2 2
|
||||
d * 2 2 d 1 2 2
|
||||
e * 1 2 e 0 1 2
|
||||
}
|
||||
|
||||
do_execsql_test 6.2 {
|
||||
ATTACH 'test.db2' AS att;
|
||||
CREATE VIRTUAL TABLE att.ft1 USING fts4(x, y);
|
||||
INSERT INTO att.ft1 VALUES('v w', 'x y');
|
||||
INSERT INTO att.ft1 VALUES('z z', 'x y');
|
||||
INSERT INTO att.ft1 VALUES('v v', 'w w');
|
||||
CREATE VIRTUAL TABLE temp.aux2 USING fts4aux(att, ft1);
|
||||
SELECT * FROM aux2;
|
||||
} {
|
||||
v * 2 3 v 0 2 3
|
||||
w * 2 3 w 0 1 1 w 1 1 2
|
||||
x * 2 2 x 1 2 2
|
||||
y * 2 2 y 1 2 2
|
||||
z * 1 2 z 0 1 2
|
||||
}
|
||||
|
||||
foreach {tn q res1 res2} {
|
||||
1 { SELECT * FROM %%% WHERE term = 'a' } {a * 2 3 a 0 2 3} {}
|
||||
2 { SELECT * FROM %%% WHERE term = 'x' } {} {x * 2 2 x 1 2 2}
|
||||
|
||||
3 { SELECT * FROM %%% WHERE term >= 'y' }
|
||||
{} {y * 2 2 y 1 2 2 z * 1 2 z 0 1 2}
|
||||
|
||||
4 { SELECT * FROM %%% WHERE term <= 'c' }
|
||||
{a * 2 3 a 0 2 3 b * 2 3 b 0 1 1 b 1 1 2 c * 2 2 c 1 2 2} {}
|
||||
} {
|
||||
set sql1 [string map {%%% aux1} $q]
|
||||
set sql2 [string map {%%% aux2} $q]
|
||||
|
||||
do_execsql_test 7.$tn.1 $sql1 $res1
|
||||
do_execsql_test 7.$tn.2 $sql2 $res2
|
||||
}
|
||||
|
||||
do_test 8.1 {
|
||||
catchsql { CREATE VIRTUAL TABLE att.aux3 USING fts4aux(main, ft1) }
|
||||
} {1 {invalid arguments to fts4aux constructor}}
|
||||
|
||||
do_test 8.2 {
|
||||
execsql {DETACH att}
|
||||
catchsql { SELECT * FROM aux2 }
|
||||
} {1 {SQL logic error or missing database}}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
+1
-1
@@ -1273,7 +1273,7 @@ do_test func-29.3 {
|
||||
sqlite3_db_status db CACHE_MISS 1
|
||||
db eval {SELECT typeof(+x) FROM t29 ORDER BY id}
|
||||
} {integer null real blob text}
|
||||
if {[permutation] != "mmap"} {
|
||||
if {[permutation] == "nommap"} {
|
||||
do_test func-29.4 {
|
||||
set x [lindex [sqlite3_db_status db CACHE_MISS 1] 1]
|
||||
if {$x>100} {set x many}
|
||||
|
||||
+4
-4
@@ -123,7 +123,7 @@ foreach AutoVacuumMode [list 0 1] {
|
||||
forcedelete test.db test.db-journal
|
||||
|
||||
sqlite3 db test.db
|
||||
execsql "PRAGMA mmap_size = 0"
|
||||
execsql "PRAGMA mmap_limit = 0"
|
||||
execsql "PRAGMA auto_vacuum = $AutoVacuumMode"
|
||||
|
||||
do_test incrblob-2.$AutoVacuumMode.1 {
|
||||
@@ -150,7 +150,7 @@ foreach AutoVacuumMode [list 0 1] {
|
||||
# Open and close the db to make sure the page cache is empty.
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
execsql "PRAGMA mmap_size = 0"
|
||||
execsql "PRAGMA mmap_limit = 0"
|
||||
|
||||
# Read the last 20 bytes of the blob via a blob handle.
|
||||
set ::blob [db incrblob blobs v 1]
|
||||
@@ -173,7 +173,7 @@ foreach AutoVacuumMode [list 0 1] {
|
||||
# Open and close the db to make sure the page cache is empty.
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
execsql "PRAGMA mmap_size = 0"
|
||||
execsql "PRAGMA mmap_limit = 0"
|
||||
|
||||
# Write the second-to-last 20 bytes of the blob via a blob handle.
|
||||
#
|
||||
@@ -203,7 +203,7 @@ foreach AutoVacuumMode [list 0 1] {
|
||||
# Open and close the db to make sure the page cache is empty.
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
execsql { PRAGMA mmap_size = 0 }
|
||||
execsql { PRAGMA mmap_limit = 0 }
|
||||
|
||||
execsql { SELECT i FROM blobs }
|
||||
} {45}
|
||||
|
||||
+13
-13
@@ -40,17 +40,17 @@ proc register_rblob_code {dbname seed} {
|
||||
}]
|
||||
}
|
||||
|
||||
foreach {t mmap_size nRead c2init} {
|
||||
1.1 { PRAGMA mmap_size = 67108864 } 4 {PRAGMA mmap_size = 0}
|
||||
1.2 { PRAGMA mmap_size = 53248 } 150 {PRAGMA mmap_size = 0}
|
||||
1.3 { PRAGMA mmap_size = 0 } 344 {PRAGMA mmap_size = 0}
|
||||
1.4 { PRAGMA mmap_size = 67108864 } 4 {PRAGMA mmap_size = 67108864 }
|
||||
1.5 { PRAGMA mmap_size = 53248 } 150 {PRAGMA mmap_size = 67108864 }
|
||||
1.6 { PRAGMA mmap_size = 0 } 344 {PRAGMA mmap_size = 67108864 }
|
||||
foreach {t mmap_limit nRead c2init} {
|
||||
1.1 { PRAGMA mmap_limit = 67108864 } 4 {PRAGMA mmap_limit = 0}
|
||||
1.2 { PRAGMA mmap_limit = 53248 } 150 {PRAGMA mmap_limit = 0}
|
||||
1.3 { PRAGMA mmap_limit = 0 } 344 {PRAGMA mmap_limit = 0}
|
||||
1.4 { PRAGMA mmap_limit = 67108864 } 4 {PRAGMA mmap_limit = 67108864 }
|
||||
1.5 { PRAGMA mmap_limit = 53248 } 150 {PRAGMA mmap_limit = 67108864 }
|
||||
1.6 { PRAGMA mmap_limit = 0 } 344 {PRAGMA mmap_limit = 67108864 }
|
||||
} {
|
||||
do_multiclient_test tn {
|
||||
sql1 {PRAGMA page_size=1024}
|
||||
sql1 $mmap_size
|
||||
sql1 $mmap_limit
|
||||
sql2 $c2init
|
||||
|
||||
code2 [register_rblob_code db2 0]
|
||||
@@ -89,7 +89,7 @@ foreach {t mmap_size nRead c2init} {
|
||||
} {64 ok 149}
|
||||
|
||||
# Check that the number of pages read by connection 1 indicates that the
|
||||
# "PRAGMA mmap_size" command worked.
|
||||
# "PRAGMA mmap_limit" command worked.
|
||||
do_test $t.$tn.5 { nRead db } $nRead
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ db func rblob rblob
|
||||
|
||||
do_execsql_test 2.1 {
|
||||
PRAGMA auto_vacuum = 1;
|
||||
PRAGMA mmap_size = 67108864;
|
||||
PRAGMA mmap_limit = 67108864;
|
||||
PRAGMA journal_mode = wal;
|
||||
CREATE TABLE t1(a, b, UNIQUE(a, b));
|
||||
INSERT INTO t1 VALUES(rblob(500), rblob(500));
|
||||
@@ -254,7 +254,7 @@ do_test 5.5 {
|
||||
} SQLITE_OK
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test various mmap_size settings.
|
||||
# Test various mmap_limit settings.
|
||||
#
|
||||
foreach {tn1 mmap1 mmap2} {
|
||||
1 6144 167773
|
||||
@@ -279,8 +279,8 @@ foreach {tn1 mmap1 mmap2} {
|
||||
code1 [register_rblob_code db 0]
|
||||
code2 [register_rblob_code db2 444]
|
||||
|
||||
sql1 "PRAGMA mmap_size = $mmap1"
|
||||
sql2 "PRAGMA mmap_size = $mmap2"
|
||||
sql1 "PRAGMA mmap_limit = $mmap1"
|
||||
sql2 "PRAGMA mmap_limit = $mmap2"
|
||||
|
||||
do_test $tn1.$tn {
|
||||
for {set i 1} {$i <= 100} {incr i} {
|
||||
|
||||
+4
-4
@@ -2530,9 +2530,9 @@ if {$::tcl_platform(platform)=="unix"} {
|
||||
# an error.
|
||||
#
|
||||
foreach {tn pragma strsize} {
|
||||
1 { PRAGMA mmap_size = 0 } 2400
|
||||
1 { PRAGMA mmap_limit = 0 } 2400
|
||||
2 { } 2400
|
||||
3 { PRAGMA mmap_size = 0 } 4400
|
||||
3 { PRAGMA mmap_limit = 0 } 4400
|
||||
4 { } 4400
|
||||
} {
|
||||
reset_db
|
||||
@@ -2757,7 +2757,7 @@ do_test 42.1 {
|
||||
db close
|
||||
sqlite3_test_control_pending_byte 0x0010000
|
||||
sqlite3 db test.db
|
||||
db eval { PRAGMA mmap_size = 0 }
|
||||
db eval { PRAGMA mmap_limit = 0 }
|
||||
catchsql { SELECT sum(length(y)) FROM t1 }
|
||||
} {1 {database disk image is malformed}}
|
||||
do_test 42.2 {
|
||||
@@ -2799,7 +2799,7 @@ do_test 43.1 {
|
||||
db close
|
||||
sqlite3 db test.db
|
||||
|
||||
db eval { PRAGMA mmap_size = 0 }
|
||||
db eval { PRAGMA mmap_limit = 0 }
|
||||
db eval { SELECT * FROM t1 }
|
||||
sqlite3_db_status db CACHE_MISS 0
|
||||
} {0 2 0}
|
||||
|
||||
@@ -1282,7 +1282,7 @@ faultsim_save_and_close
|
||||
|
||||
do_faultsim_test pagerfault-28a -faults oom* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
execsql { PRAGMA mmap_size=0 }
|
||||
execsql { PRAGMA mmap_limit=0 }
|
||||
|
||||
sqlite3 db2 test.db
|
||||
db2 eval { SELECT count(*) FROM t2 }
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ do_test pageropt-1.4 {
|
||||
# must refill.
|
||||
#
|
||||
ifcapable mmap {
|
||||
set x [expr {[permutation]=="mmap" ? 1 : 6}]
|
||||
set x [expr {[permutation]=="nommap" ? 6 : 1}]
|
||||
} else {
|
||||
set x 6
|
||||
}
|
||||
|
||||
@@ -138,10 +138,10 @@ test_suite "veryquick" -prefix "" -description {
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault*
|
||||
]
|
||||
|
||||
test_suite "mmap" -prefix "mm-" -description {
|
||||
test_suite "nommap" -prefix "nomm-" -description {
|
||||
Similar to veryquick. Except with memory mapping disabled.
|
||||
} -presql {
|
||||
pragma mmap_size = 268435456;
|
||||
pragma mmap_limit = 0;
|
||||
} -files [
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test
|
||||
]
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# 2013-04-13
|
||||
#
|
||||
# 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 tests features of the name resolver (the component that
|
||||
# figures out what identifiers in the SQL statement refer to) that
|
||||
# were fixed by ticket [2500cdb9be]
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_test resolver01-1.1 {
|
||||
catchsql {
|
||||
CREATE TABLE t1(x, y); INSERT INTO t1 VALUES(11,22);
|
||||
CREATE TABLE t2(y, z); INSERT INTO t2 VALUES(33,44);
|
||||
SELECT 1 AS y FROM t1, t2 ORDER BY y;
|
||||
}
|
||||
} {0 1}
|
||||
do_test resolver01-1.2 {
|
||||
catchsql {
|
||||
SELECT 2 AS y FROM t1, t2 ORDER BY y COLLATE nocase;
|
||||
}
|
||||
} {0 2}
|
||||
do_test resolver01-1.3 {
|
||||
catchsql {
|
||||
SELECT 3 AS y FROM t1, t2 ORDER BY +y;
|
||||
}
|
||||
} {0 3}
|
||||
|
||||
|
||||
finish_test
|
||||
+1
-1
@@ -262,7 +262,7 @@ do_faultsim_test 4 -faults vfsfault-* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
file_control_chunksize_test db main 8192
|
||||
execsql {
|
||||
PRAGMA mmap_size = 1000000;
|
||||
PRAGMA mmap_limit = 1000000;
|
||||
}
|
||||
} -body {
|
||||
test_syscall errno mmap EACCES
|
||||
|
||||
+1
-4
@@ -208,15 +208,12 @@ do_test tkt2822-5.4 {
|
||||
|
||||
# In "ORDER BY +b" the term is now an expression rather than
|
||||
# a label. It therefore matches by rule (3) instead of rule (2).
|
||||
#
|
||||
# 2013-04-13: This is busted. Changed to conform to PostgreSQL and
|
||||
# MySQL and Oracle behavior.
|
||||
#
|
||||
do_test tkt2822-5.5 {
|
||||
execsql {
|
||||
SELECT a AS b FROM t3 ORDER BY +b;
|
||||
}
|
||||
} {1 9}
|
||||
} {9 1}
|
||||
|
||||
# Tests for rule 2 in compound queries
|
||||
#
|
||||
|
||||
+1
-1
@@ -728,7 +728,7 @@ do_test wal-11.9 {
|
||||
} {37 1}
|
||||
sqlite3_wal db test.db
|
||||
set nWal 39
|
||||
if {[permutation]!="mmap"} {set nWal 37}
|
||||
if {[permutation]=="nommap"} {set nWal 37}
|
||||
ifcapable !mmap {set nWal 37}
|
||||
do_test wal-11.10 {
|
||||
execsql {
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ foreach {testprefix do_wal_checkpoint} {
|
||||
# However, in mmap() mode, the db is pre-allocated to 2 pages at the
|
||||
# start of the checkpoint, even though page 2 cannot be written.
|
||||
set nDb 2
|
||||
if {[permutation]!="mmap"} {set nDb 1}
|
||||
if {[permutation]=="no-mmap"} {set nDb 1}
|
||||
ifcapable !mmap {set nDb 1}
|
||||
do_test 2.3.$tn.8 { file_page_counts } [list $nDb 4 2 4]
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ proc xLog {error_code msg} {
|
||||
lappend ::log $msg
|
||||
}
|
||||
sqlite3 db test.db
|
||||
db eval {PRAGMA mmap_size=0}
|
||||
db eval {PRAGMA mmap_limit=0}
|
||||
|
||||
do_test win32lock-1.1 {
|
||||
db eval {
|
||||
|
||||
Reference in New Issue
Block a user