Commits

Mike Bayer committed 896570a

- 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]

  • Participants
  • Parent commits e1ce67d
  • Branches rel_0_6

Comments (0)

Files changed (3)

     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

File lib/sqlalchemy/dialects/mssql/base.py

     __visit_name__ = 'DATETIME2'
 
     def __init__(self, precision=None, **kwargs):
+        super(DATETIME2, self).__init__(**kwargs)
         self.precision = precision
 
 

File test/dialect/test_mssql.py

             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))