List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:September 8 2010 7:38am
Subject:bzr commit into mysql-5.5-runtime branch (jon.hauglid:3133) Bug#56595
View as plain text  
#At file:///export/home/x/mysql-5.5-runtime-bug56595/ based on revid:jon.hauglid@stripped

 3133 Jon Olav Hauglid	2010-09-08
      Bug #56595 RENAME TABLE causes assert on OS X
      
      The problem was that RENAME TABLE caused an assert if the system variable
      lower_case_table_names was 2 (default on Mac OS X) and the old table name
      was given in upper case. This was also seen in the lowercase_table2.test.
      
      The assert checks that an exclusive metadata lock is held by the connection
      trying to do RENAME TABLE - specificially during updates of triggers.
      The assert was triggered since the check is case sensitive and the lock
      was held on the lower case table name.
      
      This patch fixes the problem by making sure the lower case version of the
      table name is used for Table_triggers_list::change_table_name() and thus
      also the metadata lock check, similar to what is already done for
      ALTER TABLE ... RENAME.
      
      No test case added since this problem is already covered by 
      lowercase_table2.test

    modified:
      sql/sql_rename.cc
=== modified file 'sql/sql_rename.cc'
--- a/sql/sql_rename.cc	2010-08-10 11:16:44 +0000
+++ b/sql/sql_rename.cc	2010-09-08 07:38:02 +0000
@@ -284,7 +284,7 @@ do_rename(THD *thd, TABLE_LIST *ren_tabl
                                      new_db, new_alias, 0)))
         {
           if ((rc= Table_triggers_list::change_table_name(thd, ren_table->db,
-                                                          old_alias,
+                                                          ren_table->table_name,
                                                           new_db,
                                                           new_alias)))
           {


Attachment: [text/bzr-bundle] bzr/jon.hauglid@oracle.com-20100908073802-eohsk3ismnqb9vkr.bundle
Thread
bzr commit into mysql-5.5-runtime branch (jon.hauglid:3133) Bug#56595Jon Olav Hauglid8 Sep