mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-22 20:22:44 +03:00
Merge all the latest trunk changes into the experimental STAT3 branch.
FossilOrigin-Name: 51908c8f2bc6c086570f7493a29b096f0a40ce34
This commit is contained in:
11
src/where.c
11
src/where.c
@@ -467,11 +467,19 @@ static Bitmask exprListTableUsage(WhereMaskSet *pMaskSet, ExprList *pList){
|
||||
static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){
|
||||
Bitmask mask = 0;
|
||||
while( pS ){
|
||||
SrcList *pSrc = pS->pSrc;
|
||||
mask |= exprListTableUsage(pMaskSet, pS->pEList);
|
||||
mask |= exprListTableUsage(pMaskSet, pS->pGroupBy);
|
||||
mask |= exprListTableUsage(pMaskSet, pS->pOrderBy);
|
||||
mask |= exprTableUsage(pMaskSet, pS->pWhere);
|
||||
mask |= exprTableUsage(pMaskSet, pS->pHaving);
|
||||
if( ALWAYS(pSrc!=0) ){
|
||||
int i;
|
||||
for(i=0; i<pSrc->nSrc; i++){
|
||||
mask |= exprSelectTableUsage(pMaskSet, pSrc->a[i].pSelect);
|
||||
mask |= exprTableUsage(pMaskSet, pSrc->a[i].pOn);
|
||||
}
|
||||
}
|
||||
pS = pS->pPrior;
|
||||
}
|
||||
return mask;
|
||||
@@ -1994,8 +2002,7 @@ static void constructAutomaticIndex(
|
||||
v = pParse->pVdbe;
|
||||
assert( v!=0 );
|
||||
regIsInit = ++pParse->nMem;
|
||||
addrInit = sqlite3VdbeAddOp1(v, OP_If, regIsInit);
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, 1, regIsInit);
|
||||
addrInit = sqlite3VdbeAddOp1(v, OP_Once, regIsInit);
|
||||
|
||||
/* Count the number of columns that will be added to the index
|
||||
** and used to match WHERE clause constraints */
|
||||
|
||||
Reference in New Issue
Block a user