Commit 159cff5
committed
Check the relevant index element in ON CONFLICT unique index inference.
ON CONFLICT unique index inference had a thinko that could affect cases
where the user-supplied inference clause required that an attribute
match a particular (user specified) collation and/or opclass.
infer_collation_opclass_match() has to check for opclass and/or
collation matches and that the attribute is in the list of attributes or
expressions known to be in the definition of the index under
consideration. The bug was that these two conditions weren't necessarily
evaluated for the same index attribute.
Author: Peter Geoghegan
Discussion: CAM3SWZR4uug=WvmGk7UgsqHn2MkEzy9YU-+8jKGO4JPhesyeWg@mail.gmail.com
Backpatch: 9.5, where ON CONFLICT was introduced1 parent faab14e commit 159cff5
File tree
3 files changed
+60
-16
lines changed- src
- backend/optimizer/util
- test/regress
- expected
- sql
3 files changed
+60
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
620 | | - | |
| 619 | + | |
621 | 620 | | |
622 | 621 | | |
623 | 622 | | |
| |||
682 | 681 | | |
683 | 682 | | |
684 | 683 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
690 | 688 | | |
691 | 689 | | |
692 | 690 | | |
| |||
708 | 706 | | |
709 | 707 | | |
710 | 708 | | |
711 | | - | |
| 709 | + | |
712 | 710 | | |
713 | 711 | | |
714 | | - | |
715 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
716 | 715 | | |
717 | 716 | | |
718 | 717 | | |
| |||
735 | 734 | | |
736 | 735 | | |
737 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
738 | 741 | | |
739 | 742 | | |
740 | 743 | | |
| |||
750 | 753 | | |
751 | 754 | | |
752 | 755 | | |
753 | | - | |
754 | | - | |
755 | | - | |
| 756 | + | |
| 757 | + | |
756 | 758 | | |
757 | | - | |
758 | | - | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
759 | 773 | | |
760 | 774 | | |
761 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
144 | 162 | | |
145 | 163 | | |
146 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| |||
0 commit comments