1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument.

FossilOrigin-Name: c21f58d84859e479a6cc619671a0df48b2f9692e
This commit is contained in:
dan
2013-09-02 07:16:40 +00:00
parent 1df556e6f2
commit 575ab2f8f6
4 changed files with 70 additions and 10 deletions

View File

@@ -2553,7 +2553,12 @@ static int whereRangeScanEst(
){
UnpackedRecord *pRec = pBuilder->pRec;
tRowcnt a[2];
u8 aff = p->pTable->aCol[p->aiColumn[0]].affinity;
u8 aff;
if( nEq==p->nColumn ){
aff = SQLITE_AFF_INTEGER;
}else{
aff = p->pTable->aCol[p->aiColumn[nEq]].affinity;
}
/* Variable iLower will be set to the estimate of the number of rows in
** the index that are less than the lower bound of the range query. The