diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-05 12:03:46 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-05 12:03:46 -0500 |
commit | 16cd07c4f896b03d0e73fc28b5279421dab53489 (patch) | |
tree | 3a576036c3f3fb1a7b0da50480e9d8996012bbf3 /lib/sqlalchemy/sql/compiler.py | |
parent | b069127b2d3f7b3f2c27f91cfcd32152a98c907f (diff) | |
download | sqlalchemy-16cd07c4f896b03d0e73fc28b5279421dab53489.tar.gz |
- Fixed bug where so-called "literal render" of :func:`.bindparam`
constructs would fail if the bind were constructed with a callable,
rather than a direct value. This prevented ORM expressions
from being rendered with the "literal_binds" compiler flag.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 673e5f89b..d4b080720 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -969,7 +969,7 @@ class SQLCompiler(Compiled): if literal_binds or \ (within_columns_clause and \ self.ansi_bind_rules): - if bindparam.value is None: + if bindparam.value is None and bindparam.callable is None: raise exc.CompileError("Bind parameter '%s' without a " "renderable value not allowed here." % bindparam.key) @@ -1005,7 +1005,7 @@ class SQLCompiler(Compiled): return self.bindparam_string(name, **kwargs) def render_literal_bindparam(self, bindparam, **kw): - value = bindparam.value + value = bindparam.effective_value return self.render_literal_value(value, bindparam.type) def render_literal_value(self, value, type_): |