summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-01-18 17:08:28 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-01-18 17:08:28 +0000
commit072039945b23b0a76814e53698da247de334f7eb (patch)
tree8616971bd3e74eafa734d42f2a0e1bd36004fb74 /lib/sqlalchemy/sql/compiler.py
parent86fcffc854540e87d56e5e0d49273a9411af32f6 (diff)
downloadsqlalchemy-072039945b23b0a76814e53698da247de334f7eb.tar.gz
- Further fixes to the "percent signs and spaces in column/table
names" functionality. [ticket:1284] - Still doesn't work for PG/MySQL, which unfortunately would require post_process_text() calls all over the place. Perhaps % escaping can be assembled into IdentifierPreparer.quote() since that's where identifier names are received.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 8622aeea4..dd4e194fe 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -432,8 +432,7 @@ class DefaultCompiler(engine.Compiled):
return name % self.anon_map
def _process_anon(self, key):
- (ident, derived) = key.split(' ')
-
+ (ident, derived) = key.split(' ', 1)
anonymous_counter = self.anon_map.get(derived, 1)
self.anon_map[derived] = anonymous_counter + 1
return derived + "_" + str(anonymous_counter)
@@ -447,7 +446,8 @@ class DefaultCompiler(engine.Compiled):
def visit_alias(self, alias, asfrom=False, **kwargs):
if asfrom:
- return self.process(alias.original, asfrom=True, **kwargs) + " AS " + self.preparer.format_alias(alias, alias.name % self.anon_map)
+ return self.process(alias.original, asfrom=True, **kwargs) + " AS " + \
+ self.preparer.format_alias(alias, alias.name % self.anon_map)
else:
return self.process(alias.original, **kwargs)