summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/lambdas.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-05-10 22:52:49 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-05-10 23:42:41 -0400
commitb146a0c64144639bf02bafda239238e3a8f5c84d (patch)
treec9c21a160e14aa177a40f11cf436bc0b2e160659 /lib/sqlalchemy/sql/lambdas.py
parent39c2815fb25052c181f98ca52a57fd7449d7090c (diff)
downloadsqlalchemy-b146a0c64144639bf02bafda239238e3a8f5c84d.tar.gz
set bindparam.expanding in coercion again
Adjusted the logic added as part of :ticket:`6397` in 1.4.12 so that internal mutation of the :class:`.BindParameter` object occurs within the clause construction phase as it did before, rather than in the compilation phase. In the latter case, the mutation still produced side effects against the incoming construct and additionally could potentially interfere with other internal mutation routines. In order to solve the issue of the correct operator being present on the BindParameter.expand_op, we necessarily have to expand the BinaryExpression._negate() routine to flip the operator on the BindParameter also. Fixes: #6460 Change-Id: I1e53a9aeee4de4fc11af51d7593431532731561b
Diffstat (limited to 'lib/sqlalchemy/sql/lambdas.py')
-rw-r--r--lib/sqlalchemy/sql/lambdas.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/lambdas.py b/lib/sqlalchemy/sql/lambdas.py
index ddc4774db..b3f47252a 100644
--- a/lib/sqlalchemy/sql/lambdas.py
+++ b/lib/sqlalchemy/sql/lambdas.py
@@ -270,6 +270,8 @@ class LambdaElement(elements.ClauseElement):
bind = bindparam_lookup[thing.key]
if thing.expanding:
bind.expanding = True
+ bind.expand_op = thing.expand_op
+ bind.type = thing.type
return bind
if self._rec.is_sequence: