summaryrefslogtreecommitdiff
path: root/test/sql/test_operators.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-04-18 09:40:03 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-04-18 13:41:10 -0400
commite9737a9d9b1becc7dba1661f17b247db3213c511 (patch)
tree16adb6ff444c1559e32a3a778b9328d50415b453 /test/sql/test_operators.py
parent6758a459597e5221607a81a693bd98352bb1c94f (diff)
downloadsqlalchemy-e9737a9d9b1becc7dba1661f17b247db3213c511.tar.gz
negate True/False separately from other elements
Fixed issue where double negation of a boolean column wouldn't reset the "NOT" operator. Fixes: #4618 Change-Id: Ica280a0d6b5b0870aa2d05c4d059a1e559e6b12a (cherry picked from commit 18f25f50353d9736e6638266585b2cb3ef7b0ea4)
Diffstat (limited to 'test/sql/test_operators.py')
-rw-r--r--test/sql/test_operators.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py
index dd9f76cd6..82c69003b 100644
--- a/test/sql/test_operators.py
+++ b/test/sql/test_operators.py
@@ -912,6 +912,14 @@ class BooleanEvalTest(fixtures.TestBase, testing.AssertsCompiledSQL):
dialect=self._dialect(False),
)
+ def test_three_a_double(self):
+ c = column("x", Boolean)
+ self.assert_compile(
+ select([c]).where(~~c),
+ "SELECT x WHERE x = 1",
+ dialect=self._dialect(False),
+ )
+
def test_three_b(self):
c = column("x", Boolean)
self.assert_compile(
@@ -928,6 +936,14 @@ class BooleanEvalTest(fixtures.TestBase, testing.AssertsCompiledSQL):
dialect=self._dialect(True),
)
+ def test_four_double(self):
+ c = column("x", Boolean)
+ self.assert_compile(
+ select([c]).where(~~c),
+ "SELECT x WHERE x",
+ dialect=self._dialect(True),
+ )
+
def test_five_a(self):
c = column("x", Boolean)
self.assert_compile(