mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Allow an automatic index on a WHERE constraint where the RHS is does not
reference another table as long as the RHS is not a constant. FossilOrigin-Name: 58acc2a8b38c5f13175c191697b4d2b663db1872
This commit is contained in:
@@ -4529,7 +4529,10 @@ 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 ) continue;
|
||||
if( pTerm->prereqRight==0
|
||||
&& sqlite3ExprIsConstant(pTerm->pExpr->pRight) ){
|
||||
continue;
|
||||
}
|
||||
if( termCanDriveIndex(pTerm, pSrc, 0) ){
|
||||
pNew->u.btree.nEq = 1;
|
||||
pNew->u.btree.nSkip = 0;
|
||||
|
||||
Reference in New Issue
Block a user