1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +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

@@ -1361,6 +1361,11 @@ static void renameColumnFunc(
if( pStep->pUpsert ){
Upsert *pUpsert = pStep->pUpsert;
assert( rc==SQLITE_OK );
if( pTarget==pTab ){
pUpsert->pUpsertSrc = &sSrc;
sNC.uNC.pUpsert = pUpsert;
sNC.ncFlags = NC_UUpsert;
}
rc = sqlite3ResolveExprListNames(&sNC, pUpsert->pUpsertTarget);
if( rc==SQLITE_OK ){
ExprList *pUpsertSet = pUpsert->pUpsertSet;
@@ -1375,6 +1380,7 @@ static void renameColumnFunc(
if( rc==SQLITE_OK ){
rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertTargetWhere);
}
sNC.ncFlags = 0;
}
if( rc==SQLITE_OK && pTarget==pTab ){