summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.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 /lib/sqlalchemy/sql/elements.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 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 735a125d7..6d1174d20 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -3808,6 +3808,12 @@ class FunctionFilter(ColumnElement):
rows=rows,
)
+ def self_group(self, against=None):
+ if operators.is_precedent(operators.filter_op, against):
+ return Grouping(self)
+ else:
+ return self
+
@util.memoized_property
def type(self):
return self.func.type