From b146a0c64144639bf02bafda239238e3a8f5c84d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 10 May 2021 22:52:49 -0400 Subject: 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 --- lib/sqlalchemy/sql/lambdas.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/sql/lambdas.py') 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: -- cgit v1.2.1