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

Fix an error in estimating of the number of rows visited by a range scan.

FossilOrigin-Name: d491de62fce69d93e89f65f7713972f7c2c451f7
This commit is contained in:
dan
2014-04-28 08:49:54 +00:00
parent 2dd3cdcfab
commit 440e6ff3b0
4 changed files with 41 additions and 9 deletions

View File

@@ -4241,7 +4241,12 @@ static int whereLoopAddBtreeIndex(
pNew->nOut += nInMul + nIn;
whereLoopOutputAdjust(pBuilder->pWC, pNew);
rc = whereLoopInsert(pBuilder, pNew);
pNew->nOut = nOutUnadjusted;
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
pNew->nOut = saved_nOut;
}else{
pNew->nOut = nOutUnadjusted;
}
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
&& pNew->u.btree.nEq<(pProbe->nKeyCol + (pProbe->zName!=0))