• unknown's avatar
    Fix for bug #17866 "Problem with renaming table with triggers with fully · 350475fa
    unknown authored
    qualified subject table" which was introduced during work on bug #13525
    "Rename table does not keep info of triggers".
    
    The bug was caused by the fact that during reconstruction of CREATE TRIGGER
    statement stored in .TRG file which happened during RENAME TABLE we damaged
    trigger definition in case when it contained fully qualified name of subject
    table (see comment for sql_yacc.yy for more info).
    
    
    mysql-test/r/trigger.result:
      Added test for bug #17866 "Problem with renaming table with triggers with fully
      qualified subject table".
    mysql-test/t/trigger.test:
      Added test for bug #17866 "Problem with renaming table with triggers with fully
      qualified subject table".
    sql/sql_trigger.cc:
      Table_triggers_list::change_table_name_in_triggers():
        Instead of trying to use pointer to the end of subject table identifier
        we use pointer to the beginning of FOR lexeme now, so during reconstruction
        of CREATE TRIGGER statement in this function we need to add extra space
        before part which begins with FOR to get nice trigger definition.
    sql/sql_yacc.yy:
      trigger_tail:
        In this rule we can't rely on using remember_end token after table_ident token,
        since value returned depends on whether table name is fully qualified or not.
        So instead of trying to get pointer to the end of table identifier we use
        pointer to the beginning of FOR lexeme.
    350475fa
sql_trigger.cc 44.8 KB