summaryrefslogtreecommitdiff
path: root/test/dialect/mysql.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2007-05-31 22:56:24 +0000
committerJason Kirtland <jek@discorporate.us>2007-05-31 22:56:24 +0000
commit0a713f408d2eded6856c7502b2950792ab460a91 (patch)
tree3a66152f665c1ea8dfc7f6c62dae0ffcfbc8e1e0 /test/dialect/mysql.py
parent1aa8b0eea743b88fb4649a0b476de75f1d091f8f (diff)
downloadsqlalchemy-0a713f408d2eded6856c7502b2950792ab460a91.tar.gz
- Emit BOOL rather than BOOLEAN for MySQL booleans in DDL, for old versions
of MySQL (#583) - MySQL columns (such as times) with colons in their default values couldn't be roundtripped, fixed (also in Postgres, but not fixed here.) - BINARY/VARBINARY columns aren't really binary at all on ancient versions of MySQL. The type.Binary(123) passthrough now always makes BLOBs. Removed the short-lived MSBaseBinary. - Added mysql.get_version_info, given a connectable returns a tuple of server version info. - Backed off on the reflection tests for older versions of MySQL, for now.
Diffstat (limited to 'test/dialect/mysql.py')
-rw-r--r--test/dialect/mysql.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py
index 75c8c0166..4972c8e24 100644
--- a/test/dialect/mysql.py
+++ b/test/dialect/mysql.py
@@ -294,6 +294,10 @@ class TypesTest(AssertMixin):
@testbase.supported('mysql')
def test_type_reflection(self):
+ # FIXME: older versions need their own test
+ if db.dialect.get_version_info(db) < (5, 0):
+ return
+
# (ask_for, roundtripped_as_if_different)
specs = [( String(), mysql.MSText(), ),
( String(1), mysql.MSString(1), ),
@@ -307,11 +311,9 @@ class TypesTest(AssertMixin):
( Smallinteger(4), mysql.MSSmallInteger(4), ),
( mysql.MSSmallInteger(), ),
( mysql.MSSmallInteger(4), mysql.MSSmallInteger(4), ),
- ( Binary(3), mysql.MSVarBinary(3), ),
+ ( Binary(3), mysql.MSBlob(3), ),
( Binary(), mysql.MSBlob() ),
( mysql.MSBinary(3), mysql.MSBinary(3), ),
- ( mysql.MSBaseBinary(), mysql.MSBlob(), ),
- ( mysql.MSBaseBinary(3), mysql.MSVarBinary(3), ),
( mysql.MSVarBinary(3),),
( mysql.MSVarBinary(), mysql.MSBlob()),
( mysql.MSTinyBlob(),),
@@ -331,13 +333,14 @@ class TypesTest(AssertMixin):
m2 = BoundMetaData(db)
rt = Table('mysql_types', m2, autoload=True)
+ #print
expected = [len(c) > 1 and c[1] or c[0] for c in specs]
for i, reflected in enumerate(rt.c):
#print (reflected, specs[i][0], '->',
# reflected.type, '==', expected[i])
- assert type(reflected.type) == type(expected[i])
+ assert isinstance(reflected.type, type(expected[i]))
- #m.drop_all()
+ m.drop_all()
if __name__ == "__main__":
testbase.main()