From 0c3a53d433d0adddfd16831380f8aea5d1fad176 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 21 Nov 2011 20:40:31 -0500 Subject: sort of muscling this out, mysql a PITA --- test/sql/test_compiler.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/sql') 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), -- cgit v1.2.1