mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Add the OP_ZeroOrNull opcode and use it to compute boolean values for
scalar comparisons, rather than the SQLITE_STOREP2 parameter to the comparison opcode. FossilOrigin-Name: 93781b6f10a94fb273204b95156a8b90e07071f28c89e7966c659a0f44f60e98
This commit is contained in:
10
src/expr.c
10
src/expr.c
@@ -4054,9 +4054,15 @@ expr_code_doover:
|
||||
}else{
|
||||
r1 = sqlite3ExprCodeTemp(pParse, pLeft, ®Free1);
|
||||
r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2);
|
||||
codeCompare(pParse, pLeft, pExpr->pRight, op,
|
||||
r1, r2, inReg, SQLITE_STOREP2 | p5,
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, 1, inReg);
|
||||
codeCompare(pParse, pLeft, pExpr->pRight, op, r1, r2,
|
||||
sqlite3VdbeCurrentAddr(v)+2, p5,
|
||||
ExprHasProperty(pExpr,EP_Commuted));
|
||||
if( p5==SQLITE_NULLEQ ){
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, 0, inReg);
|
||||
}else{
|
||||
sqlite3VdbeAddOp3(v, OP_ZeroOrNull, r1, inReg, r2);
|
||||
}
|
||||
assert(TK_LT==OP_Lt); testcase(op==OP_Lt); VdbeCoverageIf(v,op==OP_Lt);
|
||||
assert(TK_LE==OP_Le); testcase(op==OP_Le); VdbeCoverageIf(v,op==OP_Le);
|
||||
assert(TK_GT==OP_Gt); testcase(op==OP_Gt); VdbeCoverageIf(v,op==OP_Gt);
|
||||
|
||||
Reference in New Issue
Block a user