aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-12-09 01:34:48 +0000
committerdrh <drh@noemail.net>2020-12-09 01:34:48 +0000
commit20b86324a1b3c78b5eee3872d1934ec21c911bfa (patch)
tree20e1e184fd3b61f3a01fce7e97d2eec503bc30e9 /src/insert.c
parent2549e4cc2fef9fc969a9efdc723c2bcf1ac69f1f (diff)
downloadsqlite-20b86324a1b3c78b5eee3872d1934ec21c911bfa.tar.gz
sqlite-20b86324a1b3c78b5eee3872d1934ec21c911bfa.zip
Initialize all terms in the ON CONFLICT clause stack.
FossilOrigin-Name: 5e683fd1cbde53f37cf8a2b1e981191e2b29e3376db554691767f33c37c7547e
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/insert.c b/src/insert.c
index 393cd528f..137590a5e 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -975,6 +975,7 @@ void sqlite3Insert(
}
#ifndef SQLITE_OMIT_UPSERT
if( pUpsert ){
+ Upsert *pNx;
if( IsVirtual(pTab) ){
sqlite3ErrorMsg(pParse, "UPSERT not implemented for virtual table \"%s\"",
pTab->zName);
@@ -988,13 +989,17 @@ void sqlite3Insert(
goto insert_cleanup;
}
pTabList->a[0].iCursor = iDataCur;
- pUpsert->pUpsertSrc = pTabList;
- pUpsert->regData = regData;
- pUpsert->iDataCur = iDataCur;
- pUpsert->iIdxCur = iIdxCur;
- if( pUpsert->pUpsertTarget ){
- sqlite3UpsertAnalyzeTarget(pParse, pTabList, pUpsert);
- }
+ pNx = pUpsert;
+ do{
+ pNx->pUpsertSrc = pTabList;
+ pNx->regData = regData;
+ pNx->iDataCur = iDataCur;
+ pNx->iIdxCur = iIdxCur;
+ if( pNx->pUpsertTarget ){
+ sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx);
+ }
+ pNx = pNx->pNextUpsert;
+ }while( pNx!=0 );
}
#endif