summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-05 12:03:46 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-05 12:03:46 -0500
commit16cd07c4f896b03d0e73fc28b5279421dab53489 (patch)
tree3a576036c3f3fb1a7b0da50480e9d8996012bbf3 /test/sql
parentb069127b2d3f7b3f2c27f91cfcd32152a98c907f (diff)
downloadsqlalchemy-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 'test/sql')
-rw-r--r--test/sql/test_compiler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index cd9d31864..25aa78b03 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -1191,6 +1191,13 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
dialect=dialect
)
+ # test callable
+ self.assert_compile(
+ select([table1.c.myid == bindparam("foo", callable_=lambda: 5)]),
+ "SELECT mytable.myid = 5 AS anon_1 FROM mytable",
+ dialect=dialect
+ )
+
assert_raises_message(
exc.CompileError,
"Bind parameter 'foo' without a renderable value not allowed here.",