diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-22 16:48:49 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-22 16:48:49 -0400 |
commit | 23d300c874ef0228f5141c1435bf2dc265152a59 (patch) | |
tree | 1819c1caa63b574ccb825f3e4de48c8aee4cd048 /lib/sqlalchemy/sql/operators.py | |
parent | 6c50ffcf44b8e363a5d3590955be1f62fd5e780d (diff) | |
download | sqlalchemy-23d300c874ef0228f5141c1435bf2dc265152a59.tar.gz |
- [bug] A tweak to column precedence which moves the
"concat" and "match" operators to be the same as
that of "is", "like", and others; this helps with
parenthesization rendering when used in conjunction
with "IS". [ticket:2564]
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index ad9fa4668..2e2ff3af1 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -670,31 +670,36 @@ _largest = symbol('_largest', canonical=100) _PRECEDENCE = { from_: 15, getitem: 15, - mul: 7, - truediv: 7, + mul: 8, + truediv: 8, # Py2K - div: 7, + div: 8, # end Py2K - mod: 7, - neg: 7, - add: 6, - sub: 6, + mod: 8, + neg: 8, + add: 7, + sub: 7, + concat_op: 6, match_op: 6, - ilike_op: 5, - notilike_op: 5, - like_op: 5, - notlike_op: 5, - in_op: 5, - notin_op: 5, - is_: 5, - isnot: 5, + + ilike_op: 6, + notilike_op: 6, + like_op: 6, + notlike_op: 6, + in_op: 6, + notin_op: 6, + + is_: 6, + isnot: 6, + eq: 5, ne: 5, gt: 5, lt: 5, ge: 5, le: 5, + between_op: 5, distinct_op: 5, inv: 5, |