]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
use _extra_criteria to store with_expression() expression
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 Oct 2023 18:56:37 +0000 (14:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 Oct 2023 22:48:07 +0000 (18:48 -0400)
commit7b711d08b6ecfe3f6da11d3178f7f815d7eb1e4f
treecffb12a06b5b5d4039fabedc8db09f74cf377786
parent527fac5457153154d9e4c0f2b0490104833abec2
use _extra_criteria to store with_expression() expression

this is an alternate version of the first patch, which adds extra
handling for the "expression" in local_opts.  this patch has
with_expression() use _extra_criteria directly, as this attribute
is currently unpurposed for column-based attributes.

Fixed caching bug where using the :func:`_orm.with_expression` construct in
conjunction with loader options :func:`_orm.selectinload`,
:func:`_orm.lazyload` would fail to substitute bound parameter values
correctly on subsequent caching runs.

Fixes: #10570
Change-Id: If6c74755580fe5b108056eebcb461d984410ff46
doc/build/changelog/unreleased_20/10570.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/strategy_options.py
lib/sqlalchemy/sql/cache_key.py
test/orm/test_cache_key.py