Commit 8a8afe2
committed
Fix some problems in check_new_partition_bound().
Account for the fact that the highest bound less than or equal to the
upper bound might be either the lower or the upper bound of the
overlapping partition, depending on whether the proposed partition
completely contains the existing partition or merely overlaps it.
Also, we need not continue searching for even greater bound in
partition_bound_bsearch() once we find the first bound that is *equal*
to the probe, because we don't have duplicate datums. That spends
cycles needlessly.
Amit Langote, per a report from Amul Sul. Cosmetic changes by me.
Discussion: http://postgr.es/m/CAAJ_b94XgbqVoXMyxxs63CaqWoMS1o2gpHiU0F7yGnJBnvDc_A%40mail.gmail.com1 parent 05bd889 commit 8a8afe2
File tree
3 files changed
+62
-16
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+62
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
745 | | - | |
| 744 | + | |
| 745 | + | |
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
761 | 758 | | |
762 | 759 | | |
763 | 760 | | |
764 | 761 | | |
765 | 762 | | |
766 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
767 | 775 | | |
768 | 776 | | |
769 | 777 | | |
770 | | - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
771 | 790 | | |
772 | 791 | | |
773 | 792 | | |
774 | 793 | | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
775 | 806 | | |
776 | 807 | | |
777 | 808 | | |
| |||
1957 | 1988 | | |
1958 | 1989 | | |
1959 | 1990 | | |
1960 | | - | |
1961 | | - | |
| 1991 | + | |
| 1992 | + | |
1962 | 1993 | | |
1963 | 1994 | | |
1964 | 1995 | | |
| |||
1990 | 2021 | | |
1991 | 2022 | | |
1992 | 2023 | | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
1993 | 2027 | | |
1994 | 2028 | | |
1995 | 2029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
554 | 560 | | |
555 | 561 | | |
556 | 562 | | |
| |||
655 | 661 | | |
656 | 662 | | |
657 | 663 | | |
658 | | - | |
| 664 | + | |
659 | 665 | | |
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
663 | 669 | | |
664 | 670 | | |
| 671 | + | |
| 672 | + | |
665 | 673 | | |
666 | 674 | | |
667 | 675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
522 | 526 | | |
523 | 527 | | |
524 | 528 | | |
| |||
0 commit comments