• Dmitry Lenev's avatar
    Bug#11938039 "RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME · be65ee15
    Dmitry Lenev authored
    CLAUSE FAILS OR ABORTS SERVER".
     
    Attempt to re-execute prepared ALTER TABLE statement which 
    involves .FRM-only changes and also have RENAME clause led
    to unwarranted 'Table doesn't exist' error in production
    builds and assertion failure for debug builds.
     
    This problem stemmed from the fact that for such ALTER TABLE
    mysql_alter_table() code changed table list element for table 
    to be altered when it tried to re-open table under new name. 
    Since this change was not reverted back before next 
    re-execution, it made this statement re-execution unsafe.
     
    This fix addresses this problem by avoiding changing table list
    element from the main table list in such a situation. Instead 
    temporary TABLE_LIST object is used.
    be65ee15
alter_table.test 30.9 KB