Skip to content
  • Martin Skold's avatar
    ddd57342
    Bug #14095855 FOREIGN_KEY_CHECKS SHOULD APPLY TO NDB TABLES · ddd57342
    Martin Skold authored
    This is a patch for supporting toggling on/off
    of foreign key checking in ndb.
    Innodb supports
    
    set foreign_key_checks = 0;
    
    to immediately disable all foreign key checking, even
    if set inside an ongoing transaction. All operations
    prior to the setting will have foreign key constraints
    checked and all operations after will not. For Innodb
    these checks are done immediately, but for Ndb the setting
    
    set ndb_deferred_constraints = 1;
    
    will defer the foreign key checks until commit time.
    The setting of foreign_key_checks = 0; inside a transaction
    will only affect operations executed after the change,
    operations done before will cause foreign keys to be checked.
    
    The setting of foreign_key_checks = 0 will of course also
    disable any defined cascade of deletes or updates.
    
    The implementation disables Ndb's internal triggers for
    foreign key checking inside TUP so it will also have a
    performance improvement during restoring backups with
    foreign key checks disabled.
    
    ddd57342
    Bug #14095855 FOREIGN_KEY_CHECKS SHOULD APPLY TO NDB TABLES
    Martin Skold authored
    This is a patch for supporting toggling on/off
    of foreign key checking in ndb.
    Innodb supports
    
    set foreign_key_checks = 0;
    
    to immediately disable all foreign key checking, even
    if set inside an ongoing transaction. All operations
    prior to the setting will have foreign key constraints
    checked and all operations after will not. For Innodb
    these checks are done immediately, but for Ndb the setting
    
    set ndb_deferred_constraints = 1;
    
    will defer the foreign key checks until commit time.
    The setting of foreign_key_checks = 0; inside a transaction
    will only affect operations executed after the change,
    operations done before will cause foreign keys to be checked.
    
    The setting of foreign_key_checks = 0 will of course also
    disable any defined cascade of deletes or updates.
    
    The implementation disables Ndb's internal triggers for
    foreign key checking inside TUP so it will also have a
    performance improvement during restoring backups with
    foreign key checks disabled.
    
Loading