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 DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
255
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
255
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
255
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
255
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
255
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
65535
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
65535
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
65535
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
65535
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
65535
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
16777215
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
16777215
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 ); 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; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
16777215
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 ); 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; ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
16777215
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 ); 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; ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
16777215
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
4294967295
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
4294967295
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
4294967295
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 ); 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; ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
4294967295
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 ); 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; ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
4294967295
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
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
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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; ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
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
SELECT * FROM t;
a
0
1
18446744073709551615
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 ); 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; ALTER TABLE t CHANGE COLUMN a a BIGINT UNSIGNED;
SELECT * FROM t; include/diff_tables.inc [test.t, test.ti]
a DROP TABLE ti;
0
1
18446744073709551615
DROP TABLE t; DROP TABLE t;
#!/usr/bin/env python #!/usr/bin/env python
# generate alter table test cases for integer types # generate alter table test cases for char types
import sys import sys
def gen_test(n): def gen_test(n):
print "CREATE TABLE t (a BINARY(%d));" % (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) print "INSERT INTO t VALUES (%d);" % (v)
for i in range(2,256): for i in range(2,256):
if i < n: if i < n:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION" print "--error ER_UNSUPPORTED_EXTENSION"
else: else:
print "CREATE TABLE tt LIKE t;" print "CREATE TABLE ti LIKE t;"
print "INSERT INTO tt SELECT * FROM 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) print "ALTER TABLE t CHANGE COLUMN a a BINARY(%d);" % (i)
if i >= n: if i >= n:
print "SELECT HEX(t.a),HEX(tt.a) FROM t,tt where t.a = tt.a;" print "let $diff_tables=test.t, test.ti;"
print "DROP TABLE tt;" print "source include/diff_tables.inc;"
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 "# this test is generated by change_bin.py"
print "--disable_warnings" print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;" print "DROP TABLE IF EXISTS t,ti;"
print "--enable_warnings" print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";" print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;" print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
......
#!/usr/bin/env python #!/usr/bin/env python
# generate alter table test cases for integer types # generate alter table test cases for char types
import sys import sys
def gen_test(n): def gen_test(n):
...@@ -12,18 +12,21 @@ def gen_test(n): ...@@ -12,18 +12,21 @@ def gen_test(n):
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION" print "--error ER_UNSUPPORTED_EXTENSION"
else: else:
print "CREATE TABLE tt LIKE t;" print "CREATE TABLE ti LIKE t;"
print "INSERT INTO tt SELECT * FROM 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) print "ALTER TABLE t CHANGE COLUMN a a CHAR(%d);" % (i)
if i >= n: if i >= n:
print "SELECT * FROM t,tt where t.a = tt.a;" print "let $diff_tables=test.t, test.ti;"
print "DROP TABLE tt;" print "source include/diff_tables.inc;"
print "DROP TABLE ti;"
print "DROP TABLE t;" print "DROP TABLE t;"
def main(): def main():
print "# this test is generated by change_char.py" print "# this test is generated by change_char.py"
print "--disable_warnings" print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;" print "DROP TABLE IF EXISTS t,ti;"
print "--enable_warnings" print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";" print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;" print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
......
...@@ -12,19 +12,21 @@ def gen_test(n): ...@@ -12,19 +12,21 @@ def gen_test(n):
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION" print "--error ER_UNSUPPORTED_EXTENSION"
else: else:
print "CREATE TABLE tt LIKE t;" print "CREATE TABLE ti LIKE t;"
print "INSERT INTO tt SELECT * FROM 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) print "ALTER TABLE t CHANGE COLUMN a b CHAR(%d);" % (i)
if i >= n: if i >= n:
print "ALTER TABLE t CHANGE COLUMN b a CHAR(%d);" % (i) print "ALTER TABLE t CHANGE COLUMN b a CHAR(%d);" % (i)
print "SELECT * FROM t,tt where t.a = tt.a;" print "let $diff_tables=test.t, test.ti;"
print "DROP TABLE tt;" print "source include/diff_tables.inc;"
print "DROP TABLE ti;"
print "DROP TABLE t;" print "DROP TABLE t;"
def main(): def main():
print "# this test is generated by change_char_rename.py" print "# this test is generated by change_char_rename.py"
print "--disable_warnings" print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;" print "DROP TABLE IF EXISTS t,ti;"
print "--enable_warnings" print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";" print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;" print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
......
...@@ -6,7 +6,7 @@ import sys ...@@ -6,7 +6,7 @@ import sys
def gen_test(types, values): def gen_test(types, values):
print "# this test is generated by change_int.py" print "# this test is generated by change_int.py"
print "--disable_warnings" print "--disable_warnings"
print "DROP TABLE IF EXISTS t;" print "DROP TABLE IF EXISTS t, ti;"
print "--enable_warnings" print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";" print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;" print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
...@@ -14,13 +14,22 @@ def gen_test(types, values): ...@@ -14,13 +14,22 @@ def gen_test(types, values):
for b in range(len(types)): for b in range(len(types)):
print print
print "CREATE TABLE t (a %s);" % (types[a]) print "CREATE TABLE t (a %s);" % (types[a])
for x in values[a]:
print "INSERT INTO t VALUES (", x, ");"
if a > b: if a > b:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION" 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 "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;" print "DROP TABLE t;"
def main(): def main():
gen_test( gen_test(
......
# this test is generated by change_int.py # this test is generated by change_int.py
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t, ti;
--enable_warnings --enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB"; SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
...@@ -11,8 +11,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -11,8 +11,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT); CREATE TABLE t (a TINYINT);
...@@ -21,8 +26,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -21,8 +26,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT); CREATE TABLE t (a TINYINT);
...@@ -31,8 +41,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -31,8 +41,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT); CREATE TABLE t (a TINYINT);
...@@ -41,8 +56,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -41,8 +56,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT); CREATE TABLE t (a TINYINT);
...@@ -51,20 +71,19 @@ INSERT INTO t VALUES ( -1 ); ...@@ -51,20 +71,19 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 127 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT; ALTER TABLE t CHANGE COLUMN a a TINYINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT); CREATE TABLE t (a SMALLINT);
...@@ -73,8 +92,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -73,8 +92,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT); CREATE TABLE t (a SMALLINT);
...@@ -83,8 +107,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -83,8 +107,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT); CREATE TABLE t (a SMALLINT);
...@@ -93,8 +122,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -93,8 +122,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT); CREATE TABLE t (a SMALLINT);
...@@ -103,32 +137,25 @@ INSERT INTO t VALUES ( -1 ); ...@@ -103,32 +137,25 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 32767 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT; ALTER TABLE t CHANGE COLUMN a a TINYINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT; ALTER TABLE t CHANGE COLUMN a a SMALLINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT); CREATE TABLE t (a MEDIUMINT);
...@@ -137,8 +164,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -137,8 +164,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT); CREATE TABLE t (a MEDIUMINT);
...@@ -147,8 +179,13 @@ INSERT INTO t VALUES ( -1 ); ...@@ -147,8 +179,13 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT); CREATE TABLE t (a MEDIUMINT);
...@@ -157,41 +194,31 @@ INSERT INTO t VALUES ( -1 ); ...@@ -157,41 +194,31 @@ INSERT INTO t VALUES ( -1 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 8388607 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a INT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT; ALTER TABLE t CHANGE COLUMN a a TINYINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT; ALTER TABLE t CHANGE COLUMN a a SMALLINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT); CREATE TABLE t (a INT);
...@@ -199,8 +226,13 @@ INSERT INTO t VALUES ( -2147483648 ); ...@@ -199,8 +226,13 @@ INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a INT); CREATE TABLE t (a INT);
...@@ -208,52 +240,37 @@ INSERT INTO t VALUES ( -2147483648 ); ...@@ -208,52 +240,37 @@ INSERT INTO t VALUES ( -2147483648 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 2147483647 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a BIGINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT; ALTER TABLE t CHANGE COLUMN a a TINYINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT; ALTER TABLE t CHANGE COLUMN a a SMALLINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT; ALTER TABLE t CHANGE COLUMN a a INT;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT); CREATE TABLE t (a BIGINT);
...@@ -261,6 +278,11 @@ INSERT INTO t VALUES ( -9223372036854775808 ); ...@@ -261,6 +278,11 @@ INSERT INTO t VALUES ( -9223372036854775808 );
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 9223372036854775807 ); 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; 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; DROP TABLE t;
# this test is generated by change_int.py # this test is generated by change_int.py
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t, ti;
--enable_warnings --enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB"; SET SESSION DEFAULT_STORAGE_ENGINE="TokuDB";
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
...@@ -9,218 +9,253 @@ CREATE TABLE t (a TINYINT UNSIGNED); ...@@ -9,218 +9,253 @@ CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a TINYINT UNSIGNED); CREATE TABLE t (a TINYINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 255 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a SMALLINT UNSIGNED); CREATE TABLE t (a SMALLINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 65535 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a MEDIUMINT UNSIGNED); CREATE TABLE t (a MEDIUMINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 16777215 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a INT UNSIGNED); CREATE TABLE t (a INT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 4294967295 ); 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; 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; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a TINYINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a SMALLINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a MEDIUMINT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); 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/ --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION --error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED; ALTER TABLE t CHANGE COLUMN a a INT UNSIGNED;
SELECT * FROM t;
DROP TABLE t; DROP TABLE t;
CREATE TABLE t (a BIGINT UNSIGNED); CREATE TABLE t (a BIGINT UNSIGNED);
INSERT INTO t VALUES ( 0 ); INSERT INTO t VALUES ( 0 );
INSERT INTO t VALUES ( 1 ); INSERT INTO t VALUES ( 1 );
INSERT INTO t VALUES ( 18446744073709551615 ); 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; 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; 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