like test_union_all, but breaks the sub-union into a subquery with an explicit column reference on the outside, more palatable to a wider variety of engines.
(self, connection)
| 1250 | eq_(found2, wanted) |
| 1251 | |
| 1252 | def test_union_all_lightweight(self, connection): |
| 1253 | """like test_union_all, but breaks the sub-union into |
| 1254 | a subquery with an explicit column reference on the outside, |
| 1255 | more palatable to a wider variety of engines. |
| 1256 | |
| 1257 | """ |
| 1258 | |
| 1259 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1260 | |
| 1261 | u = union(select(t1.c.col3), select(t1.c.col3)).alias() |
| 1262 | |
| 1263 | e = union_all(select(t1.c.col3), select(u.c.col3)) |
| 1264 | |
| 1265 | wanted = [("aaa",), ("aaa",), ("bbb",), ("bbb",), ("ccc",), ("ccc",)] |
| 1266 | found1 = self._fetchall_sorted(connection.execute(e)) |
| 1267 | eq_(found1, wanted) |
| 1268 | |
| 1269 | found2 = self._fetchall_sorted( |
| 1270 | connection.execute(e.alias("foo").select()) |
| 1271 | ) |
| 1272 | eq_(found2, wanted) |
| 1273 | |
| 1274 | @testing.requires.intersect |
| 1275 | def test_intersect(self, connection): |