Skip to content
  • Lakshmi Narayanan Sreethar's avatar
    f25bf01c
    BUG#18234170 · f25bf01c
    Lakshmi Narayanan Sreethar authored
    Foreign Constraints are lost from NDB Tables during truncate
    
    The foreign constraints are lost from cluster, when truncate table is
    issued on a ndb table. Truncate is internally executed as a drop + create
    table in the NDB engine. The foreign constraints are dropped along with
    the table and when the table is recreated, they are lost.
    
    This patch solves the issue by saving the foreign key details into a local
    list and later restoring it into the newly created table.
    Changes :
     - created Ndb_fk_list, a wrapper class for the sql list to hold NDBFKs
     - added functions get_fk_data_for_truncate & recreate_fk_for_truncate,
       to retrieve and restore the foreign key details into the table
     - A local list in ha_ndbcluster::create of type Ndb_fk_list to store
       the fk list.
     - updated test cases
    f25bf01c
    BUG#18234170
    Lakshmi Narayanan Sreethar authored
    Foreign Constraints are lost from NDB Tables during truncate
    
    The foreign constraints are lost from cluster, when truncate table is
    issued on a ndb table. Truncate is internally executed as a drop + create
    table in the NDB engine. The foreign constraints are dropped along with
    the table and when the table is recreated, they are lost.
    
    This patch solves the issue by saving the foreign key details into a local
    list and later restoring it into the newly created table.
    Changes :
     - created Ndb_fk_list, a wrapper class for the sql list to hold NDBFKs
     - added functions get_fk_data_for_truncate & recreate_fk_for_truncate,
       to retrieve and restore the foreign key details into the table
     - A local list in ha_ndbcluster::create of type Ndb_fk_list to store
       the fk list.
     - updated test cases
Loading