mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Fix some problems with foreign key processing within REPLACE ops on WITHOUT
ROWID tables with no triggers or auxiliary indexes. FossilOrigin-Name: c1220b1af62629d7fc2178512786d613cd7ea711
This commit is contained in:
@@ -1554,12 +1554,15 @@ void sqlite3GenerateConstraintChecks(
|
||||
** (2) The table is a WITHOUT ROWID table
|
||||
** (3) There are no secondary indexes on the table
|
||||
** (4) No delete triggers need to be fired if there is a conflict
|
||||
** (5) No FK constraint counters need to be updated if a conflict occurs.
|
||||
*/
|
||||
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */
|
||||
&& pPk==pIdx /* Condition 2 */
|
||||
&& onError==OE_Replace /* Condition 1 */
|
||||
&& ( 0==(db->flags&SQLITE_RecTriggers) || /* Condition 4 */
|
||||
0==sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0))
|
||||
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */
|
||||
(0==pTab->pFKey && 0==sqlite3FkReferences(pTab)))
|
||||
){
|
||||
sqlite3VdbeResolveLabel(v, addrUniqueOk);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user