diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-10-03 15:19:07 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-10-03 15:19:07 -0400 |
commit | a9ebba3e1b135f1b5ac612844dce1e34e4d0eeee (patch) | |
tree | 58e531203d593b809528db53ce362c78862b8430 /test/dialect/test_mysql.py | |
parent | bf2f3595d07002d56c77b329387932d4d27e3c45 (diff) | |
download | sqlalchemy-a9ebba3e1b135f1b5ac612844dce1e34e4d0eeee.tar.gz |
- a CREATE TABLE will put the COLLATE option
after CHARSET, which appears to be part of
MySQL's arbitrary rules regarding if it will actually
work or not. [ticket:2225]
- reflecting a MySQL table will ensure that the
options added to the Table at the table.kwargs
level have spaces converted to underscores.
This is a slight behavioral change specifically
to the "mysql_default_charset" option which
previously would not be symmetrical.
Diffstat (limited to 'test/dialect/test_mysql.py')
-rw-r--r-- | test/dialect/test_mysql.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py index fb20f44fd..b8bcd573d 100644 --- a/test/dialect/test_mysql.py +++ b/test/dialect/test_mysql.py @@ -332,6 +332,22 @@ class TypesTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL): charset_table.drop() @testing.exclude('mysql', '<', (5, 0, 5), 'a 5.0+ feature') + @testing.provide_metadata + def test_charset_collate_table(self): + t = Table('foo', self.metadata, + Column('id', Integer), + mysql_default_charset='utf8', + mysql_collate='utf8_unicode_ci' + ) + t.create() + m2 = MetaData(testing.db) + t2 = Table('foo', m2, autoload=True) + eq_(t2.kwargs['mysql_collate'], 'utf8_unicode_ci') + # this is also testing that the names coming + # back get an underscore _ in them + eq_(t2.kwargs['mysql_default_charset'], 'utf8') + + @testing.exclude('mysql', '<', (5, 0, 5), 'a 5.0+ feature') @testing.fails_on('mysql+oursql', 'some round trips fail, oursql bug ?') def test_bit_50(self): """Exercise BIT types on 5.0+ (not valid for all engine types)""" @@ -878,7 +894,7 @@ class ReflectionTest(fixtures.TestBase, AssertsExecutionResults): assert reflected.kwargs['mysql_engine'] == 'MEMORY' assert reflected.kwargs['mysql_comment'] == comment - assert reflected.kwargs['mysql_default charset'] == 'utf8' + assert reflected.kwargs['mysql_default_charset'] == 'utf8' assert reflected.kwargs['mysql_avg_row_length'] == '3' assert reflected.kwargs['mysql_connection'] == 'fish' |