aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-04-12 13:15:43 +0000
committerdrh <drh@noemail.net>2018-04-12 13:15:43 +0000
commit46d2e5c35a7f7e82f874514a1c7a7e584c69e032 (patch)
treed348e97631ec962ba42ad1b1c2010e88619aefc4 /src/insert.c
parent35e86bf15d33d64df8c8618dcc3d49803d1d34b1 (diff)
downloadsqlite-46d2e5c35a7f7e82f874514a1c7a7e584c69e032.tar.gz
sqlite-46d2e5c35a7f7e82f874514a1c7a7e584c69e032.zip
Add the Upsert object for holding upsert clause information.
FossilOrigin-Name: d83eaed539b274c2abd650d07522f491865d4917acbb64d05d01b3ba5c3cd446
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/insert.c b/src/insert.c
index 6906efe0b..4fc79c223 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -489,7 +489,7 @@ void sqlite3Insert(
Select *pSelect, /* A SELECT statement to use as the data source */
IdList *pColumn, /* Column names corresponding to IDLIST. */
int onError, /* How to handle constraint errors */
- ExprList *pUpsert /* Upsert values */
+ Upsert *pUpsert /* ON CONFLICT clauses for upsert, or NULL */
){
sqlite3 *db; /* The main database structure */
Table *pTab; /* The table to insert into. aka TABLE */
@@ -528,11 +528,6 @@ void sqlite3Insert(
int tmask; /* Mask of trigger times */
#endif
- /* The conflict resolution type is always OE_Update or OE_Replace when
- ** there is an upsert clause */
- assert( onError==OE_Update || pUpsert==0 );
- assert( OE_Update==OE_Replace );
-
db = pParse->db;
if( pParse->nErr || db->mallocFailed ){
goto insert_cleanup;
@@ -1080,7 +1075,7 @@ insert_end:
insert_cleanup:
sqlite3SrcListDelete(db, pTabList);
sqlite3ExprListDelete(db, pList);
- sqlite3ExprListDelete(db, pUpsert);
+ sqlite3UpsertDelete(db, pUpsert);
sqlite3SelectDelete(db, pSelect);
sqlite3IdListDelete(db, pColumn);
sqlite3DbFree(db, aRegIdx);