Commit 2a8837b0 authored by Rich Prohaska's avatar Rich Prohaska

refs #5513 disable column rename from hot column expansion tests on the mainline

git-svn-id: file:///svn/mysql/tests/mysql-test@48104 c7de825b-a66e-492c-adef-691d508d4ae1
parent ae369e2a
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
CREATE TABLE t (a VARBINARY(100), b VARBINARY(256)) ENGINE=TokuDB; SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARBINARY(100), b VARBINARY(256));
ALTER TABLE t CHANGE COLUMN a aa VARBINARY(1); ALTER TABLE t CHANGE COLUMN a aa VARBINARY(1);
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
ALTER TABLE t CHANGE COLUMN a aa VARBINARY(255); ALTER TABLE t CHANGE COLUMN a aa VARBINARY(256);
ALTER TABLE t CHANGE COLUMN aa a VARBINARY(255); ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
ALTER TABLE t CHANGE COLUMN a aa VARBINARY(100);
ALTER TABLE t CHANGE COLUMN b bb VARBINARY(255); ALTER TABLE t CHANGE COLUMN b bb VARBINARY(255);
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
ALTER TABLE t CHANGE COLUMN b bb VARBINARY(1024); ALTER TABLE t CHANGE COLUMN b bb VARBINARY(1024);
ALTER TABLE t CHANGE COLUMN bb b VARBINARY(1024);
ALTER TABLE t CHANGE COLUMN b bb VARBINARY(256);
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
ALTER TABLE t CHANGE COLUMN b bb VARBINARY(256);
DROP TABLE t; DROP TABLE t;
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
CREATE TABLE t (a VARCHAR(100), b VARCHAR(256)) ENGINE=TokuDB; SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARCHAR(100), b VARCHAR(256));
ALTER TABLE t CHANGE COLUMN a aa VARCHAR(1); ALTER TABLE t CHANGE COLUMN a aa VARCHAR(1);
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
ALTER TABLE t CHANGE COLUMN a aa VARCHAR(255); ALTER TABLE t CHANGE COLUMN a aa VARCHAR(256);
ALTER TABLE t CHANGE COLUMN aa a VARCHAR(255); ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
ALTER TABLE t CHANGE COLUMN a aa VARCHAR(100);
ALTER TABLE t CHANGE COLUMN b bb VARCHAR(255); ALTER TABLE t CHANGE COLUMN b bb VARCHAR(255);
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
ALTER TABLE t CHANGE COLUMN b bb VARCHAR(1024); ALTER TABLE t CHANGE COLUMN b bb VARCHAR(1024);
ALTER TABLE t CHANGE COLUMN bb b VARCHAR(1024);
ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256);
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
ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256);
DROP TABLE t; DROP TABLE t;
...@@ -8,8 +8,12 @@ default: $(T) ...@@ -8,8 +8,12 @@ default: $(T)
%.test: %.py %.test: %.py
python $< >$@ python $< >$@
change_all.test: change_all.py change_all.test: change_all.py change_all_1000_10.test change_all_1000_1.test change_all_10000_1.test
true
change_all_1000_10.test: change_all.py
python change_all.py --experiments=1000 --nrows=10 >change_all_1000_10.test python change_all.py --experiments=1000 --nrows=10 >change_all_1000_10.test
change_all_1000_1.test: change_all.py
python change_all.py --experiments=1000 --nrows=1 >change_all_1000_1.test python change_all.py --experiments=1000 --nrows=1 >change_all_1000_1.test
change_all_10000_1.test: change_all.py
python change_all.py --experiments=10000 --nrows=1 >change_all_10000_1.test python change_all.py --experiments=10000 --nrows=1 >change_all_10000_1.test
...@@ -6,7 +6,7 @@ def gen_test(n): ...@@ -6,7 +6,7 @@ def gen_test(n):
for v in [ 'hi', 'there', 'people' ]: for v in [ 'hi', 'there', 'people' ]:
print "INSERT INTO t VALUES ('%s');" % (v) print "INSERT INTO t VALUES ('%s');" % (v)
for i in range(2,256): for i in range(2,256):
if i < n: if 1: # 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:
...@@ -16,7 +16,7 @@ def gen_test(n): ...@@ -16,7 +16,7 @@ def gen_test(n):
print "ALTER TABLE ti CHANGE COLUMN a b BINARY(%d);" % (i) print "ALTER TABLE ti CHANGE COLUMN a b BINARY(%d);" % (i)
print "ALTER TABLE ti CHANGE COLUMN b a BINARY(%d);" % (i) print "ALTER TABLE ti CHANGE COLUMN b a BINARY(%d);" % (i)
print "ALTER TABLE t CHANGE COLUMN a b BINARY(%d);" % (i) print "ALTER TABLE t CHANGE COLUMN a b BINARY(%d);" % (i)
if i < n: if 1: # if i < n:
pass pass
else: else:
print "ALTER TABLE t CHANGE COLUMN b a BINARY(%d);" % (i) print "ALTER TABLE t CHANGE COLUMN b a BINARY(%d);" % (i)
...@@ -27,7 +27,7 @@ def gen_test(n): ...@@ -27,7 +27,7 @@ def gen_test(n):
def main(): def main():
print "# this test is generated by change_bin_rename.py" print "# this test is generated by change_bin_rename.py"
print "# test that binary expansion + rename is hot" print "# test char expansion + rename is hot"
print "--disable_warnings" print "--disable_warnings"
print "DROP TABLE IF EXISTS t,ti;" print "DROP TABLE IF EXISTS t,ti;"
print "--enable_warnings" print "--enable_warnings"
......
...@@ -6,7 +6,7 @@ def gen_test(n): ...@@ -6,7 +6,7 @@ def gen_test(n):
for v in [ 'hi', 'there', 'people' ]: for v in [ 'hi', 'there', 'people' ]:
print "INSERT INTO t VALUES ('%s');" % (v) print "INSERT INTO t VALUES ('%s');" % (v)
for i in range(2,256): for i in range(2,256):
if i < n: 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:
...@@ -16,7 +16,7 @@ def gen_test(n): ...@@ -16,7 +16,7 @@ def gen_test(n):
print "ALTER TABLE ti CHANGE COLUMN a b CHAR(%d);" % (i) print "ALTER TABLE ti CHANGE COLUMN a b CHAR(%d);" % (i)
print "ALTER TABLE ti CHANGE COLUMN b a CHAR(%d);" % (i) print "ALTER TABLE ti CHANGE COLUMN b a CHAR(%d);" % (i)
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: # if i < n:
pass pass
else: else:
print "ALTER TABLE t CHANGE COLUMN b a CHAR(%d);" % (i) print "ALTER TABLE t CHANGE COLUMN b a CHAR(%d);" % (i)
......
#!/usr/bin/env python
import sys
def gen_test(types, values):
for a in range(len(types)):
for b in range(len(types)):
print
print "CREATE TABLE t (a %s);" % (types[a])
if a != b: # 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 ti CHANGE COLUMN a aa %s;" % (types[b])
print "ALTER TABLE t CHANGE COLUMN a aa %s;" % (types[b])
if a != b: # a > b:
pass
else:
print "ALTER TABLE t CHANGE COLUMN aa a %s;" % (types[b])
print "ALTER TABLE ti CHANGE COLUMN aa a %s;" % (types[b])
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_rename.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t, ti;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
gen_test(
[ "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT" ],
[ [ -128, -1, 0, 1, 127 ], [ -32768, -1, 0, 1, 32767], [-8388608, -1, 0, 1, 8388607], [-2147483648, 0, 1, 2147483647], [-9223372036854775808, 0, 1, 9223372036854775807] ]
)
gen_test(
[ "TINYINT UNSIGNED", "SMALLINT UNSIGNED", "MEDIUMINT UNSIGNED", "INT UNSIGNED", "BIGINT UNSIGNED" ],
[ [ 0, 1, 255 ], [ 0, 1, 65535], [0, 1, 16777215], [0, 1, 4294967295], [0, 1, 18446744073709551615] ]
)
return 0
sys.exit(main())
...@@ -5,34 +5,34 @@ DROP TABLE IF EXISTS t; ...@@ -5,34 +5,34 @@ DROP TABLE IF EXISTS t;
--enable_warnings --enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARBINARY(100), b VARBINARY(256)) ENGINE=TokuDB; CREATE TABLE t (a VARBINARY(100), b VARBINARY(256));
# varbinary shrink with column rename is not supported # varchar shrink with column rename is not supported
--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 aa VARBINARY(1); ALTER TABLE t CHANGE COLUMN a aa VARBINARY(1);
# varbinary expand with column rename is supported # varchar expand with column rename is not supported
ALTER TABLE t CHANGE COLUMN a aa VARBINARY(255); --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a aa VARBINARY(256);
# varbinary column rename is supported # varchar column rename is supported
ALTER TABLE t CHANGE COLUMN aa a VARBINARY(255); ALTER TABLE t CHANGE COLUMN a aa VARBINARY(100);
# varbinary shrink woth column rename is not supported # varchar shrink woth column rename is not supported
--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 b bb VARBINARY(255); ALTER TABLE t CHANGE COLUMN b bb VARBINARY(255);
# varbinary expand with column rename is supported # varchar expand with column rename is not supported
ALTER TABLE t CHANGE COLUMN b bb VARBINARY(1024);
# varbinary column rename is supported
ALTER TABLE t CHANGE COLUMN bb b VARBINARY(1024);
# varbinary shrink with column rename is not supported
--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 b bb VARBINARY(1024);
# varchar column rename is supported
ALTER TABLE t CHANGE COLUMN b bb VARBINARY(256); ALTER TABLE t CHANGE COLUMN b bb VARBINARY(256);
DROP TABLE t; DROP TABLE t;
\ No newline at end of file
...@@ -5,34 +5,34 @@ DROP TABLE IF EXISTS t; ...@@ -5,34 +5,34 @@ DROP TABLE IF EXISTS t;
--enable_warnings --enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON; SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARCHAR(100), b VARCHAR(256)) ENGINE=TokuDB; CREATE TABLE t (a VARCHAR(100), b VARCHAR(256));
# varchar shrink with column rename is not supported # varchar shrink with column rename is not supported
--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 aa VARCHAR(1); ALTER TABLE t CHANGE COLUMN a aa VARCHAR(1);
# varchar expand with column rename is supported # varchar expand with column rename is not supported
ALTER TABLE t CHANGE COLUMN a aa VARCHAR(255); --replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN a aa VARCHAR(256);
# varchar column rename is supported # varchar column rename is supported
ALTER TABLE t CHANGE COLUMN aa a VARCHAR(255); ALTER TABLE t CHANGE COLUMN a aa VARCHAR(100);
# varchar shrink woth column rename is not supported # varchar shrink woth column rename is not supported
--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 b bb VARCHAR(255); ALTER TABLE t CHANGE COLUMN b bb VARCHAR(255);
# varchar expand with column rename is supported # varchar expand with column rename is not supported
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN b bb VARCHAR(1024); ALTER TABLE t CHANGE COLUMN b bb VARCHAR(1024);
# varchar column rename is supported # varchar column rename is supported
ALTER TABLE t CHANGE COLUMN bb b VARCHAR(1024);
# varchar shrink with column rename is not supported
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
--error ER_UNSUPPORTED_EXTENSION
ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256); ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256);
DROP TABLE t; DROP TABLE t;
\ No newline at end of file
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