From f96a514f4321782dee41c3a4f6f6c43e4d9c12e0 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Sun, 18 Nov 2007 20:44:20 +0000 Subject: Tests for mysql casts and a couple adjustments. --- lib/sqlalchemy/databases/mysql.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 441c099a2..39bfc0bea 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -565,7 +565,7 @@ class MSTinyInteger(MSInteger): return self._extend("TINYINT") -class MSSmallInteger(sqltypes.Smallinteger, _NumericType): +class MSSmallInteger(sqltypes.Smallinteger, MSInteger): """MySQL SMALLINTEGER type.""" def __init__(self, length=None, **kw): @@ -585,7 +585,7 @@ class MSSmallInteger(sqltypes.Smallinteger, _NumericType): self.length = length _NumericType.__init__(self, **kw) - sqltypes.Smallinteger.__init__(self, length) + sqltypes.SmallInteger.__init__(self, length) def get_col_spec(self): if self.length is not None: @@ -1846,12 +1846,12 @@ class MySQLCompiler(compiler.DefaultCompiler): return 'UNSIGNED INTEGER' else: return 'SIGNED INTEGER' - elif isinstance(type_, (MSChar, MSDecimal, MSDateTime, - MSDate, MSTime)): + elif isinstance(type_, (MSDecimal, MSDateTime, MSDate, MSTime)): return type_.get_col_spec() - elif isinstance(type_, (MSText, MSNChar, MSNVarChar)): + elif isinstance(type_, MSText): return 'CHAR' - elif type(type_) is MSString: + elif (isinstance(type_, _StringType) and not + isinstance(type_, (MSEnum, MSSet))): if getattr(type_, 'length'): return 'CHAR(%s)' % type_.length else: -- cgit v1.2.1