• Annamalai Gurusami's avatar
    Bug #16722314 FOREIGN KEY ID MODIFIED DURING EXPORT · bf7325bb
    Annamalai Gurusami authored
    Bug #16754901 PARS_INFO_FREE NOT CALLED IN DICT_CREATE_ADD_FOREIGN_TO_DICTIONARY
    
    Problem:
    
    There are two situations here.  The constraint name is explicitly
    given by the user and the constraint name is automatically generated
    by InnoDB.  In the case of generated constraint name, it is formed by
    adding table name as prefix.  The table names are stored internally in
    my_charset_filename.  In the case of constraint name explicitly given
    by the user, it is stored in UTF8 format itself.  So, in some
    situations the constraint name is in utf8 and in some situations it is
    in my_charset_filename format.  Hence this problem.
    
    Solution:
    
    Always store the foreign key constraint name in UTF-8 even when
    automatically generated.
    
    Bug #16754901 PARS_INFO_FREE NOT CALLED IN DICT_CREATE_ADD_FOREIGN_TO_DICTIONARY
    
    Problem:
    
    There was a memory leak in the function dict_create_add_foreign_to_dictionary().
    The allocated pars_info_t object is not freed in the error code path.
    
    Solution:
    
    Allocate the pars_info_t object after the error checking.
    
    rb#2368 in review
    
    bf7325bb
dict0dict.c 133 KB