1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Fix a problem in ALTER TABLE causing table or column references in sub-selects ton the RHS of a vector SET clause in an UPDATE within a trigger (i.e. "SET (a,b) = ( (SELECT...), <expr> )").

FossilOrigin-Name: 255b0eeed113d83b474efc5bc8fc790a270bc43ee598df4b2c378e1ad2d729b7
This commit is contained in:
dan
2021-09-27 15:44:03 +00:00
parent 76ec55fddb
commit 5a69d19eea
5 changed files with 46 additions and 11 deletions

View File

@@ -518,7 +518,10 @@ Expr *sqlite3ExprForVectorField(
}else{
if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr;
pRet = sqlite3ExprDup(pParse->db, pVector, 0);
sqlite3RenameTokenRemap(pParse, pRet, pVector);
if( IN_RENAME_OBJECT && pRet ){
SWAP(Expr, *pRet, *pVector);
sqlite3RenameTokenRemap(pParse, pRet, pVector);
}
}
return pRet;
}