Mysql no longer expects include_columns to be specified in lowercase. Fixes #1206.

This commit is contained in:
Michael Trier
2008-10-28 16:48:13 +00:00
parent c9591657dd
commit d4dcb2e217
3 changed files with 27 additions and 1 deletions
+3
View File
@@ -77,6 +77,9 @@ CHANGES
explicit schema= is the same as the schema (database) the
connection is attached to.
- No longer expects include_columns in table reflection to be
lower case.
0.5.0rc2
========
- orm
+1 -1
View File
@@ -2216,7 +2216,7 @@ class MySQLSchemaReflector(object):
name, type_, args, notnull = \
spec['name'], spec['coltype'], spec['arg'], spec['notnull']
if only and name.lower() not in only:
if only and name not in only:
self.logger.info("Omitting reflected column %s.%s" %
(table.name, name))
return
+23
View File
@@ -656,6 +656,29 @@ class TypesTest(TestBase, AssertsExecutionResults):
finally:
def_table.drop()
def test_reflection_on_include_columns(self):
"""Test reflection of include_columns to be sure they respect case."""
case_table = Table('mysql_case', MetaData(testing.db),
Column('c1', String(10)),
Column('C2', String(10)),
Column('C3', String(10)))
try:
case_table.create()
reflected = Table('mysql_case', MetaData(testing.db),
autoload=True, include_columns=['c1', 'C2'])
for t in case_table, reflected:
assert 'c1' in t.c.keys()
assert 'C2' in t.c.keys()
reflected2 = Table('mysql_case', MetaData(testing.db),
autoload=True, include_columns=['c1', 'c2'])
assert 'c1' in reflected2.c.keys()
for c in ['c2', 'C2', 'C3']:
assert c not in reflected2.c.keys()
finally:
case_table.drop()
@testing.exclude('mysql', '<', (5, 0, 0), 'early types are squirrely')
@testing.uses_deprecated('Using String type with no length')
def test_type_reflection(self):