]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix lambda statements with non-lambda criteria
authorcjc0013 <cjc0013@users.noreply.github.com>
Mon, 25 May 2026 16:46:50 +0000 (12:46 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 27 May 2026 22:39:11 +0000 (18:39 -0400)
commitc41f25b17031d8e9ca3d7e613c0d4dcd78b693fe
tree315315e8d5892ec0aac45bf57b16c82336ea424b
parent092391036ce007d128f2f61c98fc9b31177970bb
Fix lambda statements with non-lambda criteria

Fixed issue where :class:`_sql.StatementLambdaElement` would proxy
attribute access through the cached "expected" expression rather than the
resolved expression, causing stale closure-bound parameter values to be
used when a lambda statement was extended with non-lambda criteria such as
an additional ``.where()`` clause.  Courtesy cjc0013.

Fixes: #10827
Closes: #13327
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13327
Pull-request-sha: ec3e6735bf95d62d768f214dd5a49bbfc4fecaa5

Change-Id: I8a32c11f3da63109cf37c39541df8ebfee52b8c5
doc/build/changelog/unreleased_20/10827.rst [new file with mode: 0644]
lib/sqlalchemy/sql/lambdas.py
test/sql/test_lambdas.py