From 8afb69ced876200c6bc4013108900e067130cb0e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 29 Jan 2014 17:33:28 -0500 Subject: - 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] --- test/sql/test_functions.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/sql/test_functions.py') 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 -- cgit v1.2.1