]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fixes for table-bound version_id_col against mapped selectable
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 10 Jan 2020 18:16:43 +0000 (13:16 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 12 Jan 2020 02:58:12 +0000 (21:58 -0500)
commit615ec3e640373bcb10311ba1d5cfc72e570b6534
tree81c038b1c6f379f961b1fead75cf4956dd69dba0
parent48b37a062a26a41bd5c9243d2365a6c06a77a347
Fixes for table-bound version_id_col against mapped selectable

Fixed bug where a versioning column specified on a mapper against a
:func:`.select` construct where the version_id_col itself were against the
underlying table would incur additional loads when accessed, even if the
value were locally persisted by the flush.  The actual fix is a result of
the changes in :ticket:`4617`,  by fact that a :func:`.select` object no
longer has a ``.c`` attribute and therefore does not confuse the mapper
into thinking there's an unknown column value present.

Fixed bug in ORM versioning feature where assignment of an explicit
version_id for a counter configured against a mapped selectable where
version_id_col is against the underlying table would fail if the previous
value were expired; this was due to the fact that the  mapped attribute
would not be configured with active_history=True.

Fixes: #4194
Fixes: #4195
Change-Id: I214879f441f905bdd85a7411f90352af7399051d
doc/build/changelog/unreleased_14/4194.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/4195.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategies.py
test/orm/test_versioning.py