From: Mike Bayer Date: Sat, 7 Feb 2015 04:41:01 +0000 (-0500) Subject: - break up the tables here to avoid the error we're getting X-Git-Tag: rel_1_0_0b1~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68900c2654a6918de2c4e264cd197da953f0ed11;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - break up the tables here to avoid the error we're getting on jenkins --- diff --git a/test/dialect/mysql/test_reflection.py b/test/dialect/mysql/test_reflection.py index 957a7eb21a..909ebd5e57 100644 --- a/test/dialect/mysql/test_reflection.py +++ b/test/dialect/mysql/test_reflection.py @@ -290,29 +290,38 @@ class ReflectionTest(fixtures.TestBase, AssertsExecutionResults): """ meta = self.metadata - Table('nn_t', meta) + + # this is ideally one table, but older MySQL versions choke + # on the multiple TIMESTAMP columns + Table('nn_t1', meta) # to allow DROP + Table('nn_t2', meta) + Table('nn_t3', meta) + testing.db.execute(""" - CREATE TABLE nn_t ( + CREATE TABLE nn_t1 ( x INTEGER NULL, y INTEGER NOT NULL, z INTEGER, q TIMESTAMP NULL, - p TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + p TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP)""") + + testing.db.execute(""" + CREATE TABLE nn_t2 ( r TIMESTAMP NOT NULL, - s TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + s TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP)""") + + testing.db.execute(""" + CREATE TABLE nn_t3 ( t TIMESTAMP, u TIMESTAMP DEFAULT CURRENT_TIMESTAMP - ) - """) + )""") + eq_( [ - { - "name": d['name'], - "nullable": d['nullable'], - "default": d['default'], - } - for d in - inspect(testing.db).get_columns('nn_t') + {"name": d['name'], "nullable": d['nullable'], + "default": d['default']} + for d in sum([inspect(testing.db).get_columns(t) + for t in ('nn_t1', 'nn_t2', 'nn_t3')], []) ], [ {'name': 'x', 'nullable': True, 'default': None}, @@ -322,11 +331,11 @@ class ReflectionTest(fixtures.TestBase, AssertsExecutionResults): {'name': 'p', 'nullable': True, 'default': 'CURRENT_TIMESTAMP'}, {'name': 'r', 'nullable': False, - 'default': "'0000-00-00 00:00:00'"}, + 'default': "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"}, {'name': 's', 'nullable': False, 'default': 'CURRENT_TIMESTAMP'}, {'name': 't', 'nullable': False, - 'default': "'0000-00-00 00:00:00'"}, + 'default': "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"}, {'name': 'u', 'nullable': False, 'default': 'CURRENT_TIMESTAMP'}, ]