summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ansisql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-11-27 05:31:22 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-11-27 05:31:22 +0000
commitcdcd74cb390507fc4e04bd61f77a2a2d2baa9614 (patch)
treee7cbc8e4b9a38ebf081ef4938eb64a5c09740961 /lib/sqlalchemy/ansisql.py
parentc67359157ea15d7027e30ee6b8701a35a33e91eb (diff)
downloadsqlalchemy-cdcd74cb390507fc4e04bd61f77a2a2d2baa9614.tar.gz
some fixes to IN clauses, literal text clauses displaying text/numeric properly including
longs
Diffstat (limited to 'lib/sqlalchemy/ansisql.py')
-rw-r--r--lib/sqlalchemy/ansisql.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py
index 6a618e6cd..55550bfa8 100644
--- a/lib/sqlalchemy/ansisql.py
+++ b/lib/sqlalchemy/ansisql.py
@@ -151,10 +151,7 @@ class ANSICompiler(sql.Compiled):
if compound.operator is None:
sep = " "
else:
- if compound.spaces:
- sep = compound.operator
- else:
- sep = " " + compound.operator + " "
+ sep = " " + compound.operator + " "
if compound.parens:
self.strings[compound] = "(" + string.join([self.get_str(c) for c in compound.clauses], sep) + ")"
@@ -162,7 +159,10 @@ class ANSICompiler(sql.Compiled):
self.strings[compound] = string.join([self.get_str(c) for c in compound.clauses], sep)
def visit_clauselist(self, list):
- self.strings[list] = string.join([self.get_str(c) for c in list.clauses], ', ')
+ if list.parens:
+ self.strings[list] = "(" + string.join([self.get_str(c) for c in list.clauses], ', ') + ")"
+ else:
+ self.strings[list] = string.join([self.get_str(c) for c in list.clauses], ', ')
def visit_binary(self, binary):
result = self.get_str(binary.left)