From 256f41edfe87bf92807d9c9500ae627a0045ef5e Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 24 Oct 2008 13:00:03 +0500 Subject: Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1 Problem: mysqld doesn't detect that enum data must be reinserted performing 'ALTER TABLE' in some cases. Fix: reinsert data altering an enum field if enum values are changed. mysql-test/r/alter_table.result: Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1 - test result. mysql-test/t/alter_table.test: Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1 - test case. sql/field.cc: Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1 - Field_enum::is_equal() introduced, which is called to detect that a field is changing by 'ALTER TABLE'. sql/field.h: Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1 - Field_enum::is_equal() introduced, which is called to detect that a field is changing by 'ALTER TABLE'. --- mysql-test/t/alter_table.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t/alter_table.test') diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 662f9095810..c45c89095fa 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -947,4 +947,16 @@ ALTER TABLE t1 CHANGE d c varchar(10); --disable_info DROP TABLE t1; + +# +# Bug #23113: Different behavior on altering ENUM fields between 5.0 and 5.1 +# +CREATE TABLE t1(a INT AUTO_INCREMENT PRIMARY KEY, + b ENUM('a', 'b', 'c') NOT NULL); +INSERT INTO t1 (b) VALUES ('a'), ('c'), ('b'), ('b'), ('a'); +ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL; +SELECT * FROM t1; +DROP TABLE t1; + + --echo End of 5.1 tests -- cgit v1.2.1