diff options
author | Dmitry Lenev <Dmitry.Lenev@oracle.com> | 2011-06-17 02:50:07 +0400 |
---|---|---|
committer | Dmitry Lenev <Dmitry.Lenev@oracle.com> | 2011-06-17 02:50:07 +0400 |
commit | 2b992304b4c673921cfa3634f5a9a07c56cf9e37 (patch) | |
tree | b9e542e247d1cef6ffc6d32b4a74f4ccf9fd6629 /mysql-test/r/alter_table.result | |
parent | 699f0c067f82c07d6b495b594f6777995ceb6a6c (diff) | |
parent | edfd31a06a223620a32ea996f974d4dd3decfb80 (diff) | |
download | mariadb-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/r/alter_table.result')
-rw-r--r-- | mysql-test/r/alter_table.result | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index eba9562a8c3..ab6793235c7 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1345,6 +1345,35 @@ DROP TABLE t1; CREATE TABLE t1 (a TEXT, id INT, b INT); ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST; DROP TABLE t1; +# +# Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION +# FIRST CAN CAUSE DATA TO BE CORRUPTED". +# +drop table if exists t1; +# Use MyISAM engine as the fact that InnoDB doesn't support +# in-place ALTER TABLE in cases when columns are being renamed +# hides some bugs. +create table t1 (i int, j int) engine=myisam; +insert into t1 value (1, 2); +# First, test for original problem described in the bug report. +select * from t1; +i j +1 2 +# Change of column order by the below ALTER TABLE statement should +# affect both column names and column contents. +alter table t1 modify column j int first; +select * from t1; +j i +2 1 +# Now test for similar problem with the same root. +# The below ALTER TABLE should change not only the name but +# 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; +j k +2 0 +# Clean-up. +drop table t1; End of 5.1 tests CREATE TABLE t1(c CHAR(10), i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY); |