1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Reduce the scope of a variable in order to fix a harmless compiler warning

that occurs under -DSQLITE_OMIT_AUTOMATIC_INDEX.

FossilOrigin-Name: 36d5dbbe13562f4ea6435e620d102f8515bd0e6b8e66fd1841062a4e4621e330
This commit is contained in:
drh
2021-07-28 01:22:23 +00:00
parent 1ae057d873
commit 9045e7d696
3 changed files with 10 additions and 10 deletions

View File

@@ -2984,7 +2984,6 @@ static int whereLoopAddBtree(
int iSortIdx = 1; /* Index number */
int b; /* A boolean value */
LogEst rSize; /* number of rows in the table */
LogEst rLogSize; /* Logarithm of the number of rows in the table */
WhereClause *pWC; /* The parsed WHERE clause */
Table *pTab; /* Table being queried */
@@ -3027,7 +3026,6 @@ static int whereLoopAddBtree(
pProbe = &sPk;
}
rSize = pTab->nRowLogEst;
rLogSize = estLog(rSize);
#ifndef SQLITE_OMIT_AUTOMATIC_INDEX
/* Automatic indexes */
@@ -3041,8 +3039,10 @@ static int whereLoopAddBtree(
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */
){
/* Generate auto-index WhereLoops */
LogEst rLogSize; /* Logarithm of the number of rows in the table */
WhereTerm *pTerm;
WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
rLogSize = estLog(rSize);
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
if( pTerm->prereqRight & pNew->maskSelf ) continue;
if( termCanDriveIndex(pTerm, pSrc, 0) ){