summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-06-21 16:49:29 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-06-21 16:49:29 -0400
commitd5186e92534b4d38e590cef2d56c85be845bfdf0 (patch)
tree45e774615f0f35a761a8711cddb145545f364e06 /lib
parentd5609d77841ab4e607e6b372a15396b38ddace9a (diff)
downloadsqlalchemy-d5186e92534b4d38e590cef2d56c85be845bfdf0.tar.gz
- [bug] quoting is applied to the column names
inside the WITH RECURSIVE clause of a common table expression according to the quoting rules for the originating Column. [ticket:2512]
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/sql/compiler.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index e0cdbe24c..96ca1c57d 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -790,10 +790,13 @@ class SQLCompiler(engine.Compiled):
col_source = cte.original.selects[0]
else:
assert False
- recur_cols = [c.key for c in util.unique_list(col_source.inner_columns)
+ recur_cols = [c for c in
+ util.unique_list(col_source.inner_columns)
if c is not None]
- text += "(%s)" % (", ".join(recur_cols))
+ text += "(%s)" % (", ".join(
+ self.preparer.format_column(ident)
+ for ident in recur_cols))
text += " AS \n" + \
cte.original._compiler_dispatch(
self, asfrom=True, **kwargs