mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-26 09:41:10 +03:00
Fix a SQL NULL handling bug in the vector IN operator code generation.
FossilOrigin-Name: 936146b12e27784f15a68fe65732c6d92c3a12f3
This commit is contained in:
@ -499,15 +499,17 @@ static int codeEqualityTerm(
|
||||
int iMap = 0; /* Index in aiMap[] */
|
||||
pIn += i;
|
||||
for(i=iEq;i<pLoop->nLTerm; i++, pIn++){
|
||||
int iOut = iReg;
|
||||
if( pLoop->aLTerm[i]->pExpr==pX ){
|
||||
if( eType==IN_INDEX_ROWID ){
|
||||
assert( nEq==1 && i==iEq );
|
||||
pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg);
|
||||
}else{
|
||||
int iCol = aiMap ? aiMap[iMap++] : 0;
|
||||
int iOut = iReg + i - iEq;
|
||||
iOut = iReg + i - iEq;
|
||||
pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
|
||||
}
|
||||
sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v);
|
||||
if( i==iEq ){
|
||||
pIn->iCur = iTab;
|
||||
pIn->eEndLoopOp = bRev ? OP_PrevIfOpen : OP_NextIfOpen;
|
||||
@ -515,7 +517,6 @@ static int codeEqualityTerm(
|
||||
pIn->eEndLoopOp = OP_Noop;
|
||||
}
|
||||
}
|
||||
sqlite3VdbeAddOp1(v, OP_IsNull, iReg); VdbeCoverage(v);
|
||||
}
|
||||
}else{
|
||||
pLevel->u.in.nIn = 0;
|
||||
|
Reference in New Issue
Block a user