Test for bug #53820 "ALTER a MEDIUMINT column table causes full

table copy".

This patch only adds test case as the bug itself was addressed 
by Ramil's fix for bug 50946 "fast index creation still seems
to copy the table".
This commit is contained in:
Dmitry Lenev 2010-07-26 13:22:38 +04:00
parent 54c5e7c88f
commit c9e579bbb0
2 changed files with 29 additions and 0 deletions

View file

@ -1370,3 +1370,16 @@ CREATE TABLE t1 (id int);
INSERT INTO t1 VALUES (1), (2);
ALTER TABLE t1 ADD COLUMN (f1 INT), ADD COLUMN (f2 INT), ADD KEY f2k(f2);
DROP TABLE t1;
#
# Test for bug #53820 "ALTER a MEDIUMINT column table causes full
# table copy".
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT, b MEDIUMINT);
INSERT INTO t1 VALUES (1, 1), (2, 2);
# The below ALTER should not copy table and so no rows should
# be shown as affected.
ALTER TABLE t1 CHANGE a id INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;

View file

@ -1128,3 +1128,19 @@ INSERT INTO t1 VALUES (1), (2);
ALTER TABLE t1 ADD COLUMN (f1 INT), ADD COLUMN (f2 INT), ADD KEY f2k(f2);
DROP TABLE t1;
--echo #
--echo # Test for bug #53820 "ALTER a MEDIUMINT column table causes full
--echo # table copy".
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a INT, b MEDIUMINT);
INSERT INTO t1 VALUES (1, 1), (2, 2);
--echo # The below ALTER should not copy table and so no rows should
--echo # be shown as affected.
--enable_info
ALTER TABLE t1 CHANGE a id INT;
--disable_info
DROP TABLE t1;