aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-12-09 20:30:47 +0000
committerdrh <drh@noemail.net>2020-12-09 20:30:47 +0000
commite84ad92f17b96f1952f27645042bbf83fe6d0da5 (patch)
tree2fcba3afe39355cccb66226a626d5b5ab9e011a7 /src/sqliteInt.h
parent5602777e8fc872e638c0d9ccc116bebfd66e02e9 (diff)
downloadsqlite-e84ad92f17b96f1952f27645042bbf83fe6d0da5.tar.gz
sqlite-e84ad92f17b96f1952f27645042bbf83fe6d0da5.zip
For upsert, the constraint check code generator uses a copy of the index list
for the target table, which can potentially be reordered. FossilOrigin-Name: 3194c00c2c6a32bdfd5acc9fda5b38ae131d20cd3b7aea8512a41b2e76808f6a
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 06ddb3a61..8661f9058 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3078,10 +3078,14 @@ struct Upsert {
ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
- /* The fields above comprise the parse tree for the upsert clause.
- ** The fields below are used to transfer information from the INSERT
- ** processing down into the UPDATE processing while generating code.
- ** Upsert owns the memory allocated above, but not the memory below. */
+ /* Above this point is the parse tree for the ON CONFLICT clauses.
+ ** The next group of fields stores intermediate data. */
+ Index *pIdxList;
+ /* All fields above are owned by the Upsert object and must be freed
+ ** when the Upsert is destroyed. The fields below are used to transfer
+ ** information from the INSERT processing down into the UPDATE processing
+ ** while generating code. The fields below are owned by the INSERT
+ ** statement and will be freed by INSERT processing. */
Index *pUpsertIdx; /* Constraint that pUpsertTarget identifies */
SrcList *pUpsertSrc; /* Table to be updated */
int regData; /* First register holding array of VALUES */