summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-08-18 14:17:06 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-08-18 14:18:02 -0400
commit8bc793c4dbc876722dfaad0ca731938c70b54b6c (patch)
tree3c3ffd8f5df8b2dabaa4c24b2f924e4ed51338a9 /test/dialect/postgresql/test_compiler.py
parent7277c12e4d1bdc9647b9b306d89b5847d1c5a4d7 (diff)
downloadsqlalchemy-8bc793c4dbc876722dfaad0ca731938c70b54b6c.tar.gz
Deliver straight BinaryExpr w/ no negate for any() / all()
Adjusted the :meth:`_types.ARRAY.Comparator.any` and :meth:`_types.ARRAY.Comparator.all` methods to implement a straight "NOT" operation for negation, rather than negating the comparison operator. Fixes: #5518 Change-Id: I87ee9278c321aafe51a679fcfcbb5fbb11307fda
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 20732067d..ce285007f 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -1234,6 +1234,27 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
"%(param_1)s = ANY (x)",
checkparams={"param_1": 4},
)
+
+ self.assert_compile(
+ c.any(5), "%(param_1)s = ANY (x)", checkparams={"param_1": 5},
+ )
+
+ self.assert_compile(
+ ~c.any(5),
+ "NOT (%(param_1)s = ANY (x))",
+ checkparams={"param_1": 5},
+ )
+
+ self.assert_compile(
+ c.all(5), "%(param_1)s = ALL (x)", checkparams={"param_1": 5},
+ )
+
+ self.assert_compile(
+ ~c.all(5),
+ "NOT (%(param_1)s = ALL (x))",
+ checkparams={"param_1": 5},
+ )
+
self.assert_compile(
c.any(5, operator=operators.ne),
"%(param_1)s != ANY (x)",