From 07181033700fd1e52efc017a0dd9c45eb23e95d7 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Fri, 7 Sep 2007 17:58:47 +0000 Subject: Fixed repr() of mysql floats [ticket:775] Added repr testing to mysql dialect --- lib/sqlalchemy/databases/mysql.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 8bbe8b683..9eba2abdb 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -403,16 +403,15 @@ class MSFloat(sqltypes.Float, _NumericType): underlying database API, which continue to be numeric. """ - if length is not None: - self.length=length + self.length = length _NumericType.__init__(self, **kw) sqltypes.Float.__init__(self, precision, asdecimal=asdecimal) def get_col_spec(self): if hasattr(self, 'length') and self.length is not None: - return self._extend("FLOAT(%(precision)s, %(length)s)" % {'precision': self.precision, 'length' : self.length}) + return self._extend("FLOAT(%s, %s)" % (self.precision, self.length)) elif self.precision is not None: - return self._extend("FLOAT(%(precision)s)" % {'precision': self.precision}) + return self._extend("FLOAT(%s)" % (self.precision,)) else: return self._extend("FLOAT") -- cgit v1.2.1