summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-01-03 00:36:16 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-01-03 00:36:16 +0000
commit1c49a556509ee1ae7047b8095434fb19401dc06c (patch)
tree2d8233f2cc1268a45ab1ab4d7ca6f8ee7d03b496 /lib/sqlalchemy/databases/mysql.py
parentad7938a8e0c2b0d57954b7d5ec1e0b2ad9552625 (diff)
downloadsqlalchemy-1c49a556509ee1ae7047b8095434fb19401dc06c.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py9
1 files changed, 8 insertions, 1 deletions
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,
}