1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Expose some of the Where data structure debug printing routines to the

entire WHERE-clause processing module.

FossilOrigin-Name: 85e76887761b5d7e290fb2bac7f9121648f79d67fdd92f624d81632f28620518
This commit is contained in:
drh
2019-12-28 13:39:47 +00:00
parent 29368eabc5
commit cacdf20771
4 changed files with 21 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
C Add\sthe\s--enable-all\soption\sto\sthe\smain\sconfigure\sscript\sas\sa\sshort-hand\nto\senable\sFTS4,\sFTS5,\sGeopoly/Rtree,\sJSON,\sand\sSessions.\s\sIn\sthe\namalgamation-autoconf,\sthe\s--enable-rtree\soption\s(which\sis\senabled\sby\ndefault)\salso\snow\sactivates\sGeopoly. C Expose\ssome\sof\sthe\sWhere\sdata\sstructure\sdebug\sprinting\sroutines\sto\sthe\nentire\sWHERE-clause\sprocessing\smodule.
D 2019-12-28T13:17:11.914 D 2019-12-28T13:39:47.110
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -614,8 +614,8 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c 15a2845769f51ba132f9cf0b2c7a6887a91fc8437892dbcce9fcdc68b66d60a1 F src/wal.c 15a2845769f51ba132f9cf0b2c7a6887a91fc8437892dbcce9fcdc68b66d60a1
F src/wal.h 606292549f5a7be50b6227bd685fa76e3a4affad71bb8ac5ce4cb5c79f6a176a F src/wal.h 606292549f5a7be50b6227bd685fa76e3a4affad71bb8ac5ce4cb5c79f6a176a
F src/walker.c a137468bf36c92e64d2275caa80c83902e3a0fc59273591b96c6416d3253d05d F src/walker.c a137468bf36c92e64d2275caa80c83902e3a0fc59273591b96c6416d3253d05d
F src/where.c 230995f73eded5c3b46cdd6dd9b1862930df2bc402f5e8d2b4bfe64779411685 F src/where.c d1d79673b64278bbdefe790c70cb01ee607f79c48163febdf8dee86f6a7e715e
F src/whereInt.h 4a296fd4fa79fdcbc2b5e8c1b898901617655811223e1082b899c23ecb092217 F src/whereInt.h de1b77e416ad5a7cc60a71fc1317484f8d83ca1e52b805dc8c978785a92eeded
F src/wherecode.c d42d3e0fe93786621b84dec8065e1dc6b324d7c5934df52f141555843b6aef4e F src/wherecode.c d42d3e0fe93786621b84dec8065e1dc6b324d7c5934df52f141555843b6aef4e
F src/whereexpr.c 4b34be1434183e7bb8a05d4bf42bd53ea53021b0b060936fbd12062b4ff6b396 F src/whereexpr.c 4b34be1434183e7bb8a05d4bf42bd53ea53021b0b060936fbd12062b4ff6b396
F src/window.c 87795bb8293179cb8a92529264d49bd66b5bcad5e91cfc17dd8d3e66a2a77f88 F src/window.c 87795bb8293179cb8a92529264d49bd66b5bcad5e91cfc17dd8d3e66a2a77f88
@@ -1853,7 +1853,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 5e6357fc953a955d8ebb5c1fcd72e04e4ae5e8bf5941810015c2fbc50de70535 P 52ea0672d7494346c636cd7b05ca42161eb3b07d9378fa9959be9a11de87dbbb
R 4c70033507aedd6523a441599c072e7a R 36aa1965ca07c18187e2cc17b34e3feb
U drh U drh
Z 972b6b0655b9fda609bd390c407e9fc7 Z 9b3b04de4e9f091e2c9e4bbb9028222c

View File

@@ -1 +1 @@
52ea0672d7494346c636cd7b05ca42161eb3b07d9378fa9959be9a11de87dbbb 85e76887761b5d7e290fb2bac7f9121648f79d67fdd92f624d81632f28620518

View File

@@ -1731,7 +1731,7 @@ static int whereInScanEst(
/* /*
** Print the content of a WhereTerm object ** Print the content of a WhereTerm object
*/ */
static void whereTermPrint(WhereTerm *pTerm, int iTerm){ void sqlite3WhereTermPrint(WhereTerm *pTerm, int iTerm){
if( pTerm==0 ){ if( pTerm==0 ){
sqlite3DebugPrintf("TERM-%-3d NULL\n", iTerm); sqlite3DebugPrintf("TERM-%-3d NULL\n", iTerm);
}else{ }else{
@@ -1777,7 +1777,7 @@ static void whereTermPrint(WhereTerm *pTerm, int iTerm){
void sqlite3WhereClausePrint(WhereClause *pWC){ void sqlite3WhereClausePrint(WhereClause *pWC){
int i; int i;
for(i=0; i<pWC->nTerm; i++){ for(i=0; i<pWC->nTerm; i++){
whereTermPrint(&pWC->a[i], i); sqlite3WhereTermPrint(&pWC->a[i], i);
} }
} }
#endif #endif
@@ -1786,7 +1786,7 @@ void sqlite3WhereClausePrint(WhereClause *pWC){
/* /*
** Print a WhereLoop object for debugging purposes ** Print a WhereLoop object for debugging purposes
*/ */
static void whereLoopPrint(WhereLoop *p, WhereClause *pWC){ void sqlite3WhereLoopPrint(WhereLoop *p, WhereClause *pWC){
WhereInfo *pWInfo = pWC->pWInfo; WhereInfo *pWInfo = pWC->pWInfo;
int nb = 1+(pWInfo->pTabList->nSrc+3)/4; int nb = 1+(pWInfo->pTabList->nSrc+3)/4;
struct SrcList_item *pItem = pWInfo->pTabList->a + p->iTab; struct SrcList_item *pItem = pWInfo->pTabList->a + p->iTab;
@@ -1828,7 +1828,7 @@ static void whereLoopPrint(WhereLoop *p, WhereClause *pWC){
if( p->nLTerm && (sqlite3WhereTrace & 0x100)!=0 ){ if( p->nLTerm && (sqlite3WhereTrace & 0x100)!=0 ){
int i; int i;
for(i=0; i<p->nLTerm; i++){ for(i=0; i<p->nLTerm; i++){
whereTermPrint(p->aLTerm[i], i); sqlite3WhereTermPrint(p->aLTerm[i], i);
} }
} }
} }
@@ -2147,7 +2147,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
#if WHERETRACE_ENABLED /* 0x8 */ #if WHERETRACE_ENABLED /* 0x8 */
if( sqlite3WhereTrace & 0x8 ){ if( sqlite3WhereTrace & 0x8 ){
sqlite3DebugPrintf(x?" or-%d: ":" or-X: ", n); sqlite3DebugPrintf(x?" or-%d: ":" or-X: ", n);
whereLoopPrint(pTemplate, pBuilder->pWC); sqlite3WhereLoopPrint(pTemplate, pBuilder->pWC);
} }
#endif #endif
} }
@@ -2165,7 +2165,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
#if WHERETRACE_ENABLED /* 0x8 */ #if WHERETRACE_ENABLED /* 0x8 */
if( sqlite3WhereTrace & 0x8 ){ if( sqlite3WhereTrace & 0x8 ){
sqlite3DebugPrintf(" skip: "); sqlite3DebugPrintf(" skip: ");
whereLoopPrint(pTemplate, pBuilder->pWC); sqlite3WhereLoopPrint(pTemplate, pBuilder->pWC);
} }
#endif #endif
return SQLITE_OK; return SQLITE_OK;
@@ -2181,12 +2181,12 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
if( sqlite3WhereTrace & 0x8 ){ if( sqlite3WhereTrace & 0x8 ){
if( p!=0 ){ if( p!=0 ){
sqlite3DebugPrintf("replace: "); sqlite3DebugPrintf("replace: ");
whereLoopPrint(p, pBuilder->pWC); sqlite3WhereLoopPrint(p, pBuilder->pWC);
sqlite3DebugPrintf(" with: "); sqlite3DebugPrintf(" with: ");
}else{ }else{
sqlite3DebugPrintf(" add: "); sqlite3DebugPrintf(" add: ");
} }
whereLoopPrint(pTemplate, pBuilder->pWC); sqlite3WhereLoopPrint(pTemplate, pBuilder->pWC);
} }
#endif #endif
if( p==0 ){ if( p==0 ){
@@ -2210,7 +2210,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
#if WHERETRACE_ENABLED /* 0x8 */ #if WHERETRACE_ENABLED /* 0x8 */
if( sqlite3WhereTrace & 0x8 ){ if( sqlite3WhereTrace & 0x8 ){
sqlite3DebugPrintf(" delete: "); sqlite3DebugPrintf(" delete: ");
whereLoopPrint(pToDel, pBuilder->pWC); sqlite3WhereLoopPrint(pToDel, pBuilder->pWC);
} }
#endif #endif
whereLoopDelete(db, pToDel); whereLoopDelete(db, pToDel);
@@ -4829,7 +4829,7 @@ WhereInfo *sqlite3WhereBegin(
"ABCDEFGHIJKLMNOPQRSTUVWYXZ"; "ABCDEFGHIJKLMNOPQRSTUVWYXZ";
for(p=pWInfo->pLoops, i=0; p; p=p->pNextLoop, i++){ for(p=pWInfo->pLoops, i=0; p; p=p->pNextLoop, i++){
p->cId = zLabel[i%(sizeof(zLabel)-1)]; p->cId = zLabel[i%(sizeof(zLabel)-1)];
whereLoopPrint(p, sWLB.pWC); sqlite3WhereLoopPrint(p, sWLB.pWC);
} }
} }
#endif #endif
@@ -4869,7 +4869,7 @@ WhereInfo *sqlite3WhereBegin(
} }
sqlite3DebugPrintf("\n"); sqlite3DebugPrintf("\n");
for(ii=0; ii<pWInfo->nLevel; ii++){ for(ii=0; ii<pWInfo->nLevel; ii++){
whereLoopPrint(pWInfo->a[ii].pWLoop, sWLB.pWC); sqlite3WhereLoopPrint(pWInfo->a[ii].pWLoop, sWLB.pWC);
} }
} }
#endif #endif

View File

@@ -479,6 +479,8 @@ struct WhereInfo {
Bitmask sqlite3WhereGetMask(WhereMaskSet*,int); Bitmask sqlite3WhereGetMask(WhereMaskSet*,int);
#ifdef WHERETRACE_ENABLED #ifdef WHERETRACE_ENABLED
void sqlite3WhereClausePrint(WhereClause *pWC); void sqlite3WhereClausePrint(WhereClause *pWC);
void sqlite3WhereTermPrint(WhereTerm *pTerm, int iTerm);
void sqlite3WhereLoopPrint(WhereLoop *p, WhereClause *pWC);
#endif #endif
WhereTerm *sqlite3WhereFindTerm( WhereTerm *sqlite3WhereFindTerm(
WhereClause *pWC, /* The WHERE clause to be searched */ WhereClause *pWC, /* The WHERE clause to be searched */