From bdd780dd88950106df09f81e539067f3bd98a06c Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Thu, 9 Aug 2007 19:03:42 +0000 Subject: restore clipping value for YEAR DDL --- lib/sqlalchemy/databases/mysql.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 139328039..766748c62 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -551,9 +551,14 @@ class MSTimeStamp(sqltypes.TIMESTAMP): class MSYear(sqltypes.TypeEngine): """MySQL YEAR type, for single byte storage of years 1901-2155""" - def get_col_spec(self): - return "YEAR" + def __init__(self, length=None): + self.length = length + def get_col_spec(self): + if self.length is None: + return "YEAR" + else: + return "YEAR(%s)" % self.length class MSText(_StringType, sqltypes.TEXT): """MySQL TEXT type, for text up to 2^16 characters""" -- cgit v1.2.1