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
...@@ -65,3 +65,67 @@ t CREATE TABLE `t` ( ...@@ -65,3 +65,67 @@ t CREATE TABLE `t` (
`a` bigint(20) NOT NULL DEFAULT '500' `a` bigint(20) NOT NULL DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t; 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)); ...@@ -121,3 +121,123 @@ CREATE TABLE t (a INT, CLUSTERING KEY(a));
ALTER TABLE t CHANGE COLUMN a a BIGINT; ALTER TABLE t CHANGE COLUMN a a BIGINT;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
DROP TABLE t; 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, 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 @@ ...@@ -4,12 +4,6 @@
import sys import sys
def gen_test(types, values): 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 a in range(len(types)):
for b in range(len(types)): for b in range(len(types)):
print print
...@@ -23,6 +17,7 @@ def gen_test(types, values): ...@@ -23,6 +17,7 @@ def gen_test(types, values):
print "CREATE TABLE ti LIKE t;" print "CREATE TABLE ti LIKE t;"
print "ALTER TABLE ti ENGINE=myisam;" print "ALTER TABLE ti ENGINE=myisam;"
print "INSERT INTO ti SELECT * from t;" 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]) print "ALTER TABLE t CHANGE COLUMN a a %s;" % (types[b])
if a > b: if a > b:
pass pass
...@@ -32,6 +27,12 @@ def gen_test(types, values): ...@@ -32,6 +27,12 @@ def gen_test(types, values):
print "DROP TABLE ti;" print "DROP TABLE ti;"
print "DROP TABLE t;" print "DROP TABLE t;"
def main(): 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( gen_test(
[ "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT" ], [ "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] ] [ [ -128, -1, 0, 1, 127 ], [ -32768, -1, 0, 1, 32767], [-8388608, -1, 0, 1, 8388607], [-2147483648, 0, 1, 2147483647], [-9223372036854775808, 0, 1, 9223372036854775807] ]
......
...@@ -31,4 +31,30 @@ ALTER TABLE t CHANGE COLUMN a a INT NOT NULL DEFAULT 400; ...@@ -31,4 +31,30 @@ ALTER TABLE t CHANGE COLUMN a a INT NOT NULL DEFAULT 400;
SHOW CREATE TABLE t; SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT NOT NULL DEFAULT 500; ALTER TABLE t CHANGE COLUMN a a BIGINT NOT NULL DEFAULT 500;
SHOW CREATE TABLE t; 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; DROP TABLE t;
\ No newline at end of file
...@@ -164,3 +164,163 @@ CREATE TABLE t (a INT, CLUSTERING KEY(a)); ...@@ -164,3 +164,163 @@ CREATE TABLE t (a INT, CLUSTERING KEY(a));
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a BIGINT; ALTER TABLE t CHANGE COLUMN a a BIGINT;
DROP TABLE t; 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;
--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