]> 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:23:49 +0000 (18:23 -0400)
commit6d2f43e14f2fe25cdc811355b7bd6d11f8eee381
treeeeb2e98357f553599e070c5bb5d8dbd1d0ad74e8
parentfc2cb4496d35c0b8bb7d59aa74b553f07210eded
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
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
test/sql/test_compare.py