summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-10-29 17:38:56 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-10-29 17:38:56 -0400
commite6a5ea8fa7d10078c8d3f1bf6cabc4399cac3e70 (patch)
tree316f3c5287a1389d214437dadb9c2dca0560410f /test/sql
parent5d6376fbd5ca4103a26118a6fffd1e95be0d5161 (diff)
downloadsqlalchemy-e6a5ea8fa7d10078c8d3f1bf6cabc4399cac3e70.tar.gz
- [bug] Postgresql dialect memoizes that an ENUM of a
particular name was processed during a create/drop sequence. This allows a create/drop sequence to work without any calls to "checkfirst", and also means with "checkfirst" turned on it only needs to check for the ENUM once. [ticket:2311]
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_types.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/sql/test_types.py b/test/sql/test_types.py
index 50cb0ba06..987e97f9b 100644
--- a/test/sql/test_types.py
+++ b/test/sql/test_types.py
@@ -956,6 +956,20 @@ class EnumTest(fixtures.TestBase):
{'id':4, 'someenum':'four'}
)
+ def test_mock_engine_no_prob(self):
+ """ensure no 'checkfirst' queries are run when enums
+ are created with checkfirst=False"""
+
+ e = engines.mock_engine()
+ t = Table('t1', MetaData(),
+ Column('x', Enum("x", "y", name="pge"))
+ )
+ t.create(e, checkfirst=False)
+ # basically looking for the start of
+ # the constraint, or the ENUM def itself,
+ # depending on backend.
+ assert "('x'," in e.print_sql()
+
class BinaryTest(fixtures.TestBase, AssertsExecutionResults):
__excluded_on__ = (
('mysql', '<', (4, 1, 1)), # screwy varbinary types