summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorDmitry Lenev <Dmitry.Lenev@oracle.com>2011-06-17 02:50:07 +0400
committerDmitry Lenev <Dmitry.Lenev@oracle.com>2011-06-17 02:50:07 +0400
commit2b992304b4c673921cfa3634f5a9a07c56cf9e37 (patch)
treeb9e542e247d1cef6ffc6d32b4a74f4ccf9fd6629 /mysql-test/t/alter_table.test
parent699f0c067f82c07d6b495b594f6777995ceb6a6c (diff)
parentedfd31a06a223620a32ea996f974d4dd3decfb80 (diff)
downloadmariadb-git-2b992304b4c673921cfa3634f5a9a07c56cf9e37.tar.gz
Merged fix for bug #12652385 - "61493: REORDERING COLUMNS
TO POSITION FIRST CAN CAUSE DATA TO BE CORRUPTED" into mysql-5.5 tree.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 38d0d08808a..5cdd00b6afc 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1073,6 +1073,33 @@ ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
+--echo #
+--echo # Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION
+--echo # FIRST CAN CAUSE DATA TO BE CORRUPTED".
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--echo # Use MyISAM engine as the fact that InnoDB doesn't support
+--echo # in-place ALTER TABLE in cases when columns are being renamed
+--echo # hides some bugs.
+create table t1 (i int, j int) engine=myisam;
+insert into t1 value (1, 2);
+--echo # First, test for original problem described in the bug report.
+select * from t1;
+--echo # Change of column order by the below ALTER TABLE statement should
+--echo # affect both column names and column contents.
+alter table t1 modify column j int first;
+select * from t1;
+--echo # Now test for similar problem with the same root.
+--echo # The below ALTER TABLE should change not only the name but
+--echo # also the value for the last column of the table.
+alter table t1 drop column i, add column k int default 0;
+select * from t1;
+--echo # Clean-up.
+drop table t1;
+
+
--echo End of 5.1 tests
#