]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
do not allow non-cache-key entity objects in annotations
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Apr 2023 17:56:33 +0000 (13:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Apr 2023 18:53:08 +0000 (14:53 -0400)
commit56443acb89e531b3695de669c76297e4a5568fc1
tree83a9307f7d051de9a03c8a5a83c3735639f80af9
parent39c8e95b1f50190ff30a836b2bcf13ba2cacc052
do not allow non-cache-key entity objects in annotations

Fixed critical caching issue where combination of :func:`_orm.aliased()`
:func:`_sql.case` and :func:`_hybrid.hybrid_property` expressions would
cause a cache key mismatch, leading to cache keys that held onto the actual
:func:`_orm.aliased` object while also not matching each other, filling up
the cache.

Fixes: #9728
Change-Id: I700645b5629a81a0104cf923db72a7421fa43ff4
doc/build/changelog/unreleased_14/9728.rst [new file with mode: 0644]
lib/sqlalchemy/orm/attributes.py
test/orm/test_cache_key.py