• Annamalai Gurusami's avatar
    Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD FOREIGN KEY · f97dfa81
    Annamalai Gurusami authored
    Problem:
    
    We maintain two rb trees in each dict_table_t.  The foreign_rbt must be in
    sync with foreign_list.  The referenced_rbt must be in sync with
    referenced_list. There is one function which checks this consistency and it
    failed, resulting in an assert failure.
    
    The root cause of the problem was identified that the search order was 
    lost in the referenced_rbt.  This is because while renaming the table,
    we didn't not refresh this referenced_rbt.
    
    Solution:
    
    When a foreign key is renamed, we must delete and re-insert into both
    foreign_rbt and referenced_rbt.  
    
    rb#6412 approved by Jimmy.
    f97dfa81
dict0dict.c 144 KB