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)
| 1182 | eq_(found2, wanted) |
| 1183 | |
| 1184 | def test_union_all_lightweight(self, connection): |
| 1185 | """like test_union_all, but breaks the sub-union into |
| 1186 | a subquery with an explicit column reference on the outside, |
| 1187 | more palatable to a wider variety of engines. |
| 1188 | |
| 1189 | """ |
| 1190 | |
| 1191 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1192 | |
| 1193 | u = union(select(t1.c.col3), select(t1.c.col3)).alias() |
| 1194 | |
| 1195 | e = union_all(select(t1.c.col3), select(u.c.col3)) |
| 1196 | |
| 1197 | wanted = [("aaa",), ("aaa",), ("bbb",), ("bbb",), ("ccc",), ("ccc",)] |
| 1198 | found1 = self._fetchall_sorted(connection.execute(e)) |
| 1199 | eq_(found1, wanted) |
| 1200 | |
| 1201 | found2 = self._fetchall_sorted( |
| 1202 | connection.execute(e.alias("foo").select()) |
| 1203 | ) |
| 1204 | eq_(found2, wanted) |
| 1205 | |
| 1206 | @testing.requires.intersect |
| 1207 | def test_intersect(self, connection): |