Commit a81fbcf
committed
Fix bug with whole-row references to append subplans.
ExecEvalWholeRowVar incorrectly supposed that it could "bless" the source
TupleTableSlot just once per query. But if the input is coming from an
Append (or, perhaps, other cases?) more than one slot might be returned
over the query run. This led to "record type has not been registered"
errors when a composite datum was extracted from a non-blessed slot.
This bug has been there a long time; I guess it escaped notice because when
dealing with subqueries the planner tends to expand whole-row Vars into
RowExprs, which don't have the same problem. It is possible to trigger
the problem in all active branches, though, as illustrated by the added
regression test.1 parent 2e7469d commit a81fbcf
File tree
3 files changed
+47
-14
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+47
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
716 | 715 | | |
717 | 716 | | |
718 | 717 | | |
| |||
790 | 789 | | |
791 | 790 | | |
792 | 791 | | |
793 | | - | |
794 | | - | |
795 | 792 | | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | 793 | | |
801 | 794 | | |
802 | 795 | | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
| 796 | + | |
810 | 797 | | |
811 | 798 | | |
| 799 | + | |
812 | 800 | | |
813 | 801 | | |
814 | 802 | | |
| |||
825 | 813 | | |
826 | 814 | | |
827 | 815 | | |
| 816 | + | |
| 817 | + | |
828 | 818 | | |
829 | 819 | | |
830 | 820 | | |
| |||
882 | 872 | | |
883 | 873 | | |
884 | 874 | | |
| 875 | + | |
885 | 876 | | |
886 | 877 | | |
887 | 878 | | |
| |||
892 | 883 | | |
893 | 884 | | |
894 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
895 | 900 | | |
896 | 901 | | |
897 | 902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
0 commit comments