summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorDavi Arnaut <davi@mysql.com>2008-06-17 11:12:21 -0300
committerDavi Arnaut <davi@mysql.com>2008-06-17 11:12:21 -0300
commit5d237db6f6719e7a1132bdb664ac2206c7bb8a9b (patch)
treef39cf90ded924b0b4efe69724a020b3169a8709a /mysql-test/t/alter_table.test
parentfab820e66091225e4e07cabdb390712a34c4ed15 (diff)
downloadmariadb-git-5d237db6f6719e7a1132bdb664ac2206c7bb8a9b.tar.gz
Bug#33873: Fast ALTER TABLE doesn't work with multibyte character sets
The problem was that when comparing tables for a possible fast alter table, the comparison was being performed using the parsed information and not the final definition. The solution is to use the possible final table layout to compare if a fast alter is possible or not. mysql-test/include/mix1.inc: Disable test case for Bug 21704 as it hasn't been fixed. mysql-test/r/alter_table.result: Add test case result for Bug#33873 mysql-test/r/innodb_mysql.result: Update test case result mysql-test/t/alter_table.test: Add test case for Bug#33873 sql/sql_table.cc: Use updated (final) information to compare fields.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 99c9ae23801..662f9095810 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -914,3 +914,37 @@ unlock tables;
select * from t1;
check table t1;
drop table t1;
+
+#
+# Bug#33873: Fast ALTER TABLE doesn't work with multibyte character sets
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (id int, c int) character set latin1;
+INSERT INTO t1 VALUES (1,1);
+--enable_info
+ALTER TABLE t1 CHANGE c d int;
+ALTER TABLE t1 CHANGE d c int;
+ALTER TABLE t1 MODIFY c VARCHAR(10);
+ALTER TABLE t1 CHANGE c d varchar(10);
+ALTER TABLE t1 CHANGE d c varchar(10);
+--disable_info
+DROP TABLE t1;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (id int, c int) character set utf8;
+INSERT INTO t1 VALUES (1,1);
+--enable_info
+ALTER TABLE t1 CHANGE c d int;
+ALTER TABLE t1 CHANGE d c int;
+ALTER TABLE t1 MODIFY c VARCHAR(10);
+ALTER TABLE t1 CHANGE c d varchar(10);
+ALTER TABLE t1 CHANGE d c varchar(10);
+--disable_info
+DROP TABLE t1;
+
+--echo End of 5.1 tests