summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/operators.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-12-05 19:03:31 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-12-05 19:03:31 -0500
commitb653fb3a23a0388814d9ab79b884d64d396baff1 (patch)
treeba0eb6017e0035b8726da13e617a16562fae4b2f /lib/sqlalchemy/sql/operators.py
parent3621e4b8de9124ad4f27d77c3c6cb7470ba31e69 (diff)
downloadsqlalchemy-b653fb3a23a0388814d9ab79b884d64d396baff1.tar.gz
- The precedence rules for the :meth:`.ColumnOperators.collate` operator
have been modified, such that the COLLATE operator is now of lower precedence than the comparison operators. This has the effect that a COLLATE applied to a comparison will not render parenthesis around the comparison, which is not parsed by backends such as MSSQL. The change is backwards incompatible for those setups that were working around the issue by applying :meth:`.Operators.collate` to an individual element of the comparison expression, rather than the comparison expression as a whole. [ticket:2879]
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r--lib/sqlalchemy/sql/operators.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py
index 5bd4b302b..a156a9796 100644
--- a/lib/sqlalchemy/sql/operators.py
+++ b/lib/sqlalchemy/sql/operators.py
@@ -831,7 +831,11 @@ _PRECEDENCE = {
and_: 3,
or_: 2,
comma_op: -1,
- collate: 7,
+
+ desc_op: 3,
+ asc_op: 3,
+ collate: 4,
+
as_: -1,
exists: 0,
_asbool: -10,