This routine is a no-op since
dd04e95 from 2003, with a macro kept
around for compatibility purposes. This has led to the same code
patterns being copy-pasted around for no effect, sometimes in confusing
ways like in pg_logical_slot_get_changes_guts() from logical.c where the
code was actually incorrect.
This issue has been discussed on two different threads recently, so
rather than living with this legacy, remove any uses of this routine in
the C code to simplify things. The compatibility macro is kept to avoid
breaking any out-of-core modules that depend on it.
Reported-by: Tatsuhito Kasahara, Justin Pryzby
Author: Tatsuhito Kasahara
Discussion: https://postgr.es/m/
20211217200419[email protected]
Discussion: https://postgr.es/m/CAP0=ZVJeeYfAeRfmzqAF2Lumdiv4S4FewyBnZd4DPTrsSQKJKw@mail.gmail.com
/* clean up GUC settings, if we changed any */
restoreLocalGucs(nestlevel);
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
}
}
PG_FINALLY();
PQconsumeInput(conn);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
break;
}
- /* clean up and return the tuplestore */
brin_free_desc(bdesc);
- tuplestore_donestoring(tupstore);
index_close(indexRel, AccessShareLock);
return (Datum) 0;
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
LWLockRelease(pgss->lock);
if (qbuffer)
free(qbuffer);
- tuplestore_donestoring(tupstore);
}
/* Number of output arguments (columns) for pg_stat_statements_info */
/* If cache doesn't exist, we return no records */
if (!ConnectionHash)
- {
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
PG_RETURN_VOID();
- }
hash_seq_init(&scan, ConnectionHash);
while ((entry = (ConnCacheEntry *) hash_seq_search(&scan)))
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
PG_RETURN_VOID();
}
/* internal error */
elog(ERROR, "get_crosstab_tuplestore: SPI_finish() failed");
- tuplestore_donestoring(tupstore);
-
return tupstore;
}
pg_xml_done(xmlerrcxt, false);
- tuplestore_donestoring(tupstore);
-
SPI_finish();
rsinfo->setResult = tupstore;
values[0] = LSNGetDatum(stoppoint);
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
- tuplestore_donestoring(tupstore);
return (Datum) 0;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
PG_RETURN_VOID();
}
FreeDir(dir);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
FreeDir(dir);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
}
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
}
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
rsinfo->returnMode = SFRM_Materialize;
rsinfo->setResult = tupstore;
rsinfo->setDesc = tupdesc;
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
MemoryContextSwitchTo(oldcontext);
}
LWLockRelease(LogicalRepWorkerLock);
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
CHECK_FOR_INTERRUPTS();
}
- tuplestore_donestoring(tupstore);
-
/*
* Logical decoding could have clobbered CurrentResourceOwner during
* transaction management, so restore the executor's value. (This is
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- tuplestore_donestoring(tupstore);
-
LWLockRelease(ReplicationOriginLock);
#undef REPLICATION_ORIGIN_PROGRESS_COLS
LWLockRelease(ReplicationSlotControlLock);
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
LWLockRelease(ShmemIndexLock);
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
PutMemoryContextsStatsTupleStore(tupstore, tupdesc,
TopMemoryContext, NULL, 0);
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
break;
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
(void) split_text(fcinfo, &tstate);
- tuplestore_donestoring(tstate.tupstore);
-
rsi->returnMode = SFRM_Materialize;
rsi->setResult = tstate.tupstore;
rsi->setDesc = tstate.tupdesc;
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
*/
ReleaseTupleDesc(tupdesc);
- tuplestore_donestoring(tupstore);
rsinfo->setResult = tupstore;
/*
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
rsinfo->returnMode = SFRM_Materialize;
rsinfo->setResult = tupstore;
rsinfo->setDesc = tupdesc;
extern void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc,
Datum *values, bool *isnull);
-/* tuplestore_donestoring() used to be required, but is no longer used */
+/* Backwards compatibility macro */
#define tuplestore_donestoring(state) ((void) 0)
extern int tuplestore_alloc_read_pointer(Tuplestorestate *state, int eflags);