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:
@ -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 );
|
||||
|
Reference in New Issue
Block a user