Commit c67cf159 authored by Dmitry Lenev's avatar Dmitry Lenev

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".
parent 97bfd559
...@@ -1370,3 +1370,16 @@ CREATE TABLE t1 (id int); ...@@ -1370,3 +1370,16 @@ CREATE TABLE t1 (id int);
INSERT INTO t1 VALUES (1), (2); INSERT INTO t1 VALUES (1), (2);
ALTER TABLE t1 ADD COLUMN (f1 INT), ADD COLUMN (f2 INT), ADD KEY f2k(f2); ALTER TABLE t1 ADD COLUMN (f1 INT), ADD COLUMN (f2 INT), ADD KEY f2k(f2);
DROP TABLE t1; 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;
...@@ -1128,3 +1128,19 @@ INSERT INTO t1 VALUES (1), (2); ...@@ -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); ALTER TABLE t1 ADD COLUMN (f1 INT), ADD COLUMN (f2 INT), ADD KEY f2k(f2);
DROP TABLE t1; 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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment