diff options
author | drh <> | 2024-03-08 14:01:48 +0000 |
---|---|---|
committer | drh <> | 2024-03-08 14:01:48 +0000 |
commit | 926fb60b05be799ff6e9f0013d2a0f393cfd380c (patch) | |
tree | c0da63211be0e1ec778187ea194e0917acccfc43 /src/sqliteInt.h | |
parent | b89aa10cd0d980563df54b5ad0fb2214f06c7c80 (diff) | |
download | sqlite-926fb60b05be799ff6e9f0013d2a0f393cfd380c.tar.gz sqlite-926fb60b05be799ff6e9f0013d2a0f393cfd380c.zip |
Silently ignore redundant ON CONFLICT clauses in an UPSERT. Only the first
ON CONFLICT for each index is active. Do not issue an error, since that might
break legacy queries. But ignore the redundant ON CONFLICT clauses to prevent
problems such as described in [forum:/forumpost/919c6579c8|forum post 919c6579c8].
FossilOrigin-Name: d0ea6b6ba64dba9d68c2b391ccf1171ea96fcdd7409dafdb2b697accb00246b8
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index f5920748b..91cf17304 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -3476,6 +3476,7 @@ struct Upsert { Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */ Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */ u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */ + u8 isDup; /* True if 2nd or later with same pUpsertIdx */ /* Above this point is the parse tree for the ON CONFLICT clauses. ** The next group of fields stores intermediate data. */ void *pToFree; /* Free memory when deleting the Upsert object */ @@ -5552,7 +5553,7 @@ const char *sqlite3JournalModename(int); Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*); void sqlite3UpsertDelete(sqlite3*,Upsert*); Upsert *sqlite3UpsertDup(sqlite3*,Upsert*); - int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*); + int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*,Upsert*); void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int); Upsert *sqlite3UpsertOfIndex(Upsert*,Index*); int sqlite3UpsertNextIsIPK(Upsert*); |