- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitfe09399
committed
Fix 'negative bitmapset member' error
When removing a useless join, we'd remove PHVs that are not used at joinpartner rels or above the join. A PHV that references the join's relidin ph_eval_at is logically "above" the join and thus should not beremoved. We have the following check for that: !bms_is_member(ojrelid, phinfo->ph_eval_at)However, in the case of SJE removing a useless inner join, 'ojrelid' isset to -1, which would trigger the "negative bitmapset member notallowed" error in bms_is_member().Fix it by skipping examining ojrelid for inner joins in this check.Reported-by: Zuming JiangBug: #18260Discussion:https://postgr.es/m/18260-1b6a0c4ae311b837%40postgresql.orgAuthor: Richard GuoReviewed-by: Andrei Lepikhov1 parentaa817c7 commitfe09399
File tree
3 files changed
+29
-1
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+29
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
456 | 456 |
| |
457 | 457 |
| |
458 | 458 |
| |
459 |
| - | |
| 459 | + | |
460 | 460 |
| |
461 | 461 |
| |
462 | 462 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6821 | 6821 |
| |
6822 | 6822 |
| |
6823 | 6823 |
| |
| 6824 | + | |
| 6825 | + | |
| 6826 | + | |
| 6827 | + | |
| 6828 | + | |
| 6829 | + | |
| 6830 | + | |
| 6831 | + | |
| 6832 | + | |
| 6833 | + | |
| 6834 | + | |
| 6835 | + | |
| 6836 | + | |
| 6837 | + | |
| 6838 | + | |
| 6839 | + | |
| 6840 | + | |
| 6841 | + | |
| 6842 | + | |
| 6843 | + | |
6824 | 6844 |
| |
6825 | 6845 |
| |
6826 | 6846 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2600 | 2600 |
| |
2601 | 2601 |
| |
2602 | 2602 |
| |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
2603 | 2611 |
| |
2604 | 2612 |
| |
2605 | 2613 |
| |
|
0 commit comments
Comments
(0)