summaryrefslogtreecommitdiff
path: root/mysql-test/t/lowercase_fs_off.test
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 /mysql-test/t/lowercase_fs_off.test
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 'mysql-test/t/lowercase_fs_off.test')
-rw-r--r--mysql-test/t/lowercase_fs_off.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test
index 86d1e084c29..1be0351f9bc 100644
--- a/mysql-test/t/lowercase_fs_off.test
+++ b/mysql-test/t/lowercase_fs_off.test
@@ -91,3 +91,14 @@ DROP DATABASE db1;
use test;
# End of 5.0 tests
+
+
+--echo #
+--echo # Extra test coverage for Bug#56595 RENAME TABLE causes assert on OS X
+--echo #
+
+CREATE TABLE t1(a INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
+RENAME TABLE t1 TO T1;
+ALTER TABLE T1 RENAME t1;
+DROP TABLE t1;