Commit 7a862e80 authored by Rich Prohaska's avatar Rich Prohaska

refs #5333 replace table data diff for hot column expansion tests

git-svn-id: file:///svn/mysql/tests/mysql-test@47647 c7de825b-a66e-492c-adef-691d508d4ae1
parent bb8aefd1
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 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;
SELECT * FROM t;
a
0
1
255
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;
SELECT * FROM t;
a
0
1
255
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;
SELECT * FROM t;
a
0
1
255
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;
SELECT * FROM t;
a
0
1
255
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;
SELECT * FROM t;
a
0
1
255
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 );
ALTER TABLE t CHANGE COLUMN a a 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 );
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;
SELECT * FROM t;
a
0
1
65535
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;
SELECT * FROM t;
a
0
1
65535
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;
SELECT * FROM t;
a
0
1
65535
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;
SELECT * FROM t;
a
0
1
65535
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 );
ALTER TABLE t CHANGE COLUMN a a 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 a 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 );
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;
SELECT * FROM t;
a
0
1
16777215
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;
SELECT * FROM t;
a
0
1
16777215
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;
SELECT * FROM t;
a
0
1
16777215
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 );
ALTER TABLE t CHANGE COLUMN a a 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 a 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 a 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 );
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;
SELECT * FROM t;
a
0
1
4294967295
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;
SELECT * FROM t;
a
0
1
4294967295
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
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 a 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 a 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 a 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 a 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 );
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;
SELECT * FROM t;
a
0
1
18446744073709551615
include/diff_tables.inc [test.t, test.ti]
DROP TABLE ti;
DROP TABLE t;
#!/usr/bin/env python
# generate alter table test cases for integer types
# generate alter table test cases for char types
import sys
def gen_test(n):
print "CREATE TABLE t (a BINARY(%d));" % (n)
for v in [ 1,2,3 ]:
for v in [ 0, 1, 2, 4, 8, 16, 32, 64, 126, 127 ]:
print "INSERT INTO t VALUES (%d);" % (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 "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 BINARY(%d);" % (i)
print "ALTER TABLE t CHANGE COLUMN a a BINARY(%d);" % (i)
if i >= n:
print "SELECT HEX(t.a),HEX(tt.a) FROM t,tt where t.a = tt.a;"
print "DROP TABLE tt;"
print "let $diff_tables=test.t, test.ti;"
print "source include/diff_tables.inc;"
print "DROP TABLE ti;"
print "DROP TABLE t;"
def main():
print "# this test is generated by change_int.py"
print "# this test is generated by change_bin.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;"
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;"
......
#!/usr/bin/env python
# generate alter table test cases for integer types
# generate alter table test cases for char types
import sys
def gen_test(n):
......@@ -12,18 +12,21 @@ def gen_test(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 "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 CHAR(%d);" % (i)
print "ALTER TABLE t CHANGE COLUMN a a CHAR(%d);" % (i)
if i >= n:
print "SELECT * FROM t,tt where t.a = tt.a;"
print "DROP TABLE tt;"
print "let $diff_tables=test.t, test.ti;"
print "source include/diff_tables.inc;"
print "DROP TABLE ti;"
print "DROP TABLE t;"
def main():
print "# this test is generated by change_char.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;"
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;"
......
......@@ -12,19 +12,21 @@ def gen_test(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 "CREATE TABLE ti LIKE t;"
print "ALTER TABLE ti ENGINE=myisam;"
print "INSERT INTO ti SELECT * FROM t;"
print "ALTER TABLE t CHANGE COLUMN a b CHAR(%d);" % (i)
if i >= n:
print "ALTER TABLE t CHANGE COLUMN b a CHAR(%d);" % (i)
print "SELECT * FROM t,tt where t.a = tt.a;"
print "DROP TABLE tt;"
print "let $diff_tables=test.t, test.ti;"
print "source include/diff_tables.inc;"
print "DROP TABLE ti;"
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 "DROP TABLE IF EXISTS t,ti;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
......
......@@ -6,7 +6,7 @@ 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;"
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;"
......@@ -14,13 +14,22 @@ def gen_test(types, values):
for b in range(len(types)):
print
print "CREATE TABLE t (a %s);" % (types[a])
for x in values[a]:
print "INSERT INTO t VALUES (", x, ");"
if a > b:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
else:
for x in values[a]:
print "INSERT INTO t VALUES (", x, ");"
print "CREATE TABLE ti LIKE t;"
print "ALTER TABLE ti ENGINE=myisam;"
print "INSERT INTO ti SELECT * from t;"
print "ALTER TABLE t CHANGE COLUMN a a %s;" % (types[b])
print "SELECT * FROM t;"
if a > b:
pass
else:
print "let $diff_tables = test.t, test.ti;"
print "source include/diff_tables.inc;"
print "DROP TABLE ti;"
print "DROP TABLE t;"
def main():
gen_test(
......
# 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,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 t CHANGE COLUMN a a 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 +26,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 t CHANGE COLUMN a a 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 +41,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 t CHANGE COLUMN a a 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 +56,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 t CHANGE COLUMN a a 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 +71,19 @@ 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 t CHANGE COLUMN a a 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 a TINYINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a SMALLINT);
......@@ -73,8 +92,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 t CHANGE COLUMN a a 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 +107,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 t CHANGE COLUMN a a 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 +122,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 t CHANGE COLUMN a a 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 +137,25 @@ 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 t CHANGE COLUMN a a 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 a 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 a SMALLINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a MEDIUMINT);
......@@ -137,8 +164,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 t CHANGE COLUMN a a 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 +179,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 t CHANGE COLUMN a a 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 +194,31 @@ 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 t CHANGE COLUMN a a 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 a 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 a 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 a MEDIUMINT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a INT);
......@@ -199,8 +226,13 @@ 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 t CHANGE COLUMN a a 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 +240,37 @@ 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 t CHANGE COLUMN a a 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 a 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 a 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 a 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 a INT;
SELECT * FROM t;
DROP TABLE t;
CREATE TABLE t (a BIGINT);
......@@ -261,6 +278,11 @@ 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 t CHANGE COLUMN a a BIGINT;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
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;
......@@ -9,218 +9,253 @@ 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;
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 t CHANGE COLUMN a a SMALLINT UNSIGNED;
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 t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
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 t CHANGE COLUMN a a INT UNSIGNED;
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 t CHANGE COLUMN a a BIGINT UNSIGNED;
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 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 a 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 );
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;
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 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;
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 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;
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 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;
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 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 a 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 a 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 );
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;
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 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;
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 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;
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 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 a 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 a 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 a 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 );
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;
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 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;
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 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 a 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 a 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 a 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 a 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 );
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;
SELECT * FROM t;
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE ti;
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