summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.h
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2010-09-16 11:11:13 +0200
committerJon Olav Hauglid <jon.hauglid@oracle.com>2010-09-16 11:11:13 +0200
commita302953bf77cceb0fec5097b7a5a7a937b8157c3 (patch)
treecb33ecedeedc556cabcde2a1922b1449b4c004ae /sql/sql_trigger.h
parente86bbbda55c12945aed9b141d4442b4dd6c49ea0 (diff)
downloadmariadb-git-a302953bf77cceb0fec5097b7a5a7a937b8157c3.tar.gz
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 caused lowercase_table2.test to fail. The assert checks that an exclusive metadata lock is held by the connection trying to do RENAME TABLE - specificially during updates of table triggers. The assert was triggered since the check is case sensitive and the lock was held on the normalized (lower case) version of the table name. This patch fixes the problem by making sure a normalized version of the table name is used for the metadata lock check, while using a non-normalized version of the table name for the rename of trigger files. The same is done for ALTER TABLE ... RENAME. Regression testing for the bug itself is already covered by lowercase_table2.test. Additional coverage added to lowercase_fs_off.test.
Diffstat (limited to 'sql/sql_trigger.h')
-rw-r--r--sql/sql_trigger.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 28bf0a60877..dd954957f07 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -157,6 +157,7 @@ public:
TABLE *table, bool names_only);
static bool drop_all_triggers(THD *thd, char *db, char *table_name);
static bool change_table_name(THD *thd, const char *db,
+ const char *old_alias,
const char *old_table,
const char *new_db,
const char *new_table);