(
self, testcase, inner_select: testing.Variation
)
| 3995 | ) |
| 3996 | @testing.variation("inner_select", ["select", "compound"]) |
| 3997 | def test_exists_regroup_modifiers( |
| 3998 | self, testcase, inner_select: testing.Variation |
| 3999 | ): |
| 4000 | a = table("a", column("x"), column("y")) |
| 4001 | b = table("b", column("x"), column("y")) |
| 4002 | if inner_select.compound: |
| 4003 | stmt = select(a.c.x).union_all(select(b.c.x)) |
| 4004 | elif inner_select.select: |
| 4005 | stmt = select(a.c.x) |
| 4006 | else: |
| 4007 | inner_select.fail() |
| 4008 | |
| 4009 | exists = stmt.exists() |
| 4010 | |
| 4011 | if inner_select.compound: |
| 4012 | with expect_raises_message( |
| 4013 | exc.InvalidRequestError, |
| 4014 | "Can only apply this operation to a plain SELECT construct", |
| 4015 | ): |
| 4016 | testcase(exists, b) |
| 4017 | else: |
| 4018 | regrouped = testcase(exists, b) |
| 4019 | assert regrouped.element.compare( |
| 4020 | testcase(exists.element, b).scalar_subquery() |
| 4021 | ) |
| 4022 | |
| 4023 | def test_column_subquery_plain(self): |
| 4024 | t = self._fixture() |
nothing calls this directly
no test coverage detected