From 4132dbec69dd4d437e132e57a74a98a40cdcf776 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 24 Jul 2017 18:08:08 -0400 Subject: Fix partitioning crashes during error reporting. In various places where we reverse-map a tuple before calling ExecBuildSlotValueDescription, we neglected to ensure that the slot descriptor matched the tuple stored in it. Amit Langote and Amit Khandekar, reviewed by Etsuro Fujita Discussion: http://postgr.es/m/CAJ3gD9cqpP=WvJj=dv1ONkPWjy8ZuUaOM4_x86i3uQPas=0_jg@mail.gmail.com --- src/backend/executor/execMain.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/backend/executor/execMain.c') diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index b22de785167..78cbcd1a324 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -1879,6 +1879,7 @@ ExecPartitionCheck(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, if (map != NULL) { tuple = do_convert_tuple(tuple, map); + ExecSetSlotDescriptor(slot, tupdesc); ExecStoreTuple(tuple, slot, InvalidBuffer, false); } } @@ -1956,6 +1957,7 @@ ExecConstraints(ResultRelInfo *resultRelInfo, if (map != NULL) { tuple = do_convert_tuple(tuple, map); + ExecSetSlotDescriptor(slot, tupdesc); ExecStoreTuple(tuple, slot, InvalidBuffer, false); } } @@ -2003,6 +2005,7 @@ ExecConstraints(ResultRelInfo *resultRelInfo, if (map != NULL) { tuple = do_convert_tuple(tuple, map); + ExecSetSlotDescriptor(slot, tupdesc); ExecStoreTuple(tuple, slot, InvalidBuffer, false); } } @@ -2112,6 +2115,7 @@ ExecWithCheckOptions(WCOKind kind, ResultRelInfo *resultRelInfo, if (map != NULL) { tuple = do_convert_tuple(tuple, map); + ExecSetSlotDescriptor(slot, tupdesc); ExecStoreTuple(tuple, slot, InvalidBuffer, false); } } -- cgit v1.2.3