summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2011-02-21 12:30:08 +0100
committerJon Olav Hauglid <jon.hauglid@oracle.com>2011-02-21 12:30:08 +0100
commitf7a0b45f5aeed08d8e46fc24d313f013af6e55ed (patch)
tree83e3092ffae15545c0f1e186dfd142e2a0fbfe0e /mysql-test/t/alter_table.test
parent95b4ff0081fe614eeba9d7fa60cb667477836c1c (diff)
downloadmariadb-git-f7a0b45f5aeed08d8e46fc24d313f013af6e55ed.tar.gz
Bug #11754461 CANNOT ALTER TABLE WHEN KEY PREFIX TOO LONG
The problem was that doing ALTER TABLE on a table which had a key on a TEXT/BLOB column with a prefix longer than the maximum number of characteres in this column (as per the character set), by mistake, caused an error (Error 1170 - ER_BLOB_KEY_WITHOUT_LENGTH). This bug not repeatable in 5.5. This patch adds a regression test to alter_table.test and contains no code changes.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 5b5fdf50c16..5d71eead642 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1144,3 +1144,18 @@ INSERT INTO t1 VALUES (1, 1), (2, 2);
ALTER TABLE t1 CHANGE a id INT;
--disable_info
DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#11754461 CANNOT ALTER TABLE WHEN KEY PREFIX TOO LONG
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1 CHARACTER SET utf8;
+CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100)));
+ALTER TABLE db1.t1 ADD baz INT;
+
+DROP DATABASE db1;