]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
cache key share; support correct traverse of 'of'
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 27 Jun 2024 22:17:47 +0000 (18:17 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 27 Jun 2024 22:24:32 +0000 (18:24 -0400)
commit522baa306fc788cf02acf29bf08e86a431a7050e
tree501b2c5b46d42b7a1fb75f4b164302278a708ad5
parent0b84b9026ce9886b4ab54d0c2dd15984ba42ce7f
cache key share; support correct traverse of 'of'

Fixed caching issue where the
:paramref:`_sql.Select.with_for_update.key_share` element of
:meth:`_sql.Select.with_for_update` was not considered as part of the cache
key, leading to incorrect caching if different variations of this parameter
were used with an otherwise identical statement.

Also repairs a traversal issue where the ``of`` element of
``ForUpdateArg`` when set to ``None`` cannot be compared against a
non-None element because the traversal defines it as a clauselist.
Traversal in this case is adjusted to accommodate for this case so that
we dont need to create a risky-to-backport change to ``ForUpdateArg``
itself.

Fixes: #11544
Change-Id: Ie8a50716df06977af58b0c22a8c10e1b64d972b9
(cherry picked from commit 6d2f43e14f2fe25cdc811355b7bd6d11f8eee381)
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
test/sql/test_compare.py