forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit99cea49
committed
Fix copying data into slots with FDW batching
Commitb676ac4 optimized handling of tuple slots with bulk insertsinto foreign tables, so that the slots are initialized only once andreused for all batches. The data was however copied into the slots onlyafter the initialization, inserting duplicate values when the slot getsreused. Fixed by moving the ExecCopySlot outside the init branch.The existing postgres_fdw tests failed to catch this due to insertingdata into foreign tables without unique indexes, and then checking onlythe number of inserted rows. This adds a new test with both a uniqueindex and a check of inserted values.Reported-by: Alexander PyhalovDiscussion:https://postgr.es/m/7a8cf8d56b3d18e5c0bccd6cd42d04ac%40postgrespro.ru1 parent6b787d9 commit99cea49
File tree
3 files changed
+115
-6
lines changed- contrib/postgres_fdw
- expected
- sql
- src/backend/executor
3 files changed
+115
-6
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9761 | 9761 |
| |
9762 | 9762 |
| |
9763 | 9763 |
| |
9764 |
| - | |
| 9764 | + | |
| 9765 | + | |
| 9766 | + | |
| 9767 | + | |
| 9768 | + | |
| 9769 | + | |
| 9770 | + | |
| 9771 | + | |
| 9772 | + | |
| 9773 | + | |
| 9774 | + | |
| 9775 | + | |
| 9776 | + | |
| 9777 | + | |
| 9778 | + | |
| 9779 | + | |
| 9780 | + | |
| 9781 | + | |
| 9782 | + | |
| 9783 | + | |
| 9784 | + | |
| 9785 | + | |
| 9786 | + | |
| 9787 | + | |
| 9788 | + | |
| 9789 | + | |
| 9790 | + | |
| 9791 | + | |
| 9792 | + | |
| 9793 | + | |
| 9794 | + | |
| 9795 | + | |
| 9796 | + | |
| 9797 | + | |
| 9798 | + | |
| 9799 | + | |
| 9800 | + | |
| 9801 | + | |
| 9802 | + | |
| 9803 | + | |
| 9804 | + | |
| 9805 | + | |
| 9806 | + | |
| 9807 | + | |
| 9808 | + | |
| 9809 | + | |
| 9810 | + | |
| 9811 | + | |
| 9812 | + | |
| 9813 | + | |
| 9814 | + | |
| 9815 | + | |
| 9816 | + | |
| 9817 | + | |
| 9818 | + | |
| 9819 | + | |
| 9820 | + | |
| 9821 | + | |
| 9822 | + | |
| 9823 | + | |
| 9824 | + | |
| 9825 | + | |
| 9826 | + | |
| 9827 | + | |
| 9828 | + | |
| 9829 | + | |
| 9830 | + | |
| 9831 | + | |
| 9832 | + | |
| 9833 | + | |
| 9834 | + | |
| 9835 | + | |
| 9836 | + | |
| 9837 | + | |
| 9838 | + | |
| 9839 | + | |
| 9840 | + | |
| 9841 | + | |
| 9842 | + | |
| 9843 | + | |
| 9844 | + | |
9765 | 9845 |
| |
9766 | 9846 |
| |
9767 | 9847 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3083 | 3083 |
| |
3084 | 3084 |
| |
3085 | 3085 |
| |
3086 |
| - | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
3087 | 3114 |
| |
3088 | 3115 |
| |
3089 | 3116 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
717 | 717 |
| |
718 | 718 |
| |
719 | 719 |
| |
720 |
| - | |
721 |
| - | |
722 | 720 |
| |
723 | 721 |
| |
724 | 722 |
| |
725 |
| - | |
726 |
| - | |
727 | 723 |
| |
728 | 724 |
| |
729 | 725 |
| |
730 | 726 |
| |
731 | 727 |
| |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
732 | 734 |
| |
733 | 735 |
| |
734 | 736 |
| |
|
0 commit comments
Comments
(0)