From 27e082b0c6e564facfbf54b56090fdcc4bf44cca Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Thu, 27 Sep 2018 11:24:49 -0700 Subject: [PATCH] Clean up in the wake of TupleDescGetSlot() removal / 10763358c3f. The previous commit wasn't careful enough to remove all traces of TupleDescGetSlot(). Besides fixing the oversight of not removing TupleDescGetSlot()'s declaration, this also removes FuncCallContext->slot. That was documented to be for use in combination with TupleDescGetSlot(), a cursory search over extensions finds no users, and there doesn't seem to be convincing reasons to keep it around. If we later in the v12 release cycle find users, we can re-consider this part of the commit. Reported-By: Michael Paquier Discussion: https://postgr.es/m/20180926000413.GC1659@paquier.xyz --- doc/src/sgml/xfunc.sgml | 8 -------- src/backend/utils/fmgr/funcapi.c | 16 ---------------- src/include/funcapi.h | 11 ----------- 3 files changed, 35 deletions(-) diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 3f3d46414c..1a74d93173 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -2870,14 +2870,6 @@ typedef struct FuncCallContext */ uint64 max_calls; - /* - * OPTIONAL pointer to result slot - * - * This is obsolete and only present for backward compatibility, viz, - * user-defined SRFs that use the deprecated TupleDescGetSlot(). - */ - TupleTableSlot *slot; - /* * OPTIONAL pointer to miscellaneous user-provided context information * diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c index d5984b415e..30923518f5 100644 --- a/src/backend/utils/fmgr/funcapi.c +++ b/src/backend/utils/fmgr/funcapi.c @@ -88,7 +88,6 @@ init_MultiFuncCall(PG_FUNCTION_ARGS) */ retval->call_cntr = 0; retval->max_calls = 0; - retval->slot = NULL; retval->user_fctx = NULL; retval->attinmeta = NULL; retval->tuple_desc = NULL; @@ -129,21 +128,6 @@ per_MultiFuncCall(PG_FUNCTION_ARGS) { FuncCallContext *retval = (FuncCallContext *) fcinfo->flinfo->fn_extra; - /* - * Clear the TupleTableSlot, if present. This is for safety's sake: the - * Slot will be in a long-lived context (it better be, if the - * FuncCallContext is pointing to it), but in most usage patterns the - * tuples stored in it will be in the function's per-tuple context. So at - * the beginning of each call, the Slot will hold a dangling pointer to an - * already-recycled tuple. We clear it out here. - * - * Note: use of retval->slot is obsolete as of 8.0, and we expect that it - * will always be NULL. This is just here for backwards compatibility in - * case someone creates a slot anyway. - */ - if (retval->slot != NULL) - ExecClearTuple(retval->slot); - return retval; } diff --git a/src/include/funcapi.h b/src/include/funcapi.h index 01aa208c5e..6a9eb4366c 100644 --- a/src/include/funcapi.h +++ b/src/include/funcapi.h @@ -74,14 +74,6 @@ typedef struct FuncCallContext */ uint64 max_calls; - /* - * OPTIONAL pointer to result slot - * - * This is obsolete and only present for backwards compatibility, viz, - * user-defined SRFs that use the deprecated TupleDescGetSlot(). - */ - TupleTableSlot *slot; - /* * OPTIONAL pointer to miscellaneous user-provided context information * @@ -221,8 +213,6 @@ extern TupleDesc build_function_result_tupdesc_t(HeapTuple procTuple); * TupleDesc based on a named relation. * TupleDesc TypeGetTupleDesc(Oid typeoid, List *colaliases) - Use to get a * TupleDesc based on a type OID. - * TupleTableSlot *TupleDescGetSlot(TupleDesc tupdesc) - Builds a - * TupleTableSlot, which is not needed anymore. * TupleGetDatum(TupleTableSlot *slot, HeapTuple tuple) - get a Datum * given a tuple and a slot. *---------- @@ -240,7 +230,6 @@ extern TupleDesc BlessTupleDesc(TupleDesc tupdesc); extern AttInMetadata *TupleDescGetAttInMetadata(TupleDesc tupdesc); extern HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values); extern Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple); -extern TupleTableSlot *TupleDescGetSlot(TupleDesc tupdesc); /*----------