summaryrefslogtreecommitdiff
path: root/test/dialect/mysql.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-01-08 07:46:37 +0000
committerJason Kirtland <jek@discorporate.us>2008-01-08 07:46:37 +0000
commitc111f6f93dadb0376aa855583d330dce7b8715ca (patch)
treee4b71d379ef8c150d2efacd716bc3ab7c38acc85 /test/dialect/mysql.py
parent2fc1bf26159b722a525ffb3de7afe96f4e5f95fd (diff)
downloadsqlalchemy-c111f6f93dadb0376aa855583d330dce7b8715ca.tar.gz
Fixed reflection of mysql empty string column defaults.
Diffstat (limited to 'test/dialect/mysql.py')
-rw-r--r--test/dialect/mysql.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py
index 11c721e1d..5f5c4a750 100644
--- a/test/dialect/mysql.py
+++ b/test/dialect/mysql.py
@@ -585,7 +585,6 @@ class TypesTest(AssertMixin):
# MySQL 3.23 can't handle an ENUM of ''....
- db = testbase.db
enum_table = Table('mysql_enum', MetaData(testbase.db),
Column('e1', mysql.MSEnum("'a'")),
Column('e2', mysql.MSEnum("''")),
@@ -608,6 +607,25 @@ class TypesTest(AssertMixin):
finally:
enum_table.drop()
+ def test_default_reflection(self):
+ """Test reflection of column defaults."""
+
+ def_table = Table('mysql_def', MetaData(testbase.db),
+ Column('c1', String(10), PassiveDefault('')),
+ Column('c2', String(10), PassiveDefault('0')),
+ Column('c3', String(10), PassiveDefault('abc')))
+
+ try:
+ def_table.create()
+ reflected = Table('mysql_def', MetaData(testbase.db),
+ autoload=True)
+ for t in def_table, reflected:
+ assert t.c.c1.default.arg == ''
+ assert t.c.c2.default.arg == '0'
+ assert t.c.c3.default.arg == 'abc'
+ finally:
+ def_table.drop()
+
@testing.exclude('mysql', '<', (5, 0, 0))
def test_type_reflection(self):
# (ask_for, roundtripped_as_if_different)