Commit ffdff42b authored by Rich Prohaska's avatar Rich Prohaska

refs #5334 simplify int expansion tests

git-svn-id: file:///svn/mysql/tests/mysql-test@47665 c7de825b-a66e-492c-adef-691d508d4ae1
parent c4ddc9d9
......@@ -10,6 +10,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a TINYINT;
ALTER TABLE t CHANGE COLUMN a a TINYINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -23,6 +24,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT;
ALTER TABLE t CHANGE COLUMN a a SMALLINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -36,6 +38,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -49,6 +52,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -62,6 +66,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -79,6 +84,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT;
ALTER TABLE t CHANGE COLUMN a a SMALLINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -92,6 +98,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -105,6 +112,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -118,6 +126,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -139,6 +148,7 @@ INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -152,6 +162,7 @@ INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -165,6 +176,7 @@ INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -189,6 +201,7 @@ INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -201,6 +214,7 @@ INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
......@@ -229,7 +243,228 @@ INSERT INTO t VALUES ( 9223372036854775807 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a TINYINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
......@@ -65,3 +65,67 @@ t CREATE TABLE `t` (
`a` bigint(20) NOT NULL DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED DEFAULT 100;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(3) unsigned DEFAULT '100'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED DEFAULT 200;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(5) unsigned DEFAULT '200'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED DEFAULT 300;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` mediumint(8) unsigned DEFAULT '300'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED DEFAULT 400;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(10) unsigned DEFAULT '400'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED DEFAULT 500;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` bigint(20) unsigned DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED NOT NULL DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED NOT NULL DEFAULT 100;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(3) unsigned NOT NULL DEFAULT '100'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED NOT NULL DEFAULT 200;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(5) unsigned NOT NULL DEFAULT '200'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED NOT NULL DEFAULT 300;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` mediumint(8) unsigned NOT NULL DEFAULT '300'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED NOT NULL DEFAULT 400;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(10) unsigned NOT NULL DEFAULT '400'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED NOT NULL DEFAULT 500;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` bigint(20) unsigned NOT NULL DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t;
......@@ -121,3 +121,123 @@ CREATE TABLE t (a INT, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
DROP TABLE IF EXISTS t;
DROP TABLE IF EXISTS t, ti;
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT);
......@@ -7,14 +7,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b TINYINT;
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
b
-128
-1
0
1
127
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
......@@ -22,14 +21,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT;
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
b
-128
-1
0
1
127
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
......@@ -37,14 +35,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
b
-128
-1
0
1
127
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
......@@ -52,14 +49,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
b
-128
-1
0
1
127
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
......@@ -67,30 +63,17 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
b
-128
-1
0
1
127
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
INSERT INTO t VALUES ( -32768 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
ALTER TABLE t CHANGE COLUMN a b TINYINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-32768
-1
0
1
32767
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
INSERT INTO t VALUES ( -32768 );
......@@ -98,14 +81,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT;
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
b
-32768
-1
0
1
32767
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
INSERT INTO t VALUES ( -32768 );
......@@ -113,14 +95,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
b
-32768
-1
0
1
32767
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
INSERT INTO t VALUES ( -32768 );
......@@ -128,14 +109,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
b
-32768
-1
0
1
32767
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
INSERT INTO t VALUES ( -32768 );
......@@ -143,46 +123,21 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
b
-32768
-1
0
1
32767
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
ALTER TABLE t CHANGE COLUMN a b TINYINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-8388608
-1
0
1
8388607
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-8388608
-1
0
1
8388607
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
......@@ -190,14 +145,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
b
-8388608
-1
0
1
8388607
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
......@@ -205,14 +159,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
b
-8388608
-1
0
1
8388607
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
......@@ -220,149 +173,298 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
b
-8388608
-1
0
1
8388607
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
ALTER TABLE t CHANGE COLUMN a b TINYINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-2147483648
0
1
2147483647
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-2147483648
0
1
2147483647
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-2147483648
0
1
2147483647
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
b
-2147483648
0
1
2147483647
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
b
-2147483648
0
1
2147483647
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
ALTER TABLE t CHANGE COLUMN a b TINYINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-9223372036854775808
0
1
9223372036854775807
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-9223372036854775808
0
1
9223372036854775807
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-9223372036854775808
0
1
9223372036854775807
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
ALTER TABLE t CHANGE COLUMN a b INT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
-9223372036854775808
0
1
9223372036854775807
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
b
-9223372036854775808
0
1
9223372036854775807
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b TINYINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
DROP TABLE IF EXISTS t, ti;
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
DROP TABLE IF EXISTS t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a TINYINT UNSIGNED DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED DEFAULT 100;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(3) unsigned DEFAULT '100'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED DEFAULT 200;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(5) unsigned DEFAULT '200'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED DEFAULT 300;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` mediumint(8) unsigned DEFAULT '300'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED DEFAULT 400;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(10) unsigned DEFAULT '400'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED DEFAULT 500;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` bigint(20) unsigned DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED NOT NULL DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED NOT NULL DEFAULT 100;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(3) unsigned NOT NULL DEFAULT '100'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED NOT NULL DEFAULT 200;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(5) unsigned NOT NULL DEFAULT '200'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED NOT NULL DEFAULT 300;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` mediumint(8) unsigned NOT NULL DEFAULT '300'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED NOT NULL DEFAULT 400;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(10) unsigned NOT NULL DEFAULT '400'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED NOT NULL DEFAULT 500;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` bigint(20) unsigned NOT NULL DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t;
DROP TABLE IF EXISTS t;
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, PRIMARY KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t;
DROP TABLE IF EXISTS t;
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
SELECT * FROM t;
b
0
1
255
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
b
0
1
255
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
b
0
1
255
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
b
0
1
255
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
b
0
1
255
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
65535
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
b
0
1
65535
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
b
0
1
65535
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
b
0
1
65535
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
b
0
1
65535
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
16777215
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
16777215
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
b
0
1
16777215
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
b
0
1
16777215
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
b
0
1
16777215
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
4294967295
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
4294967295
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
4294967295
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
b
0
1
4294967295
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
b
0
1
4294967295
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
b
0
1
18446744073709551615
DROP TABLE t;
......@@ -4,12 +4,6 @@
import sys
def gen_test(types, values):
print "# this test is generated by change_int.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t, ti;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
for a in range(len(types)):
for b in range(len(types)):
print
......@@ -23,6 +17,7 @@ def gen_test(types, values):
print "CREATE TABLE ti LIKE t;"
print "ALTER TABLE ti ENGINE=myisam;"
print "INSERT INTO ti SELECT * from t;"
print "ALTER TABLE ti CHANGE COLUMN a a %s;" % (types[b])
print "ALTER TABLE t CHANGE COLUMN a a %s;" % (types[b])
if a > b:
pass
......@@ -32,6 +27,12 @@ def gen_test(types, values):
print "DROP TABLE ti;"
print "DROP TABLE t;"
def main():
print "# this test is generated by change_int.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t, ti;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
gen_test(
[ "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT" ],
[ [ -128, -1, 0, 1, 127 ], [ -32768, -1, 0, 1, 32767], [-8388608, -1, 0, 1, 8388607], [-2147483648, 0, 1, 2147483647], [-9223372036854775808, 0, 1, 9223372036854775807] ]
......
......@@ -14,6 +14,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a TINYINT;
ALTER TABLE t CHANGE COLUMN a a TINYINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -29,6 +30,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT;
ALTER TABLE t CHANGE COLUMN a a SMALLINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -44,6 +46,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -59,6 +62,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -74,6 +78,7 @@ INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -95,6 +100,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT;
ALTER TABLE t CHANGE COLUMN a a SMALLINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -110,6 +116,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -125,6 +132,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -140,6 +148,7 @@ INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -167,6 +176,7 @@ INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -182,6 +192,7 @@ INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -197,6 +208,7 @@ INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -229,6 +241,7 @@ INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT;
ALTER TABLE t CHANGE COLUMN a a INT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -243,6 +256,7 @@ INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
......@@ -281,8 +295,279 @@ INSERT INTO t VALUES ( 9223372036854775807 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a TINYINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a a BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
......@@ -31,4 +31,30 @@ ALTER TABLE t CHANGE COLUMN a a INT NOT NULL DEFAULT 400;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT NOT NULL DEFAULT 500;
SHOW CREATE TABLE t;
DROP TABLE t;# test that int unsigned expansion + default change works
CREATE TABLE t (a TINYINT UNSIGNED DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED DEFAULT 100;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED DEFAULT 200;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED DEFAULT 300;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED DEFAULT 400;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED DEFAULT 500;
SHOW CREATE TABLE t;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED NOT NULL DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED NOT NULL DEFAULT 100;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED NOT NULL DEFAULT 200;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED NOT NULL DEFAULT 300;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED NOT NULL DEFAULT 400;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED NOT NULL DEFAULT 500;
SHOW CREATE TABLE t;
DROP TABLE t;
\ No newline at end of file
......@@ -164,3 +164,163 @@ CREATE TABLE t (a INT, CLUSTERING KEY(a));
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
# this test is generated by change_int.py
--disable_warnings
DROP TABLE IF EXISTS t;
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
......@@ -11,8 +11,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b TINYINT;
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
......@@ -21,8 +27,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT;
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
......@@ -31,8 +43,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
......@@ -41,8 +59,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
......@@ -51,20 +75,20 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
INSERT INTO t VALUES ( -32768 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
......@@ -73,8 +97,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT;
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
......@@ -83,8 +113,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
......@@ -93,8 +129,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
......@@ -103,32 +145,26 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
INSERT INTO t VALUES ( -8388608 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
......@@ -137,8 +173,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
......@@ -147,8 +189,14 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
......@@ -157,41 +205,32 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT);
INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT);
......@@ -199,8 +238,14 @@ INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT;
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT);
......@@ -208,52 +253,38 @@ INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
......@@ -261,6 +292,282 @@ INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT;
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b TINYINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b SMALLINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b MEDIUMINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b INT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE ti CHANGE COLUMN a b BIGINT UNSIGNED;
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
CREATE TABLE t (a INT PRIMARY KEY, b INT, c INT, d INT);
INSERT INTO t VALUES (1,2,3,4),(2,3,4,5);
SELECT * FROM t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
ALTER TABLE t CHANGE COLUMN b b BIGINT;
SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN c c BIGINT;
SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN d d BIGINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT PRIMARY KEY, b INT, c INT, d INT, CLUSTERING KEY(c));
INSERT INTO t VALUES (1,2,3,4),(2,3,4,5);
SELECT * FROM t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
ALTER TABLE t CHANGE COLUMN b b BIGINT;
SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN d d BIGINT;
SELECT * FROM t;
DROP TABLE t;
# this test is generated by change_int.py
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * from t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
DROP TABLE t;
# test that int unsigned expansion + default change works
--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a TINYINT UNSIGNED DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED DEFAULT 100;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED DEFAULT 200;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED DEFAULT 300;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED DEFAULT 400;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED DEFAULT 500;
SHOW CREATE TABLE t;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED NOT NULL DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED NOT NULL DEFAULT 100;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED NOT NULL DEFAULT 200;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED NOT NULL DEFAULT 300;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED NOT NULL DEFAULT 400;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED NOT NULL DEFAULT 500;
SHOW CREATE TABLE t;
DROP TABLE t;
\ No newline at end of file
# this test is generated by change_int_key.py
--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, PRIMARY KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED, CLUSTERING KEY(a));
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
DROP TABLE t;
# this test is generated by change_int.py
--disable_warnings
DROP TABLE IF EXISTS t;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a b INT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 );
ALTER TABLE t CHANGE COLUMN a b BIGINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t;
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