mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Merge trunk changes into the fts4-incr-merge branch.
FossilOrigin-Name: f61d5fb0281381228eb1a12a233bacaeb26b12a3
This commit is contained in:
@ -934,6 +934,7 @@ clean:
|
||||
rm -f mkkeywordhash$(BEXE) keywordhash.h
|
||||
rm -f $(PUBLISH)
|
||||
rm -f *.da *.bb *.bbg gmon.out
|
||||
rm -rf quota2a quota2b quota2c
|
||||
rm -rf tsrc .target_source
|
||||
rm -f tclsqlite3$(TEXE)
|
||||
rm -f testfixture$(TEXE) test.db
|
||||
|
@ -985,6 +985,9 @@ clean:
|
||||
del /Q mkkeywordhash.exe keywordhash.h
|
||||
-rmdir /Q/S .deps
|
||||
-rmdir /Q/S .libs
|
||||
-rmdir /Q/S quota2a
|
||||
-rmdir /Q/S quota2b
|
||||
-rmdir /Q/S quota2c
|
||||
-rmdir /Q/S tsrc
|
||||
del /Q .target_source
|
||||
del /Q tclsqlite3.exe
|
||||
|
@ -657,6 +657,7 @@ clean:
|
||||
rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
|
||||
rm -f $(PUBLISH)
|
||||
rm -f *.da *.bb *.bbg gmon.out
|
||||
rm -rf quota2a quota2b quota2c
|
||||
rm -rf tsrc target_source
|
||||
rm -f testloadext.dll libtestloadext.so
|
||||
rm -f sqlite3.c fts?amal.c tclsqlite3.c
|
||||
|
@ -741,7 +741,7 @@ static void fts3Appendf(
|
||||
static char *fts3QuoteId(char const *zInput){
|
||||
int nRet;
|
||||
char *zRet;
|
||||
nRet = 2 + strlen(zInput)*2 + 1;
|
||||
nRet = 2 + (int)strlen(zInput)*2 + 1;
|
||||
zRet = sqlite3_malloc(nRet);
|
||||
if( zRet ){
|
||||
int i;
|
||||
@ -997,7 +997,7 @@ static int fts3ContentColumns(
|
||||
nCol = sqlite3_column_count(pStmt);
|
||||
for(i=0; i<nCol; i++){
|
||||
const char *zCol = sqlite3_column_name(pStmt, i);
|
||||
nStr += strlen(zCol) + 1;
|
||||
nStr += (int)strlen(zCol) + 1;
|
||||
}
|
||||
|
||||
/* Allocate and populate the array to return. */
|
||||
@ -1008,7 +1008,7 @@ static int fts3ContentColumns(
|
||||
char *p = (char *)&azCol[nCol];
|
||||
for(i=0; i<nCol; i++){
|
||||
const char *zCol = sqlite3_column_name(pStmt, i);
|
||||
int n = strlen(zCol)+1;
|
||||
int n = (int)strlen(zCol)+1;
|
||||
memcpy(p, zCol, n);
|
||||
azCol[i] = p;
|
||||
p += n;
|
||||
@ -1223,7 +1223,8 @@ static int fts3InitVtab(
|
||||
int j;
|
||||
for(j=0; j<nCol; j++){
|
||||
if( sqlite3_stricmp(zLanguageid, aCol[j])==0 ){
|
||||
memmove(&aCol[j], &aCol[j+1], (nCol-j) * sizeof(aCol[0]));
|
||||
int k;
|
||||
for(k=j; k<nCol; k++) aCol[k] = aCol[k+1];
|
||||
nCol--;
|
||||
break;
|
||||
}
|
||||
@ -2330,7 +2331,7 @@ static int fts3DoclistOrMerge(
|
||||
}
|
||||
|
||||
*paOut = aOut;
|
||||
*pnOut = (p-aOut);
|
||||
*pnOut = (int)(p-aOut);
|
||||
assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 );
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -2394,7 +2395,7 @@ static void fts3DoclistPhraseMerge(
|
||||
}
|
||||
}
|
||||
|
||||
*pnRight = p - aOut;
|
||||
*pnRight = (int)(p - aOut);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3775,7 +3776,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
|
||||
fts3PoslistPhraseMerge(&aOut, iToken-iPrev, 0, 1, &p1, &p2);
|
||||
sqlite3_free(aPoslist);
|
||||
aPoslist = pList;
|
||||
nPoslist = aOut - aPoslist;
|
||||
nPoslist = (int)(aOut - aPoslist);
|
||||
if( nPoslist==0 ){
|
||||
sqlite3_free(aPoslist);
|
||||
pPhrase->doclist.pList = 0;
|
||||
@ -3819,7 +3820,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
|
||||
pPhrase->doclist.pList = aOut;
|
||||
if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){
|
||||
pPhrase->doclist.bFreeList = 1;
|
||||
pPhrase->doclist.nList = (aOut - pPhrase->doclist.pList);
|
||||
pPhrase->doclist.nList = (int)(aOut - pPhrase->doclist.pList);
|
||||
}else{
|
||||
sqlite3_free(aOut);
|
||||
pPhrase->doclist.pList = 0;
|
||||
@ -3915,7 +3916,7 @@ void sqlite3Fts3DoclistPrev(
|
||||
iMul = (bDescIdx ? -1 : 1);
|
||||
}
|
||||
|
||||
*pnList = pEnd - pNext;
|
||||
*pnList = (int)(pEnd - pNext);
|
||||
*ppIter = pNext;
|
||||
*piDocid = iDocid;
|
||||
}else{
|
||||
@ -3929,7 +3930,7 @@ void sqlite3Fts3DoclistPrev(
|
||||
}else{
|
||||
char *pSave = p;
|
||||
fts3ReversePoslist(aDoclist, &p);
|
||||
*pnList = (pSave - p);
|
||||
*pnList = (int)(pSave - p);
|
||||
}
|
||||
*ppIter = p;
|
||||
}
|
||||
@ -3989,7 +3990,7 @@ static int fts3EvalPhraseNext(
|
||||
}
|
||||
pDL->pList = pIter;
|
||||
fts3PoslistCopy(0, &pIter);
|
||||
pDL->nList = (pIter - pDL->pList);
|
||||
pDL->nList = (int)(pIter - pDL->pList);
|
||||
|
||||
/* pIter now points just past the 0x00 that terminates the position-
|
||||
** list for document pDL->iDocid. However, if this position-list was
|
||||
@ -4347,8 +4348,8 @@ static int fts3EvalStart(Fts3Cursor *pCsr){
|
||||
Fts3Expr **ppOr = apOr;
|
||||
|
||||
fts3EvalTokenCosts(pCsr, 0, pCsr->pExpr, &pTC, &ppOr, &rc);
|
||||
nToken = pTC-aTC;
|
||||
nOr = ppOr-apOr;
|
||||
nToken = (int)(pTC-aTC);
|
||||
nOr = (int)(ppOr-apOr);
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = fts3EvalSelectDeferred(pCsr, 0, aTC, nToken);
|
||||
@ -4420,7 +4421,7 @@ static int fts3EvalNearTrim(
|
||||
&pOut, aTmp, nParam1, nParam2, paPoslist, &p2
|
||||
);
|
||||
if( res ){
|
||||
nNew = (pOut - pPhrase->doclist.pList) - 1;
|
||||
nNew = (int)(pOut - pPhrase->doclist.pList) - 1;
|
||||
assert( pPhrase->doclist.pList[nNew]=='\0' );
|
||||
assert( nNew<=pPhrase->doclist.nList && nNew>0 );
|
||||
memset(&pPhrase->doclist.pList[nNew], 0, pPhrase->doclist.nList - nNew);
|
||||
|
@ -79,9 +79,9 @@ static int fts3auxConnectMethod(
|
||||
}
|
||||
|
||||
zDb = argv[1];
|
||||
nDb = strlen(zDb);
|
||||
nDb = (int)strlen(zDb);
|
||||
zFts3 = argv[3];
|
||||
nFts3 = strlen(zFts3);
|
||||
nFts3 = (int)strlen(zFts3);
|
||||
|
||||
rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA);
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
|
@ -630,6 +630,7 @@ static const sqlite3_tokenizer_module porterTokenizerModule = {
|
||||
porterOpen,
|
||||
porterClose,
|
||||
porterNext,
|
||||
0
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -218,6 +218,7 @@ static const sqlite3_tokenizer_module simpleTokenizerModule = {
|
||||
simpleOpen,
|
||||
simpleClose,
|
||||
simpleNext,
|
||||
0,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -3056,8 +3056,8 @@ static int rtreeInit(
|
||||
sqlite3_vtab_config(db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1);
|
||||
|
||||
/* Allocate the sqlite3_vtab structure */
|
||||
nDb = strlen(argv[1]);
|
||||
nName = strlen(argv[2]);
|
||||
nDb = (int)strlen(argv[1]);
|
||||
nName = (int)strlen(argv[2]);
|
||||
pRtree = (Rtree *)sqlite3_malloc(sizeof(Rtree)+nDb+nName+2);
|
||||
if( !pRtree ){
|
||||
return SQLITE_NOMEM;
|
||||
@ -3152,10 +3152,10 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){
|
||||
|
||||
nodeGetCell(&tree, &node, ii, &cell);
|
||||
sqlite3_snprintf(512-nCell,&zCell[nCell],"%lld", cell.iRowid);
|
||||
nCell = strlen(zCell);
|
||||
nCell = (int)strlen(zCell);
|
||||
for(jj=0; jj<tree.nDim*2; jj++){
|
||||
sqlite3_snprintf(512-nCell,&zCell[nCell]," %f",(double)cell.aCoord[jj].f);
|
||||
nCell = strlen(zCell);
|
||||
nCell = (int)strlen(zCell);
|
||||
}
|
||||
|
||||
if( zText ){
|
||||
|
1
main.mk
1
main.mk
@ -601,6 +601,7 @@ clean:
|
||||
rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h
|
||||
rm -f $(PUBLISH)
|
||||
rm -f *.da *.bb *.bbg gmon.out
|
||||
rm -rf quota2a quota2b quota2c
|
||||
rm -rf tsrc target_source
|
||||
rm -f testloadext.dll libtestloadext.so
|
||||
rm -f amalgamation-testfixture amalgamation-testfixture.exe
|
||||
|
92
manifest
92
manifest
@ -1,10 +1,10 @@
|
||||
C Fix\svarious\sincorrect\sand\smissing\scomments\sand\sother\sstyle\sissues\sin\sand\saround\sthe\sFTS\sincremental\smerge\scode.
|
||||
D 2012-03-17T16:56:57.450
|
||||
C Merge\strunk\schanges\sinto\sthe\sfts4-incr-merge\sbranch.
|
||||
D 2012-03-20T17:04:17.255
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 3f79a373e57c3b92dabf76f40b065e719d31ac34
|
||||
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
F Makefile.msc 3a5582a858b8071af43cd459bd757f7d0748f66a
|
||||
F Makefile.vxworks 1deb39c8bb047296c30161ffa10c1b5423e632f9
|
||||
F Makefile.msc 7849a871b6cdb20fd51baee6bbe5965a03326be4
|
||||
F Makefile.vxworks 3b7fe7a0571fdadc61363ebc1b23732d2d6363ca
|
||||
F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
|
||||
F VERSION bb4c2a86abe53ea3c1d6ea515b69a426040e2414
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
@ -63,21 +63,21 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c 806632fd0020eed966ab82ea25fe09f1a4c86907
|
||||
F ext/fts3/fts3.c a62e09140c00f9c401efca661e7f2ae9909194f6
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h caa745f80405bc0c0a45a2f83e120d5a2c13753c
|
||||
F ext/fts3/fts3_aux.c 72de4cb43db7bfc2f68fbda04b7d8095ae9a6239
|
||||
F ext/fts3/fts3_aux.c 5205182bd8f372782597888156404766edf5781e
|
||||
F ext/fts3/fts3_expr.c dbc7ba4c3a6061adde0f38ed8e9b349568299551
|
||||
F ext/fts3/fts3_hash.c 8dd2d06b66c72c628c2732555a32bc0943114914
|
||||
F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
|
||||
F ext/fts3/fts3_icu.c 6c8f395cdf9e1e3afa7fadb7e523dbbf381c6dfa
|
||||
F ext/fts3/fts3_porter.c b7e5276f9f0a5fc7018b6fa55ce0f31f269ef881
|
||||
F ext/fts3/fts3_porter.c a465b49fcb8249a755792f87516eff182efa42b3
|
||||
F ext/fts3/fts3_snippet.c c9e126c20760988aa7c43c6ea1379db34738282e
|
||||
F ext/fts3/fts3_term.c d3466cf99432291be08e379d89645462431809d6
|
||||
F ext/fts3/fts3_test.c 6b7cc68aef4efb084e1449f7d20c4b20d3bdf6b4
|
||||
F ext/fts3/fts3_tokenizer.c 3da7254a9881f7e270ab28e2004e0d22b3212bce
|
||||
F ext/fts3/fts3_tokenizer.h 66dec98e365854b6cd2d54f1a96bb6d428fc5a68
|
||||
F ext/fts3/fts3_tokenizer1.c 0dde8f307b8045565cf63797ba9acfaff1c50c68
|
||||
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
|
||||
F ext/fts3/fts3_write.c a78deea7b575b244d50eea1fdb9bf228c0dd00bb
|
||||
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
|
||||
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
|
||||
@ -85,7 +85,7 @@ F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9
|
||||
F ext/icu/icu.c eb9ae1d79046bd7871aa97ee6da51eb770134b5a
|
||||
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/rtree.c b92ab2e91e35c4964644647322813419c65fe1ce
|
||||
F ext/rtree/rtree.c 4c1878818fc50efe5c2c7b8809d5cd0d88c7d396
|
||||
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
|
||||
F ext/rtree/rtree1.test 28e1b8da4da98093ce3210187434dd760a8d89d8
|
||||
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
|
||||
@ -105,7 +105,7 @@ F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de
|
||||
F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F main.mk ac48970ca7506c9034f5c7b2212111fbeb0a1aaa
|
||||
F main.mk a80771d44176a0c744d9d4e048497e7ed0b4040d
|
||||
F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
|
||||
F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
|
||||
F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
|
||||
@ -119,7 +119,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
|
||||
F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
|
||||
F src/alter.c 149cc80d9257971b0bff34e58fb2263e01998289
|
||||
F src/analyze.c f32ff304da413851eefa562b04e61ff6cb88248b
|
||||
F src/analyze.c 70c46504c0d2543ea5cdca01140b2cd3e1d886e7
|
||||
F src/attach.c 12c6957996908edc31c96d7c68d4942c2474405f
|
||||
F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
|
||||
F src/backup.c 6be23a344d3301ae38e92fddb3a33b91c309fce4
|
||||
@ -147,7 +147,7 @@ F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
|
||||
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
|
||||
F src/lempar.c 0ee69fca0be54cd93939df98d2aca4ca46f44416
|
||||
F src/loadext.c f20382fbaeec832438a1ba7797bee3d3c8a6d51d
|
||||
F src/main.c dcb4a15254dca9cc59dba63e813a8c140c021832
|
||||
F src/main.c 91458c713e9b7f8dbc98d79e78f1150f0ca9c2a1
|
||||
F src/malloc.c 15afac5e59b6584efe072e9933aefb4230e74f97
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c b3677415e69603d6a0e7c5410a1b3731d55beda1
|
||||
@ -182,21 +182,21 @@ F src/resolve.c 3d3e80a98f203ac6b9329e9621e29eda85ddfd40
|
||||
F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
|
||||
F src/select.c 44ccdcb5d2a1c48622c179b2d72167b716388581
|
||||
F src/shell.c aa28f117033ba3e44b5eaaf2ad572222bcdfd66e
|
||||
F src/sqlite.h.in f46e368d1a28b09d876e35444785674d170f2d62
|
||||
F src/sqlite.h.in 6af2d92925bfed3dfd2c022fef48469762ccd435
|
||||
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
|
||||
F src/sqliteInt.h b013dab7d43fb67c3ca2f0253d7863abb37e233c
|
||||
F src/sqliteInt.h e65429a6f19b41720561b9434b2192574a91cfa2
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 4568e72dfd36b6a5911f93457364deb072e0b03a
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
F src/tclsqlite.c 2aeb69958965dad0842d5ea1456f1a958ef296e6
|
||||
F src/test1.c 328cbe4a4ee6d10d67ece2a7adaa2770569fae0f
|
||||
F src/tclsqlite.c 086dfdd72e5892de223968a258e1ccbd9693e717
|
||||
F src/test1.c 07f30e8714bab94d8de8a88865d9c59bc512a1a8
|
||||
F src/test2.c 711555927f1f7e8db9aab86b512bc6934a774abe
|
||||
F src/test3.c 91d3f1a09cfae3533ef17d8b484a160f3d1f1a21
|
||||
F src/test4.c d1e5a5e904d4b444cf572391fdcb017638e36ff7
|
||||
F src/test5.c a6d1ac55ac054d0b2b8f37b5e655b6c92645a013
|
||||
F src/test6.c cf6ab27a59e1ab64b011bb251ba600131e803e59
|
||||
F src/test6.c 846ed1ed2f470de9b1e205fe3878a12e237b3e19
|
||||
F src/test7.c 2e0781754905c8adc3268d8f0967e7633af58843
|
||||
F src/test8.c 99f70341d6ec480313775127f4cd14b4a47db557
|
||||
F src/test8.c 61b41d79509a479dec1ac32b6d4209b27c4b1ba5
|
||||
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
|
||||
F src/test_async.c 0612a752896fad42d55c3999a5122af10dcf22ad
|
||||
F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e
|
||||
@ -238,7 +238,7 @@ F src/tokenize.c 1e86210d3976717a19238ea7b047fac481fe8c12
|
||||
F src/trigger.c ee7e178fb9188f44b532cebd449a7c1df90fb684
|
||||
F src/update.c d3076782c887c10e882996550345da9c4c9f9dea
|
||||
F src/utf.c 890c67dcfcc7a74623c95baac7535aadfe265e84
|
||||
F src/util.c 906731099c4397bf8adf3fa90a833355e7472af0
|
||||
F src/util.c 4f6cfad661b2e3454b0cdd5b1b9d39a54942d0e3
|
||||
F src/vacuum.c bfd53f9bd20a8fdb70b0fa8e77182b866875c0d8
|
||||
F src/vdbe.c 32720e873ed0a23e6ee928b676cd995864b984d6
|
||||
F src/vdbe.h 18f581cac1f4339ec3299f3e0cc6e11aec654cdb
|
||||
@ -253,7 +253,7 @@ F src/vtab.c ab90fb600a3f5e4b7c48d22a4cdb2d6b23239847
|
||||
F src/wal.c 7bb3ad807afc7973406c805d5157ec7a2f65e146
|
||||
F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6
|
||||
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
|
||||
F src/where.c f2cf59751f7facb4c422adf83ddc989aa5772874
|
||||
F src/where.c 6baab5dfcf4472552c0346d04f6fd2f4f8539c78
|
||||
F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
|
||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
|
||||
@ -296,8 +296,8 @@ F test/backup_malloc.test 7162d604ec2b4683c4b3799a48657fb8b5e2d450
|
||||
F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f
|
||||
F test/badutf2.test f5bc7f2d280670ecd79b9cf4f0f1760c607fe51f
|
||||
F test/between.test 16b1776c6323faadb097a52d673e8e3d8be7d070
|
||||
F test/bigfile.test a8ec8073a20207456dab01a29ad9cde42b0dd103
|
||||
F test/bigfile2.test f8e83eca9abef60692a34255a2ebcb96aff897fc
|
||||
F test/bigfile.test 82dfe93ee7eb9e2e05641afa2b39ffd947a92ff1
|
||||
F test/bigfile2.test 852f948cb492aadab45b58f4d2f3b0832a115cb0
|
||||
F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747
|
||||
F test/bind.test 3c7b320969000c441a70952b0b15938fbb66237c
|
||||
F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0
|
||||
@ -355,7 +355,7 @@ F test/crash.test 519dc29f6fea151f015a23236e555239353946eb
|
||||
F test/crash2.test 5b14d4eb58b880e231361d3b609b216acda86651
|
||||
F test/crash3.test 8f5de9d32ab9ab95475a9efe7f47a940aa889418
|
||||
F test/crash4.test fe2821baf37168dc59dd733dcf7dba2a401487bc
|
||||
F test/crash5.test 69226a1b948d8961395b7ad2a1df084c212ce8cf
|
||||
F test/crash5.test 13b9ca94e048194bca070e26160ce76b406c56be
|
||||
F test/crash6.test 4c56f1e40d0291e1110790a99807aa875b1647ba
|
||||
F test/crash7.test 6c6a369af266af2ef50ab34df8f94d719065e2c1
|
||||
F test/crash8.test 38767cb504bbe491de6be4a7006b154973a2309f
|
||||
@ -383,13 +383,13 @@ F test/e_dropview.test 583411e470458c5d76148542cfb5a5fa84c8f93e
|
||||
F test/e_expr.test 5489424d3d9a452ac3701cdf4b680ae31a157894
|
||||
F test/e_fkey.test 057eed81a41a2b21b1790032f4e8aaba0b2b0e17
|
||||
F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459
|
||||
F test/e_insert.test 92d2dab07366aef112f53af4539e30559f5d35a7
|
||||
F test/e_insert.test c6ac239a97cb16dfbd0c16496f8cd871b4068c0c
|
||||
F test/e_reindex.test dfedfc32c5a282b0596c6537cbcd4217fbb1a216
|
||||
F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6
|
||||
F test/e_select.test f5d4b81205701deacfae42051ae200969c41d2c0
|
||||
F test/e_select2.test 5c3d3da19c7b3e90ae444579db2b70098599ab92
|
||||
F test/e_update.test 161d5dc6a3ed9dd08f5264d13e20735d7a89f00c
|
||||
F test/e_uri.test 6f35b491f80dac005c8144f38b2dfb4d96483596
|
||||
F test/e_uri.test e8b894474fdfe7b18b0c9cb2d911270de2ad64ce
|
||||
F test/e_vacuum.test 331da289ae186656cf5f2eb27f577a89c0c221af
|
||||
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
|
||||
F test/enc2.test 796c59832e2b9a52842f382ffda8f3e989db03ad
|
||||
@ -404,7 +404,7 @@ F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/exists.test 8f7b27b61c2fbe5822f0a1f899c715d14e416e30
|
||||
F test/expr.test 67c9fd6f8f829e239dc8b0f4a08a73c08b09196d
|
||||
F test/fallocate.test b5d34437bd7ab01d41b1464b8117aefd4d32160e
|
||||
F test/filectrl.test 4eb0178956ca25a756e6d79711a90fec7157b454
|
||||
F test/filectrl.test f0327bd804d9c7bd048fa7a151c5eab8e27df42b
|
||||
F test/filefmt.test ffa17b5aebc3eb4b1e3be1ccb5ee906ffbd97f6e
|
||||
F test/fkey1.test 01c7de578e11747e720c2d9aeef27f239853c4da
|
||||
F test/fkey2.test 080969fe219b3b082b0e097ac18c6af2e5b0631f
|
||||
@ -496,7 +496,7 @@ F test/fts3snippet.test 8e956051221a34c7daeb504f023cb54d5fa5a8b2
|
||||
F test/fts3sort.test 95be0b19d7e41c44b29014f13ea8bddd495fd659
|
||||
F test/fts4aa.test 6e7f90420b837b2c685f3bcbe84c868492d40a68
|
||||
F test/fts4content.test 17b2360f7d1a9a7e5aa8022783f5c5731b6dfd4f
|
||||
F test/fts4langid.test 2f6ae2e5ab037b11b411c85346a09a5fee503f6d
|
||||
F test/fts4langid.test 24a6e41063b416bbdf371ff6b4476fa41c194aa7
|
||||
F test/fts4merge.test 1c3389a3be18498934baf76afe67663d8b4b5e42
|
||||
F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891
|
||||
F test/func.test 6c5ce11e3a0021ca3c0649234e2d4454c89110ca
|
||||
@ -540,7 +540,7 @@ F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1
|
||||
F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f
|
||||
F test/io.test b278aa8fa609ed0dcc825df31b2d9f526c5a52bd
|
||||
F test/ioerr.test 40bb2cfcab63fb6aa7424cd97812a84bc16b5fb8
|
||||
F test/ioerr2.test 1b56cb80d5b0726ee3ba325ca175734541e32955
|
||||
F test/ioerr2.test 9d71166f8466eda510f1af6137bdabaa82b5408d
|
||||
F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
|
||||
F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c
|
||||
F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4
|
||||
@ -612,7 +612,7 @@ F test/misc3.test fe55130a43e444ee75e2156ff75dc96e964b5738
|
||||
F test/misc4.test 9c078510fbfff05a9869a0b6d8b86a623ad2c4f6
|
||||
F test/misc5.test 528468b26d03303b1f047146e5eefc941b9069f5
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test 6743b810884ef64ae14c07ad1f9f858c40c06100
|
||||
F test/misc7.test 4337d84e441f36cee62656f9f7ba8bc22a7ca721
|
||||
F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054
|
||||
F test/multiplex.test e08cc7177bd6d85990ee1d71100bb6c684c02256
|
||||
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
||||
@ -627,7 +627,7 @@ F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347
|
||||
F test/null.test a8b09b8ed87852742343b33441a9240022108993
|
||||
F test/openv2.test 0d3040974bf402e19b7df4b783e447289d7ab394
|
||||
F test/oserror.test 50417780d0e0d7cd23cf12a8277bb44024765df3
|
||||
F test/pager1.test efef0bb4035d7180ec58308f1d449475e4670b48
|
||||
F test/pager1.test cf8f40cf77b5c4f762b1e8492390d61b46a81623
|
||||
F test/pager2.test 745b911dde3d1f24ae0870bd433dfa83d7c658c1
|
||||
F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f
|
||||
F test/pagerfault.test 452f2cc23e3bfcfa935f4442aec1da4fe1dc0442
|
||||
@ -638,15 +638,15 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
|
||||
F test/pcache.test 065aa286e722ab24f2e51792c1f093bf60656b16
|
||||
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
|
||||
F test/permutations.test 0ab1e7748de5d29c4c648ba5ce3b983ab80653d1
|
||||
F test/pragma.test f11c59ec935a52edb4d3d5676d456588121fcefa
|
||||
F test/pragma.test c51c148defe32bf4a419a522f95d26838d5cf677
|
||||
F test/pragma2.test 3a55f82b954242c642f8342b17dffc8b47472947
|
||||
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
|
||||
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
|
||||
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
|
||||
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
|
||||
F test/quota-glob.test 32901e9eed6705d68ca3faee2a06b73b57cb3c26
|
||||
F test/quota.test af47d25c166aa7b33ef25f21bb7f2afb29d82c77
|
||||
F test/quota2.test 1b8df088e604f2df573f96e726b5e518cb0cddaa
|
||||
F test/quota.test c2f778dab4c7fb07bcfa962cc5c762f36d8061dc
|
||||
F test/quota2.test 7e1c84f71f59388963fa8181a1292c87ae814d2d
|
||||
F test/quote.test 215897dbe8de1a6f701265836d6601cc6ed103e6
|
||||
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
|
||||
F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
|
||||
@ -721,7 +721,7 @@ F test/tclsqlite.test 1597d353308531527583481d14d9da52ea8ed0af
|
||||
F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c
|
||||
F test/temptable.test 51edd31c65ed1560dd600b1796e8325df96318e2
|
||||
F test/temptrigger.test 26670ed7a39cf2296a7f0a9e0a1d7bdb7abe936d
|
||||
F test/tester.tcl 001051eaf28c1040800f588a64c63e0bd0e1f36b
|
||||
F test/tester.tcl 7db9e90e4a9cc57ea92118ee011634f86dc8e847
|
||||
F test/thread001.test 7cc2ce08f9cde95964736d11e91f9ab610f82f91
|
||||
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
|
||||
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
|
||||
@ -755,7 +755,7 @@ F test/tkt-80ba201079.test 9eb040d81c404f56838a6af93593f42790def63f
|
||||
F test/tkt-80e031a00f.test 9a154173461a4dbe2de49cda73963e04842d52f7
|
||||
F test/tkt-8454a207b9.test c583a9f814a82a2b5ba95207f55001c9f0cd816c
|
||||
F test/tkt-91e2e8ba6f.test 08c4f94ae07696b05c9b822da0b4e5337a2f54c5
|
||||
F test/tkt-94c04eaadb.test be5ea61cb04dfdc047d19b5c5a9e75fa3da67a7f
|
||||
F test/tkt-94c04eaadb.test fa9c71192f7e2ea2d51bf078bc34e8da6088bf71
|
||||
F test/tkt-9d68c883.test 458f7d82a523d7644b54b497c986378a7d8c8b67
|
||||
F test/tkt-b1d3a2e531.test 610ef582413171b379652663111b1f996d9f8f78
|
||||
F test/tkt-b351d95f9.test d14a503c414c5c58fdde3e80f9a3cfef986498c0
|
||||
@ -857,7 +857,7 @@ F test/tkt3997.test a335fa41ca3985660a139df7b734a26ef53284bd
|
||||
F test/tkt4018.test 7c2c9ba4df489c676a0a7a0e809a1fb9b2185bd1
|
||||
F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7
|
||||
F test/trace.test 4b36a41a3e9c7842151af6da5998f5080cdad9e5
|
||||
F test/trace2.test 962175290996d5f06dc4402ca218bbfc7df4cb20
|
||||
F test/trace2.test 95f6d519f534b171b8d3d1aacbb03931b4443fb4
|
||||
F test/trans.test 6e1b4c6a42dba31bd65f8fa5e61a2708e08ddde6
|
||||
F test/trans2.test d5337e61de45e66b1fcbf9db833fa8c82e624b22
|
||||
F test/trans3.test 373ac5183cc56be69f48ae44090e7f672939f732
|
||||
@ -882,7 +882,7 @@ F test/unique.test 083c7fff74695bcc27a71d75699deba3595bc9c2
|
||||
F test/unixexcl.test a9870e46cc6f8390a494513d4f2bf55b5a8b3e46
|
||||
F test/unordered.test f53095cee37851bf30130fa1bf299a8845e837bb
|
||||
F test/update.test 8bc86fd7ef1a00014f76dc6a6a7c974df4aef172
|
||||
F test/uri.test 0d289d32396bdbc491e9dc845f1a52e13f861e0b
|
||||
F test/uri.test 78e869db1ff6331157b08ef089b1b3e65819c74c
|
||||
F test/utf16align.test 54cd35a27c005a9b6e7815d887718780b6a462ae
|
||||
F test/vacuum.test ce91c39f7f91a4273bf620efad21086b5aa6ef1d
|
||||
F test/vacuum2.test af432e6e3bfc0ea20a80cb86a03c7d9876d38324
|
||||
@ -909,7 +909,7 @@ 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 edefe316b4125d7f68004ea53c5e73c398d436cc
|
||||
F test/wal.test 2fbf4bbd0cb03aff6ada8150f29808c79370d50b
|
||||
F test/wal2.test 8871e7fd2c86711ff415a5817d68ea3101a15312
|
||||
F test/wal3.test 6504bbf348b2d6dfade64a064f1050fd617e8706
|
||||
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
|
||||
@ -919,7 +919,7 @@ F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
|
||||
F test/wal8.test 5ab217d21f7e5e86af2933a4ffd0d8357cc2c0bd
|
||||
F test/wal_common.tcl a98f17fba96206122eff624db0ab13ec377be4fe
|
||||
F test/walbak.test b9f68e39646375c2b877be906babcc15d38b4877
|
||||
F test/walbig.test 0ab8a430ef420a3114f7092e0f30fc9585ffa155
|
||||
F test/walbig.test f437473a16cfb314867c6b5d1dbcd519e73e3434
|
||||
F test/walcksum.test f5447800a157c9e2234fbb8e80243f0813941bde
|
||||
F test/walcrash.test 4457436593be8c136f9148487c7dccd5e9013af2
|
||||
F test/walcrash2.test 019d60b89d96c1937adb2b30b850ac7e86e5a142
|
||||
@ -939,10 +939,10 @@ F test/where3.test 667e75642102c97a00bf9b23d3cb267db321d006
|
||||
F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2
|
||||
F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
|
||||
F test/where6.test 5da5a98cec820d488e82708301b96cb8c18a258b
|
||||
F test/where7.test 814d7373413398e074f134cff5f8872e2c08bd3b
|
||||
F test/where7.test 5c566388f0cc318b0032ce860f4ac5548e3c265a
|
||||
F test/where8.test a6c740fd286d7883e274e17b6230a9d672a7ab1f
|
||||
F test/where8m.test da346596e19d54f0aba35ebade032a7c47d79739
|
||||
F test/where9.test cd4ee5e455799ddba7041e5ac539044bb24e3874
|
||||
F test/where9.test ae98dc22ef9b6f2bc81e9f164e41b38faa9bda06
|
||||
F test/whereA.test 24c234263c8fe358f079d5e57d884fb569d2da0a
|
||||
F test/whereB.test 0def95db3bdec220a731c7e4bec5930327c1d8c5
|
||||
F test/whereC.test 13ff5ec0dba407c0e0c075980c75b3275a6774e5
|
||||
@ -994,7 +994,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
|
||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||
P 3475092cff862080a020d386076d739f0d22c9b2
|
||||
R ca4e10aa887c331ab5ee7949ea058bc8
|
||||
U dan
|
||||
Z 5217f3a7f5fecf12c3e93b43d9936afd
|
||||
P 7aabb62c8ccbd2b8d216e25226f06e5820dec38a 0fb26c7bfa7a4bb1503f90fd6f5b9c70f444665b
|
||||
R 58077ce5e1cbaecc58d15ee0d3722b1c
|
||||
U drh
|
||||
Z 8e670a9384f5fc62996e59150aae6127
|
||||
|
@ -1 +1 @@
|
||||
7aabb62c8ccbd2b8d216e25226f06e5820dec38a
|
||||
f61d5fb0281381228eb1a12a233bacaeb26b12a3
|
@ -932,6 +932,7 @@ static int loadStat3(sqlite3 *db, const char *zDb){
|
||||
int eType; /* Datatype of a sample */
|
||||
IndexSample *pSample; /* A slot in pIdx->aSample[] */
|
||||
|
||||
assert( db->lookaside.bEnabled==0 );
|
||||
if( !sqlite3FindTable(db, "sqlite_stat3", zDb) ){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -958,7 +959,7 @@ static int loadStat3(sqlite3 *db, const char *zDb){
|
||||
if( pIdx==0 ) continue;
|
||||
assert( pIdx->nSample==0 );
|
||||
pIdx->nSample = nSample;
|
||||
pIdx->aSample = sqlite3MallocZero( nSample*sizeof(IndexSample) );
|
||||
pIdx->aSample = sqlite3DbMallocZero(db, nSample*sizeof(IndexSample));
|
||||
pIdx->avgEq = pIdx->aiRowEst[1];
|
||||
if( pIdx->aSample==0 ){
|
||||
db->mallocFailed = 1;
|
||||
@ -1031,7 +1032,7 @@ static int loadStat3(sqlite3 *db, const char *zDb){
|
||||
if( n < 1){
|
||||
pSample->u.z = 0;
|
||||
}else{
|
||||
pSample->u.z = sqlite3Malloc(n);
|
||||
pSample->u.z = sqlite3DbMallocRaw(db, n);
|
||||
if( pSample->u.z==0 ){
|
||||
db->mallocFailed = 1;
|
||||
sqlite3_finalize(pStmt);
|
||||
@ -1107,7 +1108,10 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
|
||||
/* Load the statistics from the sqlite_stat3 table. */
|
||||
#ifdef SQLITE_ENABLE_STAT3
|
||||
if( rc==SQLITE_OK ){
|
||||
int lookasideEnabled = db->lookaside.bEnabled;
|
||||
db->lookaside.bEnabled = 0;
|
||||
rc = loadStat3(db, sInfo.zDatabase);
|
||||
db->lookaside.bEnabled = lookasideEnabled;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
43
src/main.c
43
src/main.c
@ -2704,17 +2704,10 @@ int sqlite3_extended_result_codes(sqlite3 *db, int onoff){
|
||||
*/
|
||||
int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
|
||||
int rc = SQLITE_ERROR;
|
||||
int iDb;
|
||||
Btree *pBtree;
|
||||
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
if( zDbName==0 ){
|
||||
iDb = 0;
|
||||
}else{
|
||||
for(iDb=0; iDb<db->nDb; iDb++){
|
||||
if( strcmp(db->aDb[iDb].zName, zDbName)==0 ) break;
|
||||
}
|
||||
}
|
||||
if( iDb<db->nDb ){
|
||||
Btree *pBtree = db->aDb[iDb].pBt;
|
||||
pBtree = sqlite3DbNameToBtree(db, zDbName);
|
||||
if( pBtree ){
|
||||
Pager *pPager;
|
||||
sqlite3_file *fd;
|
||||
@ -2733,7 +2726,6 @@ int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
|
||||
}
|
||||
sqlite3BtreeLeave(pBtree);
|
||||
}
|
||||
}
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return rc;
|
||||
}
|
||||
@ -3028,15 +3020,34 @@ sqlite3_int64 sqlite3_uri_int64(
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the filename of the database associated with a database
|
||||
** connection.
|
||||
** Return the Btree pointer identified by zDbName. Return NULL if not found.
|
||||
*/
|
||||
const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
|
||||
Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
|
||||
int i;
|
||||
for(i=0; i<db->nDb; i++){
|
||||
if( db->aDb[i].pBt && sqlite3StrICmp(zDbName, db->aDb[i].zName)==0 ){
|
||||
return sqlite3BtreeGetFilename(db->aDb[i].pBt);
|
||||
if( db->aDb[i].pBt
|
||||
&& (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zName)==0)
|
||||
){
|
||||
return db->aDb[i].pBt;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the filename of the database associated with a database
|
||||
** connection.
|
||||
*/
|
||||
const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
|
||||
Btree *pBt = sqlite3DbNameToBtree(db, zDbName);
|
||||
return pBt ? sqlite3BtreeGetFilename(pBt) : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return 1 if database is read-only or 0 if read/write. Return -1 if
|
||||
** no such database exists.
|
||||
*/
|
||||
int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
|
||||
Btree *pBt = sqlite3DbNameToBtree(db, zDbName);
|
||||
return pBt ? sqlite3PagerIsreadonly(sqlite3BtreePager(pBt)) : -1;
|
||||
}
|
||||
|
@ -4494,6 +4494,15 @@ sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
||||
*/
|
||||
const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Determine if a database is read-only
|
||||
**
|
||||
** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
|
||||
** of connection D is read-only, 0 if it is read/write, or -1 if N is not
|
||||
** the name of a database on connection D.
|
||||
*/
|
||||
int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Find the next prepared statement
|
||||
**
|
||||
|
@ -2701,6 +2701,7 @@ void sqlite3AddCollateType(Parse*, Token*);
|
||||
void sqlite3EndTable(Parse*,Token*,Token*,Select*);
|
||||
int sqlite3ParseUri(const char*,const char*,unsigned int*,
|
||||
sqlite3_vfs**,char**,char **);
|
||||
Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
|
||||
int sqlite3CodeOnce(Parse *);
|
||||
|
||||
Bitvec *sqlite3BitvecCreate(u32);
|
||||
|
@ -3108,23 +3108,19 @@ EXTERN int Sqlite3_Init(Tcl_Interp *interp){
|
||||
return TCL_OK;
|
||||
}
|
||||
EXTERN int Tclsqlite3_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
|
||||
EXTERN int Sqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
|
||||
EXTERN int Tclsqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
|
||||
EXTERN int Sqlite3_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; }
|
||||
EXTERN int Tclsqlite3_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; }
|
||||
EXTERN int Sqlite3_SafeUnload(Tcl_Interp *interp, int flags){ return TCL_OK; }
|
||||
EXTERN int Tclsqlite3_SafeUnload(Tcl_Interp *interp, int flags){ return TCL_OK;}
|
||||
|
||||
/* Because it accesses the file-system and uses persistent state, SQLite
|
||||
** is not considered appropriate for safe interpreters. Hence, we deliberately
|
||||
** omit the _SafeInit() interfaces.
|
||||
*/
|
||||
|
||||
#ifndef SQLITE_3_SUFFIX_ONLY
|
||||
int Sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
|
||||
int Tclsqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
|
||||
int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
|
||||
int Tclsqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
|
||||
int Sqlite_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; }
|
||||
int Tclsqlite_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; }
|
||||
int Sqlite_SafeUnload(Tcl_Interp *interp, int flags){ return TCL_OK; }
|
||||
int Tclsqlite_SafeUnload(Tcl_Interp *interp, int flags){ return TCL_OK;}
|
||||
#endif
|
||||
|
||||
#ifdef TCLSH
|
||||
|
25
src/test1.c
25
src/test1.c
@ -4665,6 +4665,30 @@ static int test_db_filename(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Usage: sqlite3_db_readonly DB DBNAME
|
||||
**
|
||||
** Return 1 or 0 if DBNAME is readonly or not. Return -1 if DBNAME does
|
||||
** not exist.
|
||||
*/
|
||||
static int test_db_readonly(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
sqlite3 *db;
|
||||
const char *zDbName;
|
||||
if( objc!=3 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DB DBNAME");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
|
||||
zDbName = Tcl_GetString(objv[2]);
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_db_readonly(db, zDbName)));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Usage: sqlite3_soft_heap_limit ?N?
|
||||
**
|
||||
@ -6055,6 +6079,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
{ "sqlite3_release_memory", test_release_memory, 0},
|
||||
{ "sqlite3_db_release_memory", test_db_release_memory, 0},
|
||||
{ "sqlite3_db_filename", test_db_filename, 0},
|
||||
{ "sqlite3_db_readonly", test_db_readonly, 0},
|
||||
{ "sqlite3_soft_heap_limit", test_soft_heap_limit, 0},
|
||||
{ "sqlite3_thread_cleanup", test_thread_cleanup, 0},
|
||||
{ "sqlite3_pager_refcounts", test_pager_refcounts, 0},
|
||||
|
@ -476,7 +476,15 @@ static int cfSync(sqlite3_file *pFile, int flags){
|
||||
if( nName>nCrashFile ) nName = nCrashFile;
|
||||
}
|
||||
|
||||
#ifdef TRACE_CRASHTEST
|
||||
printf("cfSync(): nName = %d, nCrashFile = %d, zName = %s, zCrashFile = %s\n",
|
||||
nName, nCrashFile, zName, zCrashFile);
|
||||
#endif
|
||||
|
||||
if( nName==nCrashFile && 0==memcmp(zName, zCrashFile, nName) ){
|
||||
#ifdef TRACE_CRASHTEST
|
||||
printf("cfSync(): name matched, g.iCrash = %d\n", g.iCrash);
|
||||
#endif
|
||||
if( (--g.iCrash)==0 ) isCrash = 1;
|
||||
}
|
||||
|
||||
|
16
src/test8.c
16
src/test8.c
@ -831,13 +831,10 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
|
||||
if( !isIgnoreUsable && !pConstraint->usable ) continue;
|
||||
|
||||
iCol = pConstraint->iColumn;
|
||||
if( pVtab->aIndex[iCol] || iCol<0 ){
|
||||
char *zCol = pVtab->aCol[iCol];
|
||||
if( iCol<0 || pVtab->aIndex[iCol] ){
|
||||
char *zCol = iCol>=0 ? pVtab->aCol[iCol] : "rowid";
|
||||
char *zOp = 0;
|
||||
useIdx = 1;
|
||||
if( iCol<0 ){
|
||||
zCol = "rowid";
|
||||
}
|
||||
switch( pConstraint->op ){
|
||||
case SQLITE_INDEX_CONSTRAINT_EQ:
|
||||
zOp = "="; break;
|
||||
@ -870,13 +867,12 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
|
||||
** on a column that this virtual table has an index for, then consume
|
||||
** the ORDER BY clause.
|
||||
*/
|
||||
if( pIdxInfo->nOrderBy==1 && pVtab->aIndex[pIdxInfo->aOrderBy->iColumn] ){
|
||||
if( pIdxInfo->nOrderBy==1 && (
|
||||
pIdxInfo->aOrderBy->iColumn<0 ||
|
||||
pVtab->aIndex[pIdxInfo->aOrderBy->iColumn]) ){
|
||||
int iCol = pIdxInfo->aOrderBy->iColumn;
|
||||
char *zCol = pVtab->aCol[iCol];
|
||||
char *zCol = iCol>=0 ? pVtab->aCol[iCol] : "rowid";
|
||||
char *zDir = pIdxInfo->aOrderBy->desc?"DESC":"ASC";
|
||||
if( iCol<0 ){
|
||||
zCol = "rowid";
|
||||
}
|
||||
zNew = sqlite3_mprintf(" ORDER BY %s %s", zCol, zDir);
|
||||
string_concat(&zQuery, zNew, 1, &rc);
|
||||
pIdxInfo->orderByConsumed = 1;
|
||||
|
10
src/util.c
10
src/util.c
@ -216,11 +216,11 @@ int sqlite3Dequote(char *z){
|
||||
** Some systems have stricmp(). Others have strcasecmp(). Because
|
||||
** there is no consistency, we will define our own.
|
||||
**
|
||||
** IMPLEMENTATION-OF: R-20522-24639 The sqlite3_strnicmp() API allows
|
||||
** applications and extensions to compare the contents of two buffers
|
||||
** containing UTF-8 strings in a case-independent fashion, using the same
|
||||
** definition of case independence that SQLite uses internally when
|
||||
** comparing identifiers.
|
||||
** IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and
|
||||
** sqlite3_strnicmp() APIs allow applications and extensions to compare
|
||||
** the contents of two buffers containing UTF-8 strings in a
|
||||
** case-independent fashion, using the same definition of "case
|
||||
** independence" that SQLite uses internally when comparing identifiers.
|
||||
*/
|
||||
int sqlite3_stricmp(const char *zLeft, const char *zRight){
|
||||
register unsigned char *a, *b;
|
||||
|
29
src/where.c
29
src/where.c
@ -3802,8 +3802,7 @@ static Bitmask codeOneLoopStart(
|
||||
WhereInfo *pWInfo, /* Complete information about the WHERE clause */
|
||||
int iLevel, /* Which level of pWInfo->a[] should be coded */
|
||||
u16 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */
|
||||
Bitmask notReady, /* Which tables are currently available */
|
||||
Expr *pWhere /* Complete WHERE clause */
|
||||
Bitmask notReady /* Which tables are currently available */
|
||||
){
|
||||
int j, k; /* Loop counters */
|
||||
int iCur; /* The VDBE cursor for the table */
|
||||
@ -4342,10 +4341,25 @@ static Bitmask codeOneLoopStart(
|
||||
** Then for every term xN, evaluate as the subexpression: xN AND z
|
||||
** That way, terms in y that are factored into the disjunction will
|
||||
** be picked up by the recursive calls to sqlite3WhereBegin() below.
|
||||
**
|
||||
** Actually, each subexpression is converted to "xN AND w" where w is
|
||||
** the "interesting" terms of z - terms that did not originate in the
|
||||
** ON or USING clause of a LEFT JOIN, and terms that are usable as
|
||||
** indices.
|
||||
*/
|
||||
if( pWC->nTerm>1 ){
|
||||
pAndExpr = sqlite3ExprAlloc(pParse->db, TK_AND, 0, 0);
|
||||
pAndExpr->pRight = pWhere;
|
||||
int iTerm;
|
||||
for(iTerm=0; iTerm<pWC->nTerm; iTerm++){
|
||||
Expr *pExpr = pWC->a[iTerm].pExpr;
|
||||
if( ExprHasProperty(pExpr, EP_FromJoin) ) continue;
|
||||
if( pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_ORINFO) ) continue;
|
||||
if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue;
|
||||
pExpr = sqlite3ExprDup(pParse->db, pExpr, 0);
|
||||
pAndExpr = sqlite3ExprAnd(pParse->db, pAndExpr, pExpr);
|
||||
}
|
||||
if( pAndExpr ){
|
||||
pAndExpr = sqlite3PExpr(pParse, TK_AND, 0, pAndExpr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
for(ii=0; ii<pOrWc->nTerm; ii++){
|
||||
@ -4387,7 +4401,10 @@ static Bitmask codeOneLoopStart(
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3DbFree(pParse->db, pAndExpr);
|
||||
if( pAndExpr ){
|
||||
pAndExpr->pLeft = 0;
|
||||
sqlite3ExprDelete(pParse->db, pAndExpr);
|
||||
}
|
||||
sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v));
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk);
|
||||
sqlite3VdbeResolveLabel(v, iLoopBody);
|
||||
@ -5043,7 +5060,7 @@ WhereInfo *sqlite3WhereBegin(
|
||||
for(i=0; i<nTabList; i++){
|
||||
pLevel = &pWInfo->a[i];
|
||||
explainOneScan(pParse, pTabList, pLevel, i, pLevel->iFrom, wctrlFlags);
|
||||
notReady = codeOneLoopStart(pWInfo, i, wctrlFlags, notReady, pWhere);
|
||||
notReady = codeOneLoopStart(pWInfo, i, wctrlFlags, notReady);
|
||||
pWInfo->iContinue = pLevel->addrCont;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ do_test bigfile-1.1 {
|
||||
# large files. So skip all of the remaining tests in this file.
|
||||
#
|
||||
db close
|
||||
if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} {
|
||||
if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} {
|
||||
puts "**** Unable to create a file larger than 4096 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
@ -109,7 +109,7 @@ do_test bigfile-1.4 {
|
||||
} $::MAGIC_SUM
|
||||
|
||||
db close
|
||||
if {[catch {fake_big_file 8192 [pwd]/test.db}]} {
|
||||
if {[catch {fake_big_file 8192 [get_pwd]/test.db}]} {
|
||||
puts "**** Unable to create a file larger than 8192 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
@ -148,7 +148,7 @@ do_test bigfile-1.9 {
|
||||
} $::MAGIC_SUM
|
||||
|
||||
db close
|
||||
if {[catch {fake_big_file 16384 [pwd]/test.db}]} {
|
||||
if {[catch {fake_big_file 16384 [get_pwd]/test.db}]} {
|
||||
puts "**** Unable to create a file larger than 16384 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
|
@ -29,7 +29,7 @@ do_execsql_test 1.1 {
|
||||
# are actually in use and new pages will be appended to the file.
|
||||
#
|
||||
db close
|
||||
if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} {
|
||||
if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} {
|
||||
puts "**** Unable to create a file larger than 4096 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
|
@ -47,7 +47,7 @@ for {set ii 0} {$ii < 10} {incr ii} {
|
||||
do_test crash5-$ii.$jj.1 {
|
||||
crashsql -delay 1 -file test.db-journal -seed $ii -tclbody [join [list \
|
||||
[list set iFail $jj] {
|
||||
sqlite3_crashparams 0 [file join [pwd] test.db-journal]
|
||||
sqlite3_crashparams 0 [file join [get_pwd] test.db-journal]
|
||||
|
||||
# Begin a transaction and evaluate a "CREATE INDEX" statement
|
||||
# with the iFail'th malloc() set to fail. This operation will
|
||||
@ -89,7 +89,7 @@ for {set ii 0} {$ii < 10} {incr ii} {
|
||||
# by writing page 4 out to the db file. If it crashes later on,
|
||||
# before syncing the journal... Corruption!
|
||||
#
|
||||
sqlite3_crashparams 1 [file join [pwd] test.db-journal]
|
||||
sqlite3_crashparams 1 [file join [get_pwd] test.db-journal]
|
||||
sqlite3_release_memory 8092
|
||||
}]] {}
|
||||
expr 1
|
||||
|
@ -50,7 +50,7 @@ proc do_insert_tests {args} {
|
||||
uplevel do_select_tests $args
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-55375-41353 -- syntax diagram insert-stmt
|
||||
# EVIDENCE-OF: R-21350-31508 -- syntax diagram insert-stmt
|
||||
#
|
||||
do_insert_tests e_insert-0 {
|
||||
1 "INSERT INTO a1 DEFAULT VALUES" {}
|
||||
@ -123,6 +123,20 @@ do_insert_tests e_insert-0 {
|
||||
68 "INSERT OR IGNORE INTO a1 (b, a) SELECT c, b FROM a2" {}
|
||||
69 "REPLACE INTO a1 (b, a) SELECT c, b FROM a2" {}
|
||||
70 "REPLACE INTO main.a1 (b, a) SELECT c, b FROM a2" {}
|
||||
71 "INSERT INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
72 "INSERT INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
73 "INSERT OR ROLLBACK INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
74 "INSERT OR ROLLBACK INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
75 "INSERT OR ABORT INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
76 "INSERT OR ABORT INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
77 "INSERT OR REPLACE INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
78 "INSERT OR REPLACE INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
79 "INSERT OR FAIL INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
80 "INSERT OR FAIL INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
81 "INSERT OR FAIL INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
82 "INSERT OR IGNORE INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
83 "REPLACE INTO a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
84 "REPLACE INTO main.a1 (b, a) VALUES(1, 2),(3,4)" {}
|
||||
}
|
||||
|
||||
delete_all_data
|
||||
|
@ -131,10 +131,10 @@ sqlite3_config_uri 1
|
||||
if {$tcl_platform(platform) == "unix"} {
|
||||
set flags [list SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE SQLITE_OPEN_URI]
|
||||
foreach {tn uri error} "
|
||||
1 {file://localhost[pwd]/test.db} {not an error}
|
||||
2 {file://[pwd]/test.db} {not an error}
|
||||
3 {file://x[pwd]/test.db} {invalid uri authority: x}
|
||||
4 {file://invalid[pwd]/test.db} {invalid uri authority: invalid}
|
||||
1 {file://localhost[get_pwd]/test.db} {not an error}
|
||||
2 {file://[get_pwd]/test.db} {not an error}
|
||||
3 {file://x[get_pwd]/test.db} {invalid uri authority: x}
|
||||
4 {file://invalid[get_pwd]/test.db} {invalid uri authority: invalid}
|
||||
" {
|
||||
do_test 2.$tn {
|
||||
set DB [sqlite3_open_v2 $uri $flags ""]
|
||||
@ -153,9 +153,9 @@ if {$tcl_platform(platform) == "unix"} {
|
||||
# parameters passed through to the VFS xOpen() methods.
|
||||
#
|
||||
foreach {tn uri parse} "
|
||||
1 {file:test.db#abc} {[pwd]/test.db {}}
|
||||
2 {file:test.db?a=b#abc} {[pwd]/test.db {a b}}
|
||||
3 {file:test.db?a=b#?c=d} {[pwd]/test.db {a b}}
|
||||
1 {file:test.db#abc} {[get_pwd]/test.db {}}
|
||||
2 {file:test.db?a=b#abc} {[get_pwd]/test.db {a b}}
|
||||
3 {file:test.db?a=b#?c=d} {[get_pwd]/test.db {a b}}
|
||||
" {
|
||||
do_filepath_test 3.$tn { parse_uri $uri } $parse
|
||||
}
|
||||
@ -171,7 +171,7 @@ foreach {tn uri parse} "
|
||||
# path is interpreted as a relative path.
|
||||
#
|
||||
foreach {tn uri parse} "
|
||||
1 {file:test.db} {[pwd]/test.db {}}
|
||||
1 {file:test.db} {[get_pwd]/test.db {}}
|
||||
2 {file:/test.db} {/test.db {}}
|
||||
3 {file:///test.db} {/test.db {}}
|
||||
4 {file://localhost/test.db} {/test.db {}}
|
||||
|
@ -34,7 +34,7 @@ do_test filectrl-1.4 {
|
||||
do_test filectrl-1.5 {
|
||||
db close
|
||||
sqlite3 db test_control_lockproxy.db
|
||||
file_control_lockproxy_test db [pwd]
|
||||
file_control_lockproxy_test db [get_pwd]
|
||||
} {}
|
||||
db close
|
||||
forcedelete .test_control_lockproxy.db-conch test.proxy
|
||||
|
@ -482,6 +482,4 @@ foreach lid [list 4 [expr 1<<30]] {
|
||||
SELECT count(*) FROM t6_segments;
|
||||
} {4 4}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
@ -130,7 +130,7 @@ do_test ioerr2-5 {
|
||||
}
|
||||
} msg]
|
||||
list $rc $msg
|
||||
} {1 {callback requested query abort}}
|
||||
} {1 {abort due to ROLLBACK}}
|
||||
|
||||
if {$::tcl_platform(platform) == "unix"} {
|
||||
# Cause the call to xAccess used by [pragma temp_store_directory] to
|
||||
|
@ -483,7 +483,7 @@ do_test misc7-20.1 {
|
||||
# Try to open a really long file name.
|
||||
#
|
||||
do_test misc7-21.1 {
|
||||
set zFile [file join [pwd] "[string repeat abcde 104].db"]
|
||||
set zFile [file join [get_pwd] "[string repeat abcde 104].db"]
|
||||
set rc [catch {sqlite3 db2 $zFile} msg]
|
||||
list $rc $msg
|
||||
} {1 {unable to open database file}}
|
||||
|
@ -535,7 +535,7 @@ proc copy_on_mj_delete {method filename args} {
|
||||
return SQLITE_OK
|
||||
}
|
||||
|
||||
set pwd [pwd]
|
||||
set pwd [get_pwd]
|
||||
foreach {tn1 tcl} {
|
||||
1 { set prefix "test.db" }
|
||||
2 {
|
||||
@ -887,6 +887,24 @@ do_test pager1.4.7.3 {
|
||||
delete_file test.db-journal
|
||||
file exists test.db-journal
|
||||
} {0}
|
||||
do_test pager1.4.8.1 {
|
||||
catch {file attributes test.db -permissions r--------}
|
||||
catch {file attributes test.db -readonly 1}
|
||||
sqlite3 db test.db
|
||||
db eval { SELECT * FROM t1 }
|
||||
sqlite3_db_readonly db main
|
||||
} {1}
|
||||
do_test pager1.4.8.2 {
|
||||
sqlite3_db_readonly db xyz
|
||||
} {-1}
|
||||
do_test pager1.4.8.3 {
|
||||
db close
|
||||
catch {file attributes test.db -readonly 0}
|
||||
catch {file attributes test.db -permissions rw-rw-rw-} msg
|
||||
sqlite3 db test.db
|
||||
db eval { SELECT * FROM t1 }
|
||||
sqlite3_db_readonly db main
|
||||
} {0}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# The following tests deal with multi-file commits.
|
||||
@ -1001,7 +1019,7 @@ do_test pager1-5.4.1 {
|
||||
# the master-journal name encoded as utf-8 with no nul term.
|
||||
#
|
||||
set mj_pointer [expr {
|
||||
20 + [string length [pwd]] + [string length "/test.db-mjXXXXXX9XX"]
|
||||
20 + [string length [get_pwd]] + [string length "/test.db-mjXXXXXX9XX"]
|
||||
}]
|
||||
expr {$::max_journal==(512+2*(1024+8)+$mj_pointer)}
|
||||
} 1
|
||||
@ -1020,7 +1038,7 @@ do_test pager1-5.4.2 {
|
||||
# written starting at the next (in this case 512 byte) sector boundary.
|
||||
#
|
||||
set mj_pointer [expr {
|
||||
20 + [string length [pwd]] + [string length "/test.db-mjXXXXXX9XX"]
|
||||
20 + [string length [get_pwd]] + [string length "/test.db-mjXXXXXX9XX"]
|
||||
}]
|
||||
expr {$::max_journal==(((512+2*(1024+8)+511)/512)*512 + $mj_pointer)}
|
||||
} 1
|
||||
|
@ -990,7 +990,7 @@ do_test pragma-9.4 {
|
||||
} {}
|
||||
ifcapable wsd {
|
||||
do_test pragma-9.5 {
|
||||
set pwd [string map {' ''} [file nativename [pwd]]]
|
||||
set pwd [string map {' ''} [file nativename [get_pwd]]]
|
||||
execsql "
|
||||
PRAGMA temp_store_directory='$pwd';
|
||||
"
|
||||
@ -999,7 +999,7 @@ ifcapable wsd {
|
||||
execsql {
|
||||
PRAGMA temp_store_directory;
|
||||
}
|
||||
} [list [file nativename [pwd]]]
|
||||
} [list [file nativename [get_pwd]]]
|
||||
do_test pragma-9.7 {
|
||||
catchsql {
|
||||
PRAGMA temp_store_directory='/NON/EXISTENT/PATH/FOOBAR';
|
||||
|
@ -221,7 +221,7 @@ do_test quota-3.3.1 {
|
||||
execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2a
|
||||
execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2b
|
||||
set ::quota
|
||||
} [list [file join [pwd] test.db] 5120]
|
||||
} [list [file join [get_pwd] test.db] 5120]
|
||||
|
||||
do_test quota-3.2.X {
|
||||
foreach db {db1a db2a db2b db1b} { catch { $db close } }
|
||||
|
@ -28,7 +28,7 @@ foreach dir {quota2a quota2a/x1 quota2a/x2 quota2b quota2c} {
|
||||
# that is the same across platforms.
|
||||
#
|
||||
unset -nocomplain ::quota_pwd ::quota_mapping
|
||||
set ::quota_pwd [string map {\\ /} [pwd]]
|
||||
set ::quota_pwd [string map {\\ /} [get_pwd]]
|
||||
set ::quota_mapping [list $::quota_pwd PWD]
|
||||
proc standard_path {x} {
|
||||
set x [string map {\\ /} $x]
|
||||
|
@ -19,6 +19,7 @@
|
||||
#
|
||||
# Commands to manipulate the db and the file-system at a high level:
|
||||
#
|
||||
# get_pwd
|
||||
# copy_file FROM TO
|
||||
# delete_file FILENAME
|
||||
# drop_all_tables ?DB?
|
||||
@ -148,6 +149,24 @@ proc getFileRetryDelay {} {
|
||||
return $::G(file-retry-delay)
|
||||
}
|
||||
|
||||
# Return the string representing the name of the current directory. On
|
||||
# Windows, the result is "normalized" to whatever our parent command shell
|
||||
# is using to prevent case-mismatch issues.
|
||||
#
|
||||
proc get_pwd {} {
|
||||
if {$::tcl_platform(platform) eq "windows"} {
|
||||
#
|
||||
# NOTE: Cannot use [file normalize] here because it would alter the
|
||||
# case of the result to what Tcl considers canonical, which would
|
||||
# defeat the purpose of this procedure.
|
||||
#
|
||||
return [string map [list \\ /] \
|
||||
[string trim [exec -- $::env(ComSpec) /c echo %CD%]]]
|
||||
} else {
|
||||
return [pwd]
|
||||
}
|
||||
}
|
||||
|
||||
# Copy file $from into $to. This is used because some versions of
|
||||
# TCL for windows (notably the 8.4.1 binary package shipped with the
|
||||
# current mingw release) have a broken "file copy" command.
|
||||
@ -984,7 +1003,7 @@ proc crashsql {args} {
|
||||
# $crashfile gets compared to the native filename in
|
||||
# cfSync(), which can be different then what TCL uses by
|
||||
# default, so here we force it to the "nativename" format.
|
||||
set cfile [string map {\\ \\\\} [file nativename [file join [pwd] $crashfile]]]
|
||||
set cfile [string map {\\ \\\\} [file nativename [file join [get_pwd] $crashfile]]]
|
||||
|
||||
set f [open crash.tcl w]
|
||||
puts $f "sqlite3_crash_enable 1"
|
||||
|
@ -27,7 +27,7 @@ do_test tkt-94c94-1.1 {
|
||||
|
||||
# Grow the file to larger than 4096MB (2^32 bytes)
|
||||
db close
|
||||
if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} {
|
||||
if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} {
|
||||
puts "**** Unable to create a file larger than 4096 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
|
@ -134,18 +134,19 @@ ifcapable fts3 {
|
||||
"-- REPLACE INTO 'main'.'x1_stat' VALUES(0,?)"
|
||||
"-- SELECT (SELECT max(idx) FROM 'main'.'x1_segdir' WHERE level = ?) + 1"
|
||||
"-- SELECT coalesce((SELECT max(blockid) FROM 'main'.'x1_segments') + 1, 1)"
|
||||
"-- INSERT INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)"
|
||||
"-- REPLACE INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)"
|
||||
}
|
||||
|
||||
do_trace_test 2.3 {
|
||||
INSERT INTO x1(x1) VALUES('optimize');
|
||||
} {
|
||||
"INSERT INTO x1(x1) VALUES('optimize');"
|
||||
"-- SELECT DISTINCT level / (1024 * ?) FROM 'main'.'x1_segdir'"
|
||||
"-- SELECT idx, start_block, leaves_end_block, end_block, root FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ?ORDER BY level DESC, idx ASC"
|
||||
"-- SELECT max(level) FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ?"
|
||||
"-- SELECT coalesce((SELECT max(blockid) FROM 'main'.'x1_segments') + 1, 1)"
|
||||
"-- DELETE FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ?"
|
||||
"-- INSERT INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)"
|
||||
"-- REPLACE INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,9 +54,9 @@ foreach {tn uri file} {
|
||||
|
||||
if {$tcl_platform(platform)=="windows"} {
|
||||
if {$tn>14} break
|
||||
set uri [string map [list PWD /[pwd]] $uri]
|
||||
set uri [string map [list PWD /[get_pwd]] $uri]
|
||||
} else {
|
||||
set uri [string map [list PWD [pwd]] $uri]
|
||||
set uri [string map [list PWD [get_pwd]] $uri]
|
||||
}
|
||||
|
||||
if {[file isdir $file]} {error "$file is a directory"}
|
||||
@ -274,9 +274,9 @@ foreach {tn uri res} {
|
||||
} {
|
||||
|
||||
if {$tcl_platform(platform)=="windows"} {
|
||||
set uri [string map [list PWD [string range [pwd] 3 end]] $uri]
|
||||
set uri [string map [list PWD [string range [get_pwd] 3 end]] $uri]
|
||||
} else {
|
||||
set uri [string map [list PWD [string range [pwd] 1 end]] $uri]
|
||||
set uri [string map [list PWD [string range [get_pwd] 1 end]] $uri]
|
||||
}
|
||||
|
||||
do_test 6.$tn {
|
||||
|
@ -1477,7 +1477,7 @@ foreach pgsz {512 1024 2048 4096 8192 16384 32768 65536} {
|
||||
# Test that when 1 or more pages are recovered from a WAL file,
|
||||
# sqlite3_log() is invoked to report this to the user.
|
||||
#
|
||||
set walfile [file nativename [file join [pwd] test.db-wal]]
|
||||
set walfile [file nativename [file join [get_pwd] test.db-wal]]
|
||||
catch {db close}
|
||||
forcedelete test.db
|
||||
do_test wal-23.1 {
|
||||
|
@ -52,7 +52,7 @@ do_test walbig-1.0 {
|
||||
} {wal}
|
||||
|
||||
db close
|
||||
if {[catch {fake_big_file 5000 [pwd]/test.db}]} {
|
||||
if {[catch {fake_big_file 5000 [get_pwd]/test.db}]} {
|
||||
puts "**** Unable to create a file larger than 5000 MB. *****"
|
||||
finish_test
|
||||
return
|
||||
|
@ -23339,7 +23339,7 @@ do_execsql_test where7-3.1 {
|
||||
OR t301.c8 = 1407424651264000)
|
||||
ORDER BY t302.c5 LIMIT 200;
|
||||
} {
|
||||
0 0 1 {SEARCH TABLE t301 USING COVERING INDEX t301_c4 (c4=?) (~5 rows)}
|
||||
0 0 1 {SEARCH TABLE t301 USING COVERING INDEX t301_c4 (c4=?) (~10 rows)}
|
||||
0 0 1 {SEARCH TABLE t301 USING INTEGER PRIMARY KEY (rowid=?) (~1 rows)}
|
||||
0 1 0 {SEARCH TABLE t302 USING INDEX t302_c8_c3 (c8=? AND c3>?) (~2 rows)}
|
||||
0 0 0 {USE TEMP B-TREE FOR ORDER BY}
|
||||
|
@ -364,7 +364,7 @@ ifcapable explain {
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INTEGER PRIMARY KEY (rowid=?) (~1 rows)}
|
||||
0 1 1 {SEARCH TABLE t2 USING INDEX t2d (d=?) (~2 rows)}
|
||||
0 1 1 {SEARCH TABLE t2 USING COVERING INDEX t2f (f=?) (~5 rows)}
|
||||
0 1 1 {SEARCH TABLE t2 USING COVERING INDEX t2f (f=?) (~10 rows)}
|
||||
}
|
||||
do_execsql_test where9-3.2 {
|
||||
EXPLAIN QUERY PLAN
|
||||
@ -374,7 +374,7 @@ ifcapable explain {
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INTEGER PRIMARY KEY (rowid=?) (~1 rows)}
|
||||
0 1 1 {SEARCH TABLE t2 USING INDEX t2d (d=?) (~2 rows)}
|
||||
0 1 1 {SEARCH TABLE t2 USING COVERING INDEX t2f (f=?) (~5 rows)}
|
||||
0 1 1 {SEARCH TABLE t2 USING COVERING INDEX t2f (f=?) (~10 rows)}
|
||||
}
|
||||
}
|
||||
|
||||
@ -453,8 +453,8 @@ ifcapable explain {
|
||||
do_execsql_test where9-5.1 {
|
||||
EXPLAIN QUERY PLAN SELECT a FROM t1 WHERE b>1000 AND (c=31031 OR d IS NULL)
|
||||
} {
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c=?) (~2 rows)}
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1d (d=?) (~2 rows)}
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c=?) (~3 rows)}
|
||||
0 0 0 {SEARCH TABLE t1 USING INDEX t1d (d=?) (~3 rows)}
|
||||
}
|
||||
|
||||
# In contrast, b=1000 is preferred over any OR-clause.
|
||||
@ -856,5 +856,25 @@ do_test where9-7.3.2 {
|
||||
}
|
||||
} {79 81}
|
||||
|
||||
# Fix for ticket [b7c8682cc17f32903f03a610bd0d35ffd3c1e6e4]
|
||||
# "Incorrect result from LEFT JOIN with OR in the WHERE clause"
|
||||
#
|
||||
do_test where9-8.1 {
|
||||
db eval {
|
||||
CREATE TABLE t81(a INTEGER PRIMARY KEY, b, c, d);
|
||||
CREATE TABLE t82(x INTEGER PRIMARY KEY, y);
|
||||
CREATE TABLE t83(p INTEGER PRIMARY KEY, q);
|
||||
|
||||
INSERT INTO t81 VALUES(2,3,4,5);
|
||||
INSERT INTO t81 VALUES(3,4,5,6);
|
||||
INSERT INTO t82 VALUES(2,4);
|
||||
INSERT INTO t83 VALUES(5,55);
|
||||
|
||||
SELECT *
|
||||
FROM t81 LEFT JOIN t82 ON y=b JOIN t83
|
||||
WHERE c==p OR d==p
|
||||
ORDER BY +a;
|
||||
}
|
||||
} {2 3 4 5 {} {} 5 55 3 4 5 6 2 4 5 55}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user