]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
revert r6184, toggle the jdbc driver's yearIsDateType option instead
authorPhilip Jenvey <pjenvey@underboss.org>
Fri, 24 Jul 2009 23:34:25 +0000 (23:34 +0000)
committerPhilip Jenvey <pjenvey@underboss.org>
Fri, 24 Jul 2009 23:34:25 +0000 (23:34 +0000)
lib/sqlalchemy/dialects/mysql/zxjdbc.py
test/dialect/test_mysql.py

index 66840f063a492c274e3b920a47e81d5925223d16..3ffe85f831bd0b254a81f187d5ed1998d60dc56e 100644 (file)
@@ -46,7 +46,7 @@ class MySQL_jdbc(ZxJDBCConnector, MySQLDialect):
 
     def _driver_kwargs(self):
         """return kw arg dict to be sent to connect()."""
-        return {'CHARSET':self.encoding}
+        return dict(CHARSET=self.encoding, yearIsDateType='false')
     
     def _extract_error_code(self, exception):
         # e.g.: DBAPIError: (Error) Table 'test.u2' doesn't exist
index c313a2f7461e01349fa08c5b608a6e25df0b98df..55792274a821d78c006c9043697fe6cfb31adbad 100644 (file)
@@ -1,4 +1,3 @@
-import datetime
 from sqlalchemy.test.testing import eq_
 
 # Py2K
@@ -466,12 +465,7 @@ class TypesTest(TestBase, AssertsExecutionResults):
             for table in year_table, reflected:
                 table.insert(['1950', '50', None, 50, 1950]).execute()
                 row = table.select().execute().first()
-                if testing.against('+zxjdbc'):
-                    expected = [datetime.date(1950, 1, 1), datetime.date(2050, 1, 1), None,
-                                datetime.date(2050, 1, 1), datetime.date(1950, 1, 1)]       
-                else:
-                    expected = [1950, 2050, None, 50, 1950]
-                    eq_(list(row), expected)
+                eq_(list(row), [1950, 2050, None, 50, 1950])
                 table.delete().execute()
                 self.assert_(colspec(table.c.y1).startswith('y1 YEAR'))
                 eq_(colspec(table.c.y4), 'y4 YEAR(2)')