]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
adjust concat precedence to match that of string comparison
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 21 Aug 2023 14:40:09 +0000 (10:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 21 Aug 2023 15:30:53 +0000 (11:30 -0400)
commit7083214539075dd3c1e834c089ed1ba05a9fed6a
treee48e617984d69cd276b1985305c78fd27b8f8163
parent09d247d57ffb6329739deae89019c9e7ad3b9e7f
adjust concat precedence to match that of string comparison

Adjusted the operator precedence for the string concatenation operator to
be equal to that of string matching operators, such as
:meth:`.ColumnElement.like`, :meth:`.ColumnElement.regexp_match`,
:meth:`.ColumnElement.match`, etc., as well as plain ``==`` which has the
same precedence as string comparison operators, so that parenthesis will be
applied to a string concatenation expression that follows a string match
operator. This provides for backends such as PostgreSQL where the "regexp
match" operator is apparently of higher precedence than the string
concatenation operator.

Fixes: #9610
Change-Id: I73640e40e445375177340e1ed8f45b5da98d6dfb
doc/build/changelog/unreleased_20/9610.rst [new file with mode: 0644]
lib/sqlalchemy/sql/operators.py
test/orm/test_relationships.py
test/sql/test_operators.py
test/sql/test_update.py