From: Mike Bayer Date: Mon, 23 Jun 2014 22:38:23 +0000 (-0400) Subject: - Reverted the change for :ticket:`3060` - this is a unit of work X-Git-Tag: rel_1_0_0b1~379 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e7447db1ff1a49f15269f6515a82607db9384f4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Reverted the change for :ticket:`3060` - this is a unit of work fix that is updated more comprehensively in 1.0 via :ticket:`3061`. The fix in :ticket:`3060` unfortunately produces a new issue whereby an eager load of a many-to-one attribute can produce an event that is interpreted into an attribute change. --- diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index 832b067ddc..adc109680a 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -11,6 +11,20 @@ .. include:: changelog_07.rst :start-line: 5 +.. changelog:: + :version: 0.9.6 + :released: + + .. change:: + :tags: bug, orm + :tickets: 3060 + + Reverted the change for :ticket:`3060` - this is a unit of work + fix that is updated more comprehensively in 1.0 via :ticket:`3061`. + The fix in :ticket:`3060` unfortunately produces a new issue whereby + an eager load of a many-to-one attribute can produce an event + that is interpreted into an attribute change. + .. changelog:: :version: 0.9.5 :released: June 23, 2014 @@ -137,6 +151,12 @@ which reverts the more patchwork version of the fix as it exists in 0.9.5. + .. note:: + + This change has been **REVERTED** in 0.9.6. The full fix + will be in version 1.0 of SQLAlchemy. + + .. change:: :tags: bug, orm :versions: 1.0.0 diff --git a/lib/sqlalchemy/testing/__init__.py b/lib/sqlalchemy/testing/__init__.py index 9549064322..c03c6f349f 100644 --- a/lib/sqlalchemy/testing/__init__.py +++ b/lib/sqlalchemy/testing/__init__.py @@ -11,7 +11,7 @@ from . import config from .exclusions import db_spec, _is_excluded, fails_if, skip_if, future,\ fails_on, fails_on_everything_except, skip, only_on, exclude, \ - against as _against, _server_version, only_if + against as _against, _server_version, only_if, fails def against(*queries): diff --git a/test/orm/test_unitofworkv2.py b/test/orm/test_unitofworkv2.py index 00cc044bfa..787c104e7e 100644 --- a/test/orm/test_unitofworkv2.py +++ b/test/orm/test_unitofworkv2.py @@ -1314,6 +1314,7 @@ class RowswitchM2OTest(fixtures.MappedTest): mapper(C, c) return A, B, C + @testing.fails() def test_set_none_replaces_m2o(self): # we have to deal here with the fact that a # get of an unset attribute implicitly sets it to None @@ -1337,6 +1338,7 @@ class RowswitchM2OTest(fixtures.MappedTest): sess.commit() assert a1.bs[0].c is None + @testing.fails() def test_set_none_w_get_replaces_m2o(self): A, B, C = self._fixture() sess = Session() @@ -1389,6 +1391,25 @@ class RowswitchM2OTest(fixtures.MappedTest): sess.commit() assert a1.bs[0].data is None + def test_joinedload_doesnt_produce_bogus_event(self): + A, B, C = self._fixture() + sess = Session() + + c1 = C() + sess.add(c1) + sess.flush() + + b1 = B() + sess.add(b1) + sess.commit() + + # test that was broken by #3060 + from sqlalchemy.orm import joinedload + b1 = sess.query(B).options(joinedload("c")).first() + b1.cid = c1.id + sess.flush() + + assert b1.cid == c1.id class BasicStaleChecksTest(fixtures.MappedTest):