]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fixes for lambda expressions and relationship loaders
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 12 Dec 2020 00:01:12 +0000 (19:01 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 12 Dec 2020 03:01:57 +0000 (22:01 -0500)
commited20e2f95f52a072d0c6b09af095b4cda0436d38
tree340571f1d5bce61f5126a932a7739fee7efb3b77
parent8e9e473dcb76b57a7f0eaa476481cb66a258ea69
Fixes for lambda expressions and relationship loaders

Fixed bug in lambda SQL feature, used by ORM
:meth:`_orm.with_loader_criteria` as well as available generally in the SQL
expression language, where assigning a boolean value True/False to a
variable would cause the query-time expression calculation to fail, as it
would produce a SQL expression not compatible with a bound value.

Fixed issue where the :attr:`_orm.ORMExecuteState.is_relationship_load`
parameter would not be set correctly for many lazy loads, all
selectinloads, etc.  The flag is essential in order to test if options
should be added to statements or if they would already have been propagated
via relationship loads.

Fixes: #5763
Fixes: #5764
Change-Id: I66aafbef193f892ff75ede0670698647b7475482
doc/build/changelog/unreleased_14/5763.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/5764.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/lambdas.py
test/orm/test_events.py
test/sql/test_lambdas.py
test/sql/test_utils.py