diff options
author | dan <Dan Kennedy> | 2021-04-21 11:32:22 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2021-04-21 11:32:22 +0000 |
commit | fe599b05f2d6c3700146d30efc82753951a2b482 (patch) | |
tree | 60cefc4cb3204f2ca4dc383c57c69ea0b2af3938 /src | |
parent | 935ad98d60de4e76b101a4fcaedc599b46491d63 (diff) | |
download | sqlite-fe599b05f2d6c3700146d30efc82753951a2b482.tar.gz sqlite-fe599b05f2d6c3700146d30efc82753951a2b482.zip |
Fix a problem allowing SQL variables to be used expressions within the second and subsequent ON CONFLICT clauses of an UPSERT within a trigger.
FossilOrigin-Name: 2a28910a17dc5b3ce43062fdf879f9622f6ec2db19ed780fa7fe5cae781be7b7
Diffstat (limited to 'src')
-rw-r--r-- | src/attach.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/attach.c b/src/attach.c index 9bd57f286..dcfa4910d 100644 --- a/src/attach.c +++ b/src/attach.c @@ -573,14 +573,16 @@ int sqlite3FixTriggerStep( return 1; } #ifndef SQLITE_OMIT_UPSERT - if( pStep->pUpsert ){ - Upsert *pUp = pStep->pUpsert; - if( sqlite3WalkExprList(&pFix->w, pUp->pUpsertTarget) - || sqlite3WalkExpr(&pFix->w, pUp->pUpsertTargetWhere) - || sqlite3WalkExprList(&pFix->w, pUp->pUpsertSet) - || sqlite3WalkExpr(&pFix->w, pUp->pUpsertWhere) - ){ - return 1; + { + Upsert *pUp; + for(pUp=pStep->pUpsert; pUp; pUp=pUp->pNextUpsert){ + if( sqlite3WalkExprList(&pFix->w, pUp->pUpsertTarget) + || sqlite3WalkExpr(&pFix->w, pUp->pUpsertTargetWhere) + || sqlite3WalkExprList(&pFix->w, pUp->pUpsertSet) + || sqlite3WalkExpr(&pFix->w, pUp->pUpsertWhere) + ){ + return 1; + } } } #endif |