diff options
author | dan <dan@noemail.net> | 2019-08-17 19:13:49 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-08-17 19:13:49 +0000 |
commit | c324d44690c7b6dc640c46670e358d7f939e24f5 (patch) | |
tree | 9de6fd244b4ec7079f08bde7b7b1302d21719d9f /src/expr.c | |
parent | 9e9a67adb059733e05e0791f2ec519985eaa333c (diff) | |
download | sqlite-c324d44690c7b6dc640c46670e358d7f939e24f5.tar.gz sqlite-c324d44690c7b6dc640c46670e358d7f939e24f5.zip |
When populating an ephemeral b-tree for the RHS of an IN(...) clause, avoid applying an affinity to a value that may be used later on for some other purpose. Fix for [c7a117190].
FossilOrigin-Name: 43e8b14314d876178d487c3b519296ac1de065fdcaa70768e40d684015bceb9d
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c index ef4221ff8..41cc2724f 100644 --- a/src/expr.c +++ b/src/expr.c @@ -2787,7 +2787,7 @@ void sqlite3CodeRhsOfIN( int i; ExprList *pList = pExpr->x.pList; struct ExprList_item *pItem; - int r1, r2, r3; + int r1, r2; affinity = sqlite3ExprAffinity(pLeft); if( affinity<=SQLITE_AFF_NONE ){ affinity = SQLITE_AFF_BLOB; @@ -2815,9 +2815,9 @@ void sqlite3CodeRhsOfIN( } /* Evaluate the expression and insert it into the temp table */ - r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); - sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); - sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); + sqlite3ExprCode(pParse, pE2, r1); + sqlite3VdbeAddOp4(v, OP_MakeRecord, r1, 1, r2, &affinity, 1); + sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r1, 1); } sqlite3ReleaseTempReg(pParse, r1); sqlite3ReleaseTempReg(pParse, r2); |