mariadb/mysql-test/suite/tokudb/t/change_column_blob.py
Rich Prohaska f66e34d0d7 refs #6440 move change column tests
git-svn-id: file:///svn/mysql/tests/mysql-test@55031 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-03 16:49:00 +00:00

27 lines
1.4 KiB
Python

import sys
def main():
print "# this test is generated by change_blob.py"
print "# generate hot blob expansion test cases"
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([ "TINY", "", "MEDIUM", "LONG" ], [ "NULL", "NOT NULL"])
return 0
def gen_tests(base_types, null_types):
for from_index in range(len(base_types)):
for to_index in range(len(base_types)):
for from_null in range(len(null_types)):
for to_null in range(len(null_types)):
print "CREATE TABLE t (a %sBLOB %s);" % (base_types[from_index], null_types[from_null])
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a %sTEXT %s;" % (base_types[to_index], null_types[to_null]);
if from_null != to_null or from_index > to_index:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a %sBLOB %s;" % (base_types[to_index], null_types[to_null]);
print "DROP TABLE t;"
sys.exit(main())