summaryrefslogtreecommitdiff
path: root/test/sql/test_functions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-01-29 17:33:28 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-01-29 17:33:28 -0500
commit8afb69ced876200c6bc4013108900e067130cb0e (patch)
tree0bdba7e4f5dee342a0d96497f404bf071f53e49d /test/sql/test_functions.py
parent00e78f5f76c0f3e1000a7d239beed2d665170238 (diff)
downloadsqlalchemy-8afb69ced876200c6bc4013108900e067130cb0e.tar.gz
- Fixed regression whereby the "annotation" system used by the ORM was leaking
into the names used by standard functions in :mod:`sqlalchemy.sql.functions`, such as ``func.coalesce()`` and ``func.max()``. Using these functions in ORM attributes and thus producing annotated versions of them could corrupt the actual function name rendered in the SQL. [ticket:2927]
Diffstat (limited to 'test/sql/test_functions.py')
-rw-r--r--test/sql/test_functions.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py
index ee1d61f85..3e47e018b 100644
--- a/test/sql/test_functions.py
+++ b/test/sql/test_functions.py
@@ -76,6 +76,11 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
]:
self.assert_compile(func.random(), ret, dialect=dialect)
+ def test_generic_annotation(self):
+ fn = func.coalesce('x', 'y')._annotate({"foo": "bar"})
+ self.assert_compile(
+ fn, "coalesce(:param_1, :param_2)"
+ )
def test_custom_default_namespace(self):
class myfunc(GenericFunction):
pass