- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit3a82c68
committed
Fix the name collision detection in MERGE/SPLIT partition operations
Both MERGE and SPLIT partition operations support the case when the name of thenew partition matches the name of the existing partition to be merged/split.But the name collision detection doesn't always work as intended. The SPLITpartition operation finds the namespace to search for an existing partitionwithout taking into account the parent's persistence. The MERGE partitionoperation checks for the name collision with simple equal() on RangeVar'ssimply ignoring the search_path.This commit fixes this behavior as follows. 1. The SPLIT partition operation now finds the namespace to search for an existing partition according to the parent's persistence. 2. The MERGE partition operation now checks for the name collision similarly to the SPLIT partition operation using RangeVarGetAndCheckCreationNamespace() and get_relname_relid().Reported-by: Alexander LakhinDiscussion:https://postgr.es/m/86b4f1e3-0b5d-315c-9225-19860d64d685%40gmail.comAuthor: Dmitry Koval, Alexander Korotkov1 parent97e5b00 commit3a82c68
File tree
5 files changed
+72
-13
lines changed- src
- backend/commands
- test/regress
- expected
- sql
5 files changed
+72
-13
lines changedLines changed: 51 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20409 | 20409 |
| |
20410 | 20410 |
| |
20411 | 20411 |
| |
| 20412 | + | |
20412 | 20413 |
| |
20413 | 20414 |
| |
20414 | 20415 |
| |
| |||
20601 | 20602 |
| |
20602 | 20603 |
| |
20603 | 20604 |
| |
| 20605 | + | |
| 20606 | + | |
20604 | 20607 |
| |
20605 | 20608 |
| |
20606 | 20609 |
| |
| |||
20617 | 20620 |
| |
20618 | 20621 |
| |
20619 | 20622 |
| |
20620 |
| - | |
20621 |
| - | |
20622 |
| - | |
20623 |
| - | |
20624 |
| - | |
| 20623 | + | |
| 20624 | + | |
| 20625 | + | |
| 20626 | + | |
| 20627 | + | |
| 20628 | + | |
| 20629 | + | |
| 20630 | + | |
| 20631 | + | |
| 20632 | + | |
| 20633 | + | |
| 20634 | + | |
| 20635 | + | |
| 20636 | + | |
| 20637 | + | |
| 20638 | + | |
| 20639 | + | |
| 20640 | + | |
| 20641 | + | |
| 20642 | + | |
| 20643 | + | |
| 20644 | + | |
| 20645 | + | |
| 20646 | + | |
| 20647 | + | |
| 20648 | + | |
| 20649 | + | |
| 20650 | + | |
20625 | 20651 |
| |
20626 |
| - | |
| 20652 | + | |
| 20653 | + | |
| 20654 | + | |
| 20655 | + | |
| 20656 | + | |
| 20657 | + | |
| 20658 | + | |
| 20659 | + | |
| 20660 | + | |
| 20661 | + | |
| 20662 | + | |
| 20663 | + | |
| 20664 | + | |
20627 | 20665 |
| |
20628 | 20666 |
| |
20629 | 20667 |
| |
| |||
20635 | 20673 |
| |
20636 | 20674 |
| |
20637 | 20675 |
| |
20638 |
| - | |
| 20676 | + | |
20639 | 20677 |
| |
20640 | 20678 |
| |
20641 | 20679 |
| |
| |||
20644 | 20682 |
| |
20645 | 20683 |
| |
20646 | 20684 |
| |
20647 |
| - | |
20648 |
| - | |
20649 |
| - | |
20650 |
| - | |
| 20685 | + | |
| 20686 | + | |
| 20687 | + | |
| 20688 | + | |
| 20689 | + | |
| 20690 | + | |
20651 | 20691 |
| |
20652 | 20692 |
| |
20653 | 20693 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
214 | 214 |
| |
215 | 215 |
| |
216 | 216 |
| |
217 |
| - | |
| 217 | + | |
| 218 | + | |
218 | 219 |
| |
219 | 220 |
| |
220 | 221 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1547 | 1547 |
| |
1548 | 1548 |
| |
1549 | 1549 |
| |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
1550 | 1558 |
| |
1551 | 1559 |
| |
1552 | 1560 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
143 |
| - | |
| 143 | + | |
| 144 | + | |
144 | 145 |
| |
145 | 146 |
| |
146 | 147 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
931 | 931 |
| |
932 | 932 |
| |
933 | 933 |
| |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
934 | 943 |
| |
935 | 944 |
| |
936 | 945 |
| |
|
0 commit comments
Comments
(0)