diff options
| author | Carson Ip <carsonip715@gmail.com> | 2020-01-03 17:09:20 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-01-04 13:01:26 -0500 |
| commit | 5ecb7732fb62d80adb4434bdd0e606e43aa14a98 (patch) | |
| tree | 62f4110b11eda3228dd01d935535480c18276a01 /test/aaa_profiling | |
| parent | 5881fd274015af3de37f2ff0f91ff6a7c61c1540 (diff) | |
| download | sqlalchemy-5ecb7732fb62d80adb4434bdd0e606e43aa14a98.tar.gz | |
Fix QueryContext ref cycle on joinedload
Avoid storing a reference to itself when dealing with create_eager_joins. Also fix a cheating test.
Fixes: #5071
Closes: #5072
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5072
Pull-request-sha: 75ebaf7c91e96d7567eb5760be713dc134c58763
Change-Id: I511ddc0979b46f7928217347199eca4b1d0b4a49
Diffstat (limited to 'test/aaa_profiling')
| -rw-r--r-- | test/aaa_profiling/test_memusage.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py index 301724509..94d16517e 100644 --- a/test/aaa_profiling/test_memusage.py +++ b/test/aaa_profiling/test_memusage.py @@ -1269,6 +1269,21 @@ class CycleTest(_fixtures.FixtureTest): go() + def test_query_joinedload(self): + User, Address = self.classes("User", "Address") + + s = Session() + + def generate(): + s.query(User).options(joinedload(User.addresses)).all() + + # cycles here are due to ClauseElement._cloned_set and Load.context + @assert_cycles(28) + def go(): + generate() + + go() + def test_plain_join(self): users, addresses = self.tables("users", "addresses") |
