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