]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed bug whereby DATETIME2 type would fail on
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Jun 2011 16:32:22 +0000 (12:32 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Jun 2011 16:32:22 +0000 (12:32 -0400)
the "adapt" step when used in result sets or
bound parameters.  This issue is not in 0.7.
[ticket:2159]

CHANGES
lib/sqlalchemy/dialects/mssql/base.py
test/dialect/test_mssql.py

diff --git a/CHANGES b/CHANGES
index 5fb4c8a2188c30015356984d7dbcd8155cb1259e..dd304e34199e1d03e546f605c9080e7e2ec612b4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -100,6 +100,11 @@ CHANGES
     applied to a schema-qualified table would leak
     into enclosing select statements [ticket:2169].
 
+  - Fixed bug whereby DATETIME2 type would fail on
+    the "adapt" step when used in result sets or 
+    bound parameters.  This issue is not in 0.7.
+    [ticket:2159]
+
 0.6.7
 =====
 - orm
index 4f900700735b099e15879b14615df81ee750363e..4c589a2a96249e0307de082524ed9976ec7ac697 100644 (file)
@@ -307,6 +307,7 @@ class DATETIME2(_DateTimeBase, sqltypes.DateTime):
     __visit_name__ = 'DATETIME2'
 
     def __init__(self, precision=None, **kwargs):
+        super(DATETIME2, self).__init__(**kwargs)
         self.precision = precision
 
 
index 40ccdb86e2db1b0f1470d7f78504403aa5fec5da..17e8306ecc3f9dd41edea972b1ca6977ba165a83 100644 (file)
@@ -1200,8 +1200,11 @@ class TypesTest(TestBase, AssertsExecutionResults, ComparesTables):
             type_, args, kw, res, requires = spec[0:5]
             if requires and testing._is_excluded('mssql', *requires) \
                 or not requires:
-                table_args.append(Column('c%s' % index, type_(*args,
-                                  **kw), nullable=None))
+                c = Column('c%s' % index, type_(*args,
+                                  **kw), nullable=None)
+                testing.db.dialect.type_descriptor(c.type)
+                table_args.append(c)
+
         dates_table = Table(*table_args)
         gen = testing.db.dialect.ddl_compiler(testing.db.dialect,
                 schema.CreateTable(dates_table))