From 04545727d4117db51786189e591b1777bde1a40b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 23 Mar 2015 12:33:48 -0400 Subject: - Fixed bug in new "label resolution" feature of :ticket:`2992` where a label that was anonymous, then labeled again with a name, would fail to be locatable via a textual label. This situation occurs naturally when a mapped :func:`.column_property` is given an explicit label in a query. fixes #3340 --- test/sql/test_text.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/sql') diff --git a/test/sql/test_text.py b/test/sql/test_text.py index 4483597ac..1c3cb0cb4 100644 --- a/test/sql/test_text.py +++ b/test/sql/test_text.py @@ -574,6 +574,15 @@ class OrderByLabelResolutionTest(fixtures.TestBase, AssertsCompiledSQL): "FROM mytable AS mytable_1 ORDER BY mytable_1.name" ) + def test_order_by_named_label_from_anon_label(self): + s1 = select([table1.c.myid.label(None).label("foo"), table1.c.name]) + stmt = s1.order_by("foo") + self.assert_compile( + stmt, + "SELECT mytable.myid AS foo, mytable.name " + "FROM mytable ORDER BY foo" + ) + def test_order_by_outermost_label(self): # test [ticket:3335], assure that order_by("foo") # catches the label named "foo" in the columns clause only, -- cgit v1.2.1