1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Make sure indexes on expressions skip over initial NULL values in the

index.  Fix for ticket [4baa464912129477f3c9]

FossilOrigin-Name: 71797ba431085f9ae381ed5ea6471967926f4043
This commit is contained in:
drh
2016-10-10 13:29:15 +00:00
parent ea5e5f0b89
commit 48590fcb37
4 changed files with 30 additions and 14 deletions

View File

@ -1446,11 +1446,11 @@ Bitmask sqlite3WhereCodeOneLoopStart(
pLevel->iLikeRepCntr |= bRev ^ (pIdx->aSortOrder[nEq]==SQLITE_SO_DESC);
}
#endif
if( pRangeStart==0
&& (j = pIdx->aiColumn[nEq])>=0
&& pIdx->pTable->aCol[j].notNull==0
){
bSeekPastNull = 1;
if( pRangeStart==0 ){
j = pIdx->aiColumn[nEq];
if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){
bSeekPastNull = 1;
}
}
}
assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 );