1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

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
This commit is contained in:
dan
2019-08-17 19:13:49 +00:00
parent 9e9a67adb0
commit c324d44690
4 changed files with 30 additions and 13 deletions

View File

@@ -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);