From 1c49a556509ee1ae7047b8095434fb19401dc06c Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 3 Jan 2006 00:36:16 +0000 Subject: type objects pass engine around to get a hold of DBAPI type objects added dbapi.Binary creation to base BinaryType fixed MySQL binary type adjustment to Join._match_primaries to work better with self-referential table --- lib/sqlalchemy/databases/mysql.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 21dbc2c17..2bda525b5 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -42,7 +42,12 @@ class MSChar(sqltypes.CHAR): return "CHAR(%(length)s)" % {'length' : self.length} class MSBinary(sqltypes.Binary): def get_col_spec(self): - return "BINARY" + if self.length is not None and self.length <=255: + # the binary type seems to return a value that is null-padded + return "BINARY(%d)" % self.length + else: + return "BLOB" + class MSBoolean(sqltypes.Boolean): def get_col_spec(self): return "BOOLEAN" @@ -67,7 +72,9 @@ ischema_names = { 'decimal' : MSNumeric, 'float' : MSFloat, 'timestamp' : MSDateTime, + 'datetime' : MSDateTime, 'binary' : MSBinary, + 'blob' : MSBinary, } -- cgit v1.2.1