1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Simplification to the logic that prevents automatic indexes from being formed

on constant expressions.

FossilOrigin-Name: 36d67e1dd2b4f4c22d02f3c3b8d372074de5523a
This commit is contained in:
drh
2014-06-17 09:52:26 +00:00
parent 6b7ff748a1
commit 9f808299ff
3 changed files with 8 additions and 11 deletions

View File

@@ -4529,10 +4529,7 @@ static int whereLoopAddBtree(
WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
if( pTerm->prereqRight & pNew->maskSelf ) continue;
if( pTerm->prereqRight==0
&& sqlite3ExprIsConstant(pTerm->pExpr->pRight) ){
continue;
}
if( sqlite3ExprIsConstant(pTerm->pExpr->pRight) ) continue;
if( termCanDriveIndex(pTerm, pSrc, 0) ){
pNew->u.btree.nEq = 1;
pNew->u.btree.nSkip = 0;