Commit e5c67b3e authored by Rich Prohaska's avatar Rich Prohaska

refs #5334 add tests for int expansion that is not supported inplace

git-svn-id: file:///svn/mysql/tests/mysql-test@47626 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3a2f814e
= Hot column change operations =
* varchar(X) -> varchar(Y) for all 0 <= X <= Y < 64K
* varchar(X) not null -> varchar(Y) not null for all 0 <= X <= Y < 64K
* varbinary(X) -> varbinary(Y) for all 0 <= X <= Y < 64K
* varbinary(X) not null -> varbinary(Y) not null for all 0 <= X <= Y < 64K
* tinyint -> smallint -> mediumint -> int -> bigint
* tinyint unsigned -> smallint unsigned-> mediumint unsigned -> int unsigned -> bigint unsigned
* tinyint not null -> smallint not null -> mediumint not null -> int not null -> bitint not null
* tinyint unsigned not null -> smallint unsigned not null -> mediumint unsigned not null -> int unsigned not null -> bitint unsigned not null
* char(X) -> char(Y) for all 0 <= X <= Y < 256
* char(X) not null -> char(Y) not null for all 0 <= X <= Y < 256
* binary(X) -> binary(Y) for all 0 <= X <= Y < 256
* binary(X) not null -> binary(Y) not null for all 0 <= X <= Y < 256
= Changes to the row value =
* Variable length offsets expand from 1 to 2 bytes
* Fixed field value is expanded
* Sign bit for signed integers is expanded
* Pad for fixed char fields is a space
* Pad for fixed binary fields is a zero
= Restrictions =
* Changed field is not part of any key
= Tests =
......@@ -21,7 +21,7 @@ def gen_test(n):
print "DROP TABLE t;"
def main():
print "# this test is generated by change_int.py"
print "# this test is generated by change_char.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;"
print "--enable_warnings"
......
# this test is generated by change_int.py
# this test is generated by change_char.py
--disable_warnings
DROP TABLE IF EXISTS t,tt;
--enable_warnings
......
#!/usr/bin/env python
import sys
def supported(from_int, from_modifier, to_int, to_modifer):
if from_modifier != to_modifer:
return False
if from_int > to_int:
return False
return True
def gen_tests_for_int(from_int, from_modifier, int_types, modifiers):
for to_int in range(len(int_types)):
for to_modifer in range(len(modifiers)):
print
print "CREATE TABLE t (a %s %s);" % (int_types[from_int], modifiers[from_modifier])
if not supported(from_int, from_modifier, to_int, to_modifer):
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a %s %s;" % (int_types[to_int], modifiers[to_modifer])
print "DROP TABLE t;"
def gen_tests(int_types, modifiers):
for from_int in range(len(int_types)):
for from_modifier in range(len(modifiers)):
gen_tests_for_int(from_int, from_modifier, int_types, modifiers)
def main():
print "# this test is generated by change_int_null.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
gen_tests(
[ "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT" ],
[ "", "NOT NULL", "UNSIGNED", "UNSIGNED NOT NULL" ]
)
return 0
sys.exit(main())
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