| 1250 | |
| 1251 | @testing.requires.except_ |
| 1252 | def test_except_style2(self, connection): |
| 1253 | # same as style1, but add alias().select() to the except_(). |
| 1254 | # sqlite can handle it now. |
| 1255 | |
| 1256 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1257 | |
| 1258 | e = except_( |
| 1259 | union( |
| 1260 | select(t1.c.col3, t1.c.col4), |
| 1261 | select(t2.c.col3, t2.c.col4), |
| 1262 | select(t3.c.col3, t3.c.col4), |
| 1263 | ) |
| 1264 | .alias() |
| 1265 | .select(), |
| 1266 | select(t2.c.col3, t2.c.col4), |
| 1267 | ) |
| 1268 | |
| 1269 | wanted = [ |
| 1270 | ("aaa", "aaa"), |
| 1271 | ("aaa", "ccc"), |
| 1272 | ("bbb", "aaa"), |
| 1273 | ("bbb", "bbb"), |
| 1274 | ("ccc", "bbb"), |
| 1275 | ("ccc", "ccc"), |
| 1276 | ] |
| 1277 | |
| 1278 | found1 = self._fetchall_sorted(connection.execute(e)) |
| 1279 | eq_(found1, wanted) |
| 1280 | |
| 1281 | found2 = self._fetchall_sorted(connection.execute(e.alias().select())) |
| 1282 | eq_(found2, wanted) |
| 1283 | |
| 1284 | @testing.fails_on( |
| 1285 | ["sqlite", testing.requires._mysql_not_mariadb_104_not_mysql8031], |