summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/loading.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-02-11 14:05:49 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-02-11 18:25:52 -0500
commit553ac45aae5712e64a5380ba1fa1c6028acf5f39 (patch)
tree1a165d582d7bfc1fb78f485f31f8b26d9a35eb10 /lib/sqlalchemy/orm/loading.py
parent89dc4562adb38367ee5fabbcc04ee44968af4906 (diff)
downloadsqlalchemy-553ac45aae5712e64a5380ba1fa1c6028acf5f39.tar.gz
Apply consistent labeling for all future style ORM queries
Fixed issue in new 1.4/2.0 style ORM queries where a statement-level label style would not be preserved in the keys used by result rows; this has been applied to all combinations of Core/ORM columns / session vs. connection etc. so that the linkage from statement to result row is the same in all cases. also repairs a cache key bug where query.from_statement() vs. select().from_statement() would not be disambiguated; the compile options were not included in the cache key for FromStatement. Fixes: #5933 Change-Id: I22f6cf0f0b3360e55299cdcb2452cead2b2458ea
Diffstat (limited to 'lib/sqlalchemy/orm/loading.py')
-rw-r--r--lib/sqlalchemy/orm/loading.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py
index a63a4236d..24751bf1d 100644
--- a/lib/sqlalchemy/orm/loading.py
+++ b/lib/sqlalchemy/orm/loading.py
@@ -252,7 +252,9 @@ def merge_result(query, iterator, load=True):
else:
frozen_result = None
- ctx = querycontext.ORMSelectCompileState._create_entities_collection(query)
+ ctx = querycontext.ORMSelectCompileState._create_entities_collection(
+ query, True
+ )
autoflush = session.autoflush
try: