aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-02-17 09:52:02 +0900
committerMichael Paquier <michael@paquier.xyz>2022-02-17 09:52:02 +0900
commitd61a361d1aef1231db61162d99b635b89c73169d (patch)
tree87cdc9beef527e6ff005748e5ef7029cfd302cce /src/backend/utils
parent46208923446651a58c49115d17b4de6da4934c71 (diff)
downloadpostgresql-d61a361d1aef1231db61162d99b635b89c73169d.tar.gz
postgresql-d61a361d1aef1231db61162d99b635b89c73169d.zip
Remove all traces of tuplestore_donestoring() in the C code
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.GQ17618@telsasoft.com Discussion: https://postgr.es/m/CAP0=ZVJeeYfAeRfmzqAF2Lumdiv4S4FewyBnZd4DPTrsSQKJKw@mail.gmail.com
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/mcxtfuncs.c3
-rw-r--r--src/backend/utils/adt/pgstatfuncs.c9
-rw-r--r--src/backend/utils/adt/varlena.c2
-rw-r--r--src/backend/utils/misc/guc.c2
-rw-r--r--src/backend/utils/misc/pg_config.c1
-rw-r--r--src/backend/utils/mmgr/portalmem.c3
6 files changed, 0 insertions, 20 deletions
diff --git a/src/backend/utils/adt/mcxtfuncs.c b/src/backend/utils/adt/mcxtfuncs.c
index 28cb9d3ff10..c7c95adf97d 100644
--- a/src/backend/utils/adt/mcxtfuncs.c
+++ b/src/backend/utils/adt/mcxtfuncs.c
@@ -152,9 +152,6 @@ pg_get_backend_memory_contexts(PG_FUNCTION_ARGS)
PutMemoryContextsStatsTupleStore(tupstore, tupdesc,
TopMemoryContext, NULL, 0);
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 15cb17ace4f..30e8dfa7c12 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -555,9 +555,6 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS)
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
@@ -953,9 +950,6 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
break;
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
@@ -1936,9 +1930,6 @@ pg_stat_get_slru(PG_FUNCTION_ARGS)
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- /* clean up and return the tuplestore */
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index b73cebfdb5d..eda9c1e42c0 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -4855,8 +4855,6 @@ text_to_table(PG_FUNCTION_ARGS)
(void) split_text(fcinfo, &tstate);
- tuplestore_donestoring(tstate.tupstore);
-
rsi->returnMode = SFRM_Materialize;
rsi->setResult = tstate.tupstore;
rsi->setDesc = tstate.tupdesc;
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 568ac62c2ab..9d0208ec98a 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10206,8 +10206,6 @@ show_all_file_settings(PG_FUNCTION_ARGS)
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
- tuplestore_donestoring(tupstore);
-
return (Datum) 0;
}
diff --git a/src/backend/utils/misc/pg_config.c b/src/backend/utils/misc/pg_config.c
index 7a13212f991..d916d7b2c47 100644
--- a/src/backend/utils/misc/pg_config.c
+++ b/src/backend/utils/misc/pg_config.c
@@ -85,7 +85,6 @@ pg_config(PG_FUNCTION_ARGS)
*/
ReleaseTupleDesc(tupdesc);
- tuplestore_donestoring(tupstore);
rsinfo->setResult = tupstore;
/*
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c
index 236f450a2be..7885344164f 100644
--- a/src/backend/utils/mmgr/portalmem.c
+++ b/src/backend/utils/mmgr/portalmem.c
@@ -1204,9 +1204,6 @@ pg_cursor(PG_FUNCTION_ARGS)
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;