]> 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:51 +0000 (18:39 -0400)
commita6e2dd6bc97ec0a42d80ef565765f2c4b884dcd4
tree18f928a26e271bbcd64f17bba99495de5dc67225
parent8f882575b9bbcbca891360b940d671aac6c3c051
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
(cherry picked from commit c41f25b17031d8e9ca3d7e613c0d4dcd78b693fe)
doc/build/changelog/unreleased_20/10827.rst [new file with mode: 0644]
lib/sqlalchemy/sql/lambdas.py
test/sql/test_lambdas.py