summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-05-03 19:35:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-04 09:30:12 -0400
commitdd244758a218201e6b38c44f7a9779a40177742b (patch)
treee20433242d08d68a4aaddf9860eacbc131f0fb23 /lib
parent00d40775b73cf94fa5d1b765dac1e600e93e172f (diff)
downloadsqlalchemy-dd244758a218201e6b38c44f7a9779a40177742b.tar.gz
Baked query needs to spoil fully on uncachable option
Fixed issue in the area of where loader options such as selectinload() interact with the baked query system, such that the caching of a query is not supposed to occur if the loader options themselves have elements such as with_polymorphic() objects in them that currently are not cache-compatible. The baked loader could sometimes not fully invalidate itself in these some of these scenarios leading to missed eager loads. Fixes: #5303 Change-Id: Iecf847204a619694d89297f83b63b613ef9767de
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/ext/baked.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/baked.py b/lib/sqlalchemy/ext/baked.py
index ca07be784..a9c79d6bd 100644
--- a/lib/sqlalchemy/ext/baked.py
+++ b/lib/sqlalchemy/ext/baked.py
@@ -199,12 +199,12 @@ class BakedQuery(object):
if cache_path.path[0].is_aliased_class:
# paths that are against an AliasedClass are unsafe to cache
# with since the AliasedClass is an ad-hoc object.
- self.spoil()
+ self.spoil(full=True)
else:
for opt in options:
cache_key = opt._generate_path_cache_key(cache_path)
if cache_key is False:
- self.spoil()
+ self.spoil(full=True)
elif cache_key is not None:
key += cache_key