Commit 4a5d393e authored by Rich Prohaska's avatar Rich Prohaska

refs #5333 add more column expansion tests

git-svn-id: file:///svn/mysql/tests/mysql-test@47636 c7de825b-a66e-492c-adef-691d508d4ae1
parent 56f95c66
DROP TABLE IF EXISTS t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a TINYINT DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT DEFAULT 100;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(4) DEFAULT '100'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a SMALLINT DEFAULT 200;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(6) DEFAULT '200'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT DEFAULT 300;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` mediumint(9) DEFAULT '300'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a INT DEFAULT 400;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT '400'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a BIGINT DEFAULT 500;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` bigint(20) DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE t;
CREATE TABLE t (a TINYINT NOT NULL DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT NOT NULL DEFAULT 100;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` tinyint(4) NOT NULL DEFAULT '100'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a SMALLINT NOT NULL DEFAULT 200;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(6) NOT NULL DEFAULT '200'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT NOT NULL DEFAULT 300;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` mediumint(9) NOT NULL DEFAULT '300'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a INT NOT NULL DEFAULT 400;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) NOT NULL DEFAULT '400'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a BIGINT NOT NULL DEFAULT 500;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` bigint(20) NOT NULL DEFAULT '500'
) ENGINE=TokuDB DEFAULT CHARSET=latin1
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;
This diff is collapsed.
#!/usr/bin/env python
# generate alter table test cases for integer types
import sys
def gen_test(n):
print "CREATE TABLE t (a CHAR(%d));" % (n)
for v in [ 'hi', 'there', 'people' ]:
print "INSERT INTO t VALUES ('%s');" % (v)
for i in range(2,256):
if i < n:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
else:
print "CREATE TABLE tt LIKE t;"
print "INSERT INTO tt SELECT * FROM t;"
print "ALTER TABLE t CHANGE COLUMN a b CHAR(%d);" % (i)
if i >= n:
print "SELECT * FROM t,tt where t.b = tt.a;"
print "DROP TABLE tt;"
print "DROP TABLE t;"
def main():
print "# this test is generated by change_char_rename.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
# all n takes too long to run, so here is a subset of tests
for n in [ 1, 2, 3, 4, 5, 6, 7, 8, 16, 31, 32, 63, 64, 127, 128, 254, 255 ]:
gen_test(n)
return 0
sys.exit(main())
# test that int 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 DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT DEFAULT 100;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT DEFAULT 200;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT DEFAULT 300;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a INT DEFAULT 400;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a BIGINT DEFAULT 500;
SHOW CREATE TABLE t;
DROP TABLE t;
CREATE TABLE t (a TINYINT NOT NULL DEFAULT 1);
ALTER TABLE t CHANGE COLUMN a a TINYINT NOT NULL DEFAULT 100;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a SMALLINT NOT NULL DEFAULT 200;
SHOW CREATE TABLE t;
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT NOT NULL DEFAULT 300;
SHOW CREATE TABLE t;
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;
\ No newline at end of file
# 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);
INSERT INTO t VALUES ( -128 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
ALTER TABLE t CHANGE COLUMN a b TINYINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
ALTER TABLE t CHANGE COLUMN a b SMALLINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
ALTER TABLE t CHANGE COLUMN a b MEDIUMINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
ALTER TABLE t CHANGE COLUMN a b INT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a TINYINT);
INSERT INTO t VALUES ( -128 );
INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 );
ALTER TABLE t CHANGE COLUMN a b BIGINT;
SELECT * FROM t;
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);
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 SMALLINT;
SELECT * FROM t;
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 MEDIUMINT;
SELECT * FROM t;
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 INT;
SELECT * FROM t;
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 BIGINT;
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 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);
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 MEDIUMINT;
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 );
ALTER TABLE t CHANGE COLUMN a b INT;
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 );
ALTER TABLE t CHANGE COLUMN a b BIGINT;
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 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);
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 INT;
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 );
ALTER TABLE t CHANGE COLUMN a b BIGINT;
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 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);
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 BIGINT;
SELECT * FROM t;
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.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