diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2018-06-26 18:00:47 -0400 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci.zzzcomputing.com> | 2018-06-26 18:00:47 -0400 |
| commit | a0d1030096af8f6cdd2e2fb7668224ade2d87c8f (patch) | |
| tree | dd30091b0d583122c8e1735d31b00357938f7e29 /lib/sqlalchemy/orm | |
| parent | 1827af37cfc7494143ae290da435029043af2372 (diff) | |
| parent | f243c00dda1484da97e706b7237670cdce6f10b9 (diff) | |
| download | sqlalchemy-a0d1030096af8f6cdd2e2fb7668224ade2d87c8f.tar.gz | |
Merge "Ensure BakedQuery is cloned before we add options to it"
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/loading.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py index a169845d4..0a6f8023a 100644 --- a/lib/sqlalchemy/orm/loading.py +++ b/lib/sqlalchemy/orm/loading.py @@ -580,17 +580,17 @@ def _load_subclass_via_in(context, path, entity): def do_load(context, path, states, load_only, effective_entity): orig_query = context.query - q._add_lazyload_options( + q2 = q._with_lazyload_options( (enable_opt, ) + orig_query._with_options + (disable_opt, ), path.parent, cache_path=path ) if orig_query._populate_existing: - q.add_criteria( + q2.add_criteria( lambda q: q.populate_existing() ) - q(context.session).params( + q2(context.session).params( primary_keys=[ state.key[1][0] if zero_idx else state.key[1] for state, load_attrs in states |
