diff options
author | drh <> | 2021-10-07 12:11:20 +0000 |
---|---|---|
committer | drh <> | 2021-10-07 12:11:20 +0000 |
commit | 78b2fa8610bd2d149af7746faa79f095e505550c (patch) | |
tree | 2cc1a3e64483ca30acb31ead81e32df29913387f /src/insert.c | |
parent | 16a8f28e492507523c6b0b9d0bc0d9fd43c253a7 (diff) | |
download | sqlite-78b2fa8610bd2d149af7746faa79f095e505550c.tar.gz sqlite-78b2fa8610bd2d149af7746faa79f095e505550c.zip |
Protect every access to the Table.u union using a nearby assert() or branch.
FossilOrigin-Name: 50e08338aed7ac0cee600098d2ecd4b3b7bfd31a597bb26773badf3d2e2582c8
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/insert.c b/src/insert.c index acaafa023..84b998a64 100644 --- a/src/insert.c +++ b/src/insert.c @@ -2219,7 +2219,8 @@ void sqlite3GenerateConstraintChecks( ** ** This is not possible for ENABLE_PREUPDATE_HOOK builds, as the row ** must be explicitly deleted in order to ensure any pre-update hook - ** is invoked. */ + ** is invoked. */ + assert( IsOrdinaryTable(pTab) ); #ifndef SQLITE_ENABLE_PREUPDATE_HOOK if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ && pPk==pIdx /* Condition 2 */ @@ -2940,6 +2941,7 @@ static int xferOptimization( ** the extra complication to make this rule less restrictive is probably ** not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] */ + assert( IsOrdinaryTable(pDest) ); if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->u.tab.pFKey!=0 ){ return 0; } |