diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-11-21 20:40:31 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-11-21 20:40:31 -0500 |
| commit | 0c3a53d433d0adddfd16831380f8aea5d1fad176 (patch) | |
| tree | 0c8dad33b2d636ef119a6feb4ffa0c0f3afd8e61 /test/sql | |
| parent | c0c42af4e0ef8acd651cc66e84ec636c14ab53a5 (diff) | |
| download | sqlalchemy-0c3a53d433d0adddfd16831380f8aea5d1fad176.tar.gz | |
sort of muscling this out, mysql a PITA
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_compiler.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index 4e086c8cd..9a53dd89c 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -2663,6 +2663,18 @@ class CRUDTest(fixtures.TestBase, AssertsCompiledSQL): "(SELECT myothertable.othername FROM myothertable " "WHERE myothertable.otherid = mytable.myid)") + # test correlated FROM implicit in WHERE and SET clauses + u = table1.update().values(name=table2.c.othername)\ + .where(table2.c.otherid == table1.c.myid) + self.assert_compile(u, + "UPDATE mytable SET name=myothertable.othername " + "FROM myothertable WHERE myothertable.otherid = mytable.myid") + u = table1.update().values(name='foo')\ + .where(table2.c.otherid == table1.c.myid) + self.assert_compile(u, + "UPDATE mytable SET name=:name " + "FROM myothertable WHERE myothertable.otherid = mytable.myid") + def test_delete(self): self.assert_compile( delete(table1, table1.c.myid == 7), |
