1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

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
This commit is contained in:
drh
2020-12-09 20:30:47 +00:00
parent 5602777e8f
commit e84ad92f17
5 changed files with 59 additions and 26 deletions

View File

@@ -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 */