mariadb/mysql-test/suite/tokudb.change_column/t/change_char_binary.py
Rich Prohaska 074875a160 refs #5333 test multiple int expansions
git-svn-id: file:///svn/mysql/tests/mysql-test@47646 c7de825b-a66e-492c-adef-691d508d4ae1
2012-09-10 21:05:22 +00:00

37 lines
1.3 KiB
Python

#!/usr/bin/env python
# test that char(X) <-> binary(X) is not hot
import sys
def gen_test(n):
print "CREATE TABLE t (a CHAR(%d));" % (n)
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a BINARY(%d);" % (n)
if n+1 < 256:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a CHAR(%d) BINARY;" % (n+1)
print "DROP TABLE t;"
print "CREATE TABLE t (a BINARY(%d));" % (n)
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a CHAR(%d);" % (n)
if n+1 < 256:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
print "--error ER_UNSUPPORTED_EXTENSION"
print "ALTER TABLE t CHANGE COLUMN a a CHAR(%d);" % (n+1)
print "DROP TABLE t;"
def main():
print "# this test is generated by change_char_binary.py"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t,tt;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;"
for n in range(0,256):
gen_test(n)
return 0
sys.exit(main())