forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitffe12d1

Richard Guo
Remove the RTE_GROUP RTE if we drop the groupClause
For an EXISTS subquery, the only thing that matters is whether itreturns zero or more than zero rows. Therefore, we remove certain SQLfeatures that won't affect that, among them the GROUP BY clauses.After we drop the groupClause, we'd better remove the RTE_GROUP RTEand clear the hasGroupRTE flag, as they depend on the groupClause.Failing to do so could result in a bogus RTE_GROUP entry in the parentquery, leading to an assertion failure on the hasGroupRTE flag.Reported-by: David RowleyAuthor: Richard GuoDiscussion:https://postgr.es/m/CAApHDvp2_yht8uPLyWO-kVGWZhYvx5zjGfSrg4fBQ9fsC13V0g@mail.gmail.com1 parentd32d146 commitffe12d1
File tree
3 files changed
+47
-0
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+47
-0
lines changedLines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1539 | 1539 |
| |
1540 | 1540 |
| |
1541 | 1541 |
| |
| 1542 | + | |
| 1543 | + | |
1542 | 1544 |
| |
1543 | 1545 |
| |
1544 | 1546 |
| |
| |||
1607 | 1609 |
| |
1608 | 1610 |
| |
1609 | 1611 |
| |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1610 | 1634 |
| |
1611 | 1635 |
| |
1612 | 1636 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3182 | 3182 |
| |
3183 | 3183 |
| |
3184 | 3184 |
| |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
3185 | 3200 |
| |
3186 | 3201 |
| |
3187 | 3202 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
818 | 818 |
| |
819 | 819 |
| |
820 | 820 |
| |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
821 | 829 |
| |
822 | 830 |
| |
823 | 831 |
| |
|
0 commit comments
Comments
(0)