diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-18 14:46:04 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-18 14:46:04 -0400 |
| commit | 236db85f96e84fe099e63182bc4e67ceb65bd0d0 (patch) | |
| tree | eeab827ef786b6130f0b2d4d509b78d50cb96a71 /test/sql | |
| parent | e7c179ac72abf83d32da6a79e5c94f58aa28f904 (diff) | |
| download | sqlalchemy-236db85f96e84fe099e63182bc4e67ceb65bd0d0.tar.gz | |
Fixed regression dating back to 0.7.9 whereby the name of a CTE might
not be properly quoted if it was referred to in multiple FROM clauses.
Also in 0.8.3, 0.7.11. [ticket:2801]
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_cte.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/sql/test_cte.py b/test/sql/test_cte.py index 5368b9891..0f6831375 100644 --- a/test/sql/test_cte.py +++ b/test/sql/test_cte.py @@ -312,6 +312,22 @@ class CTETest(fixtures.TestBase, AssertsCompiledSQL): "FROM regional_sales" ) + def test_multi_subq_quote(self): + cte = select([literal(1).label("id")]).cte(name='CTE') + + s1 = select([cte.c.id]).alias() + s2 = select([cte.c.id]).alias() + + s = select([s1, s2]) + self.assert_compile( + s, + 'WITH "CTE" AS (SELECT :param_1 AS id) ' + 'SELECT anon_1.id, anon_2.id FROM ' + '(SELECT "CTE".id AS id FROM "CTE") AS anon_1, ' + '(SELECT "CTE".id AS id FROM "CTE") AS anon_2' + ) + + def test_positional_binds(self): orders = table('orders', column('order'), |
