summaryrefslogtreecommitdiff
path: root/test/sql/test_functions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-07-12 22:43:31 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-07-12 22:44:27 -0400
commit116faee662f618d5ecd13b1e074a27d5e5a40564 (patch)
tree0da325240907b61f0f70e6c6147f166315e9f6f0 /test/sql/test_functions.py
parentaceefb508ccd0911f52ff0e50324b3fefeaa3f16 (diff)
downloadsqlalchemy-116faee662f618d5ecd13b1e074a27d5e5a40564.tar.gz
self_group() for FunctionFilter
Fixed issue where the :class:`.array_agg` construct in combination with :meth:`.FunctionElement.filter` would not produce the correct operator precedence between the FILTER keyword and the array index operator. Fixes: #4760 Change-Id: Ic662cd3da3330554ec673bafd80495b3f1506098
Diffstat (limited to 'test/sql/test_functions.py')
-rw-r--r--test/sql/test_functions.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py
index e0efb1008..d0e68f1e3 100644
--- a/test/sql/test_functions.py
+++ b/test/sql/test_functions.py
@@ -557,6 +557,15 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
"mytable.myid > :myid_1)",
)
+ def test_funcfilter_arrayagg_subscript(self):
+ num = column("q")
+ self.assert_compile(
+ func.array_agg(num).filter(num % 2 == 0)[1],
+ "(array_agg(q) FILTER (WHERE q %% %(q_1)s = "
+ "%(param_1)s))[%(param_2)s]",
+ dialect="postgresql",
+ )
+
def test_funcfilter_label(self):
self.assert_compile(
select(