summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2007-08-09 19:03:42 +0000
committerJason Kirtland <jek@discorporate.us>2007-08-09 19:03:42 +0000
commitbdd780dd88950106df09f81e539067f3bd98a06c (patch)
treeb8a0b3bfbd1754dbf08ad965ceeb69308cf051a4 /lib/sqlalchemy/databases/mysql.py
parent7c9d8d81aee73444f0ec17c4a24c616c133bd573 (diff)
downloadsqlalchemy-bdd780dd88950106df09f81e539067f3bd98a06c.tar.gz
restore clipping value for YEAR DDL
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py9
1 files changed, 7 insertions, 2 deletions
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"""