summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/sql/compiler.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index e9046b407..59eb3cdb3 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -681,11 +681,6 @@ class DefaultCompiler(engine.Compiled, visitors.ClauseVisitor):
self.binds[col.key] = bindparam
return self.bindparam_string(self._truncate_bindparam(bindparam))
- # no parameters in the statement, no parameters in the
- # compiled params - return binds for all columns
- if self.parameters is None and stmt.parameters is None:
- return [(c, create_bind_param(c, None)) for c in stmt.table.columns]
-
def create_clause_param(col, value):
self.traverse(value)
self.inline_params.add(col)
@@ -699,6 +694,11 @@ class DefaultCompiler(engine.Compiled, visitors.ClauseVisitor):
else:
return key
+ # no parameters in the statement, no parameters in the
+ # compiled params - return binds for all columns
+ if self.parameters is None and stmt.parameters is None:
+ return [(c, create_bind_param(c, None)) for c in stmt.table.columns]
+
# if we have statement parameters - set defaults in the
# compiled params
if self.parameters is None: