From: Mike Bayer Date: Mon, 3 Oct 2011 19:24:26 +0000 (-0400) Subject: undo that change with the _, it doesn't break round trips X-Git-Tag: rel_0_7_3~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=539c7a1ca26d4338f2cec326dad7a17a2f0ac267;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git undo that change with the _, it doesn't break round trips --- diff --git a/CHANGES b/CHANGES index 3377cf383b..0760031f9d 100644 --- a/CHANGES +++ b/CHANGES @@ -240,14 +240,7 @@ CHANGES - 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. + work or not. [ticket:2225] Also in 0.6.9. - mssql - Changes to attempt support of FreeTDS 0.91 with diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 1d7d898496..80067f9dcc 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2262,7 +2262,7 @@ class MySQLTableDefinitionParser(object): options.pop(nope, None) for opt, val in options.items(): - state.table_options['%s_%s' % (self.dialect.name, opt.replace(' ', '_'))] = val + state.table_options['%s_%s' % (self.dialect.name, opt)] = val def _parse_column(self, line, state): """Extract column details. diff --git a/test/dialect/test_mysql.py b/test/dialect/test_mysql.py index b8bcd573d4..433c3eded0 100644 --- a/test/dialect/test_mysql.py +++ b/test/dialect/test_mysql.py @@ -343,9 +343,7 @@ class TypesTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL): 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') + 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 ?') @@ -894,7 +892,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'