diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-12-08 03:03:29 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-12-08 03:03:29 +0000 |
commit | fa43b890bddebdfcbb825cb090a5b92222e04b52 (patch) | |
tree | e2a8d8b3de1c353564e39892825ee88cadfcd9c0 /lib/sqlalchemy/ansisql.py | |
parent | e2c4d1cc58163319088d5bcf1c1661ae5d959947 (diff) | |
download | sqlalchemy-fa43b890bddebdfcbb825cb090a5b92222e04b52.tar.gz |
some enhancemnets to unions, unions and selects need to be more commonly derived,
also more tweaks to mapper eager query compilation involving distinct etc.
Diffstat (limited to 'lib/sqlalchemy/ansisql.py')
-rw-r--r-- | lib/sqlalchemy/ansisql.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py index 79215dec7..28003047a 100644 --- a/lib/sqlalchemy/ansisql.py +++ b/lib/sqlalchemy/ansisql.py @@ -165,10 +165,11 @@ class ANSICompiler(sql.Compiled): else: sep = " " + compound.operator + " " + s = string.join([self.get_str(c) for c in compound.clauses], sep) if compound.parens: - self.strings[compound] = "(" + string.join([self.get_str(c) for c in compound.clauses], sep) + ")" + self.strings[compound] = "(" + s + ")" else: - self.strings[compound] = string.join([self.get_str(c) for c in compound.clauses], sep) + self.strings[compound] = s def visit_clauselist(self, list): if list.parens: @@ -184,6 +185,8 @@ class ANSICompiler(sql.Compiled): for tup in cs.clauses: text += " " + tup[0] + " " + self.get_str(tup[1]) self.strings[cs] = text + self.froms[cs] = "(" + text + ")" + print "cs from text:" + self.froms[cs] def visit_binary(self, binary): result = self.get_str(binary.left) @@ -276,8 +279,10 @@ class ANSICompiler(sql.Compiled): text += self.limit_clause(select) if getattr(select, 'issubquery', False): + print "subquery" self.strings[select] = "(" + text + ")" else: + print "not a subquery" self.strings[select] = text self.froms[select] = "(" + text + ")" |