]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- on mysql, emit inner joins as 'INNER JOIN ... ON' (for version 3.23)
authorJason Kirtland <jek@discorporate.us>
Wed, 12 Dec 2007 16:39:10 +0000 (16:39 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 12 Dec 2007 16:39:10 +0000 (16:39 +0000)
lib/sqlalchemy/databases/mysql.py

index 742164412896bcddd4d9fa078ae79d686ea5ab1b..ba0ad5e0af520ed9556916d5d0b087616a21e13e 100644 (file)
@@ -1881,6 +1881,14 @@ class MySQLCompiler(compiler.DefaultCompiler):
         else:
             return ""
 
+    def visit_join(self, join, asfrom=False, **kwargs):
+        return ''.join(
+            (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)))
+
     def for_update_clause(self, select):
         if select.for_update == 'read':
              return ' LOCK IN SHARE MODE'