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:
@@ -831,6 +831,7 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){
|
||||
memset(&sNC, 0, sizeof(sNC));
|
||||
sNC.pParse = pParse;
|
||||
if( pCopy ) sqlite3SelectPrep(sNC.pParse, p, &sNC);
|
||||
if( sNC.pParse->db->mallocFailed ) return;
|
||||
sqlite3WalkSelect(pWalker, p);
|
||||
sqlite3RenameExprlistUnmap(pParse, pWith->a[i].pCols);
|
||||
}
|
||||
|
||||
+4
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user