1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-09-09 21:09:38 +03:00

Fix a problem with renaming a column that occurs as an "excluded.colname"

construction in an UPSERT that is part of a trigger program.

FossilOrigin-Name: bb2f7234968157b605522dea8e115d8772ab4234147894089d6e48fedf5d6a5d
This commit is contained in:
dan
2018-08-24 20:10:22 +00:00
parent 0d5fa6b979
commit 85a9d508df
5 changed files with 42 additions and 13 deletions

View File

@@ -349,9 +349,15 @@ static int lookupName(
#ifndef SQLITE_OMIT_UPSERT
if( pExpr->iTable==2 ){
testcase( iCol==(-1) );
pExpr->iTable = pNC->uNC.pUpsert->regData + iCol;
eNewExprOp = TK_REGISTER;
ExprSetProperty(pExpr, EP_Alias);
if( IN_RENAME_COLUMN ){
pExpr->iColumn = iCol;
pExpr->pTab = pTab;
eNewExprOp = TK_COLUMN;
}else{
pExpr->iTable = pNC->uNC.pUpsert->regData + iCol;
eNewExprOp = TK_REGISTER;
ExprSetProperty(pExpr, EP_Alias);
}
}else
#endif /* SQLITE_OMIT_UPSERT */
{