diff options
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), |
