summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-09-27 23:18:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-09-27 23:18:57 -0400
commit92a8ead72476d83cbd6ecb10d791c489ea6fa013 (patch)
tree76a0f7440bc744d7dbb98c3dbcfbb8065ebd58c8 /lib/sqlalchemy/orm
parentb2a991dd8ec6dad248ec93129965271c63bb312a (diff)
downloadsqlalchemy-92a8ead72476d83cbd6ecb10d791c489ea6fa013.tar.gz
build the full compilestate every time
the ORMSelectCompileState was trying to get away with not building out the "froms" list of the state, but we need this for select.froms. Build this out and add some tests for select(), including some other state-oriented use cases. Fixes: #5614 Change-Id: I29ca200f292cbae87c722bc97a89d7c453d7d27a
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/context.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py
index d9e334d45..c24e04aa5 100644
--- a/lib/sqlalchemy/orm/context.py
+++ b/lib/sqlalchemy/orm/context.py
@@ -533,8 +533,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
# and _setup_for_generate into three or four logical sections
self._setup_for_generate()
- if compiler is not None:
- SelectState.__init__(self, self.statement, compiler, **kw)
+ SelectState.__init__(self, self.statement, compiler, **kw)
return self