]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fixed a problem with the casting of a zero length type to a varchar. It now correctly...
authorMichael Trier <mtrier@gmail.com>
Fri, 14 Nov 2008 03:57:04 +0000 (03:57 +0000)
committerMichael Trier <mtrier@gmail.com>
Fri, 14 Nov 2008 03:57:04 +0000 (03:57 +0000)
CHANGES
lib/sqlalchemy/databases/mssql.py

diff --git a/CHANGES b/CHANGES
index 58859fb40231f1d95fb346167f8098418928c62c..e4e384b956a353a73fb0eda1419716d93a36be96 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -73,6 +73,9 @@ CHANGES
       schemas, particularly when those schemas are the
       default schema. [ticket:1217]
 
+    - Corrected problem with casting a zero length item to
+      a varchar. It now correctly adjusts the CAST.
+
 - ext
     - Can now use a custom "inherit_condition" in 
       __mapper_args__ when using declarative.
index e23ed4104b9dfc7e4f3e676bba6348f2433bf38d..f9d8b8f1f98233e19dbe409e42409d00090c9929 100644 (file)
@@ -212,7 +212,7 @@ class MSText(sqltypes.Text):
 
 class MSString(sqltypes.String):
     def get_col_spec(self):
-        return "VARCHAR(%(length)s)" % {'length' : self.length}
+        return "VARCHAR" + (self.length and "(%d)" % self.length or "")
 
 class MSNVarchar(sqltypes.Unicode):
     def get_col_spec(self):