1. Mike Bayer
  2. sqlalchemy-access

Commits

Roel van Os  committed 678e88b

Enclose joins in parentheses

  • Participants
  • Parent commits 1f03898
  • Branches default

Comments (0)

Files changed (1)

File sqlalchemy_access/base.py

View file
             return ""
 
     def visit_join(self, join, asfrom=False, **kwargs):
-        return (self.process(join.left, asfrom=True) + \
+        return ('(' + self.process(join.left, asfrom=True) + \
                 (join.isouter and " LEFT OUTER JOIN " or " INNER JOIN ") + \
                 self.process(join.right, asfrom=True) + " ON " + \
-                self.process(join.onclause))
+                self.process(join.onclause) + ')')
 
     def visit_extract(self, extract, **kw):
         field = self.extract_map.get(extract.field, extract.field)