(self)
| 292 | ) |
| 293 | |
| 294 | def test_correlated_update_three(self): |
| 295 | table1 = self.tables.mytable |
| 296 | table2 = self.tables.myothertable |
| 297 | |
| 298 | # test against a regular constructed subquery |
| 299 | s = ( |
| 300 | select(table2) |
| 301 | .where(table2.c.otherid == table1.c.myid) |
| 302 | .scalar_subquery() |
| 303 | ) |
| 304 | u = ( |
| 305 | update(table1) |
| 306 | .where(table1.c.name == "jack") |
| 307 | .values({table1.c.name: s}) |
| 308 | ) |
| 309 | self.assert_compile( |
| 310 | u, |
| 311 | "UPDATE mytable SET name=(SELECT myothertable.otherid, " |
| 312 | "myothertable.othername FROM myothertable WHERE " |
| 313 | "myothertable.otherid = mytable.myid) " |
| 314 | "WHERE mytable.name = :name_1", |
| 315 | ) |
| 316 | |
| 317 | def test_correlated_update_four(self): |
| 318 | table1 = self.tables.mytable |
nothing calls this directly
no test coverage detected