diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-03-28 11:50:09 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-03-28 11:50:09 -0400 |
| commit | d61919118072f4c31ba2ee0bd8c4ac22a92e92f4 (patch) | |
| tree | 1dd12ef15aa76f25d048377c518ff0c7f03a7fe7 /test/dialect | |
| parent | 63d2a486bf84f798387bd45db558610b247e0aa5 (diff) | |
| download | sqlalchemy-d61919118072f4c31ba2ee0bd8c4ac22a92e92f4.tar.gz | |
- Added support for rendering "FULL OUTER JOIN" to both Core and ORM.
Pull request courtesy Stefan Urbanek. fixes #1957
Diffstat (limited to 'test/dialect')
| -rw-r--r-- | test/dialect/mysql/test_compiler.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py index 0571ce526..8a7893445 100644 --- a/test/dialect/mysql/test_compiler.py +++ b/test/dialect/mysql/test_compiler.py @@ -576,3 +576,30 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL): 'PRIMARY KEY (id, other_id)' ')PARTITION BY HASH(other_id) PARTITIONS 2' ) + + def test_inner_join(self): + t1 = table('t1', column('x')) + t2 = table('t2', column('y')) + + self.assert_compile( + t1.join(t2, t1.c.x == t2.c.y), + "t1 INNER JOIN t2 ON t1.x = t2.y" + ) + + def test_outer_join(self): + t1 = table('t1', column('x')) + t2 = table('t2', column('y')) + + self.assert_compile( + t1.outerjoin(t2, t1.c.x == t2.c.y), + "t1 LEFT OUTER JOIN t2 ON t1.x = t2.y" + ) + + def test_full_outer_join(self): + t1 = table('t1', column('x')) + t2 = table('t2', column('y')) + + self.assert_compile( + t1.outerjoin(t2, t1.c.x == t2.c.y, full=True), + "t1 FULL OUTER JOIN t2 ON t1.x = t2.y" + )
\ No newline at end of file |
