diff options
author | drh <drh@noemail.net> | 2019-09-02 02:21:58 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-09-02 02:21:58 +0000 |
commit | dd668c26b5d7a7526638e39239844e01a1d251e0 (patch) | |
tree | 038328bfda17b19f9a12e664c5989e85f79da23c /src/expr.c | |
parent | 0167ef202b2279af622956a4a1a073531759c216 (diff) | |
download | sqlite-dd668c26b5d7a7526638e39239844e01a1d251e0.tar.gz sqlite-dd668c26b5d7a7526638e39239844e01a1d251e0.zip |
When applying the IN_INDEX_NOOP optimization and the LHS has REAL affinity,
also apply REAL affinity to each element of the RHS.
Ticket [2841e99d104c6436].
FossilOrigin-Name: 88833a9c2849c959a37a80e0e4d2b211ce3c83a48319724c89b172b060c876b4
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c index fabb99cda..ac3d1c8e2 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3124,13 +3124,18 @@ static void sqlite3ExprCodeIN( int r2, regToFree; int regCkNull = 0; int ii; + int bLhsReal; /* True if the LHS of the IN has REAL affinity */ assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); if( destIfNull!=destIfFalse ){ regCkNull = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_BitAnd, rLhs, rLhs, regCkNull); } + bLhsReal = sqlite3ExprAffinity(pExpr->pLeft)==SQLITE_AFF_REAL; for(ii=0; ii<pList->nExpr; ii++){ r2 = sqlite3ExprCodeTemp(pParse, pList->a[ii].pExpr, ®ToFree); + if( bLhsReal ){ + sqlite3VdbeAddOp4(v, OP_Affinity, r2, 1, 0, "E", P4_STATIC); + } if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){ sqlite3VdbeAddOp3(v, OP_BitAnd, regCkNull, r2, regCkNull); } |