commit 4850baf8039f2714d01c45a64af7ccbd12bbbd64 Author: Lukas Fittl Date: Sun Jan 10 00:28:33 2021 -0800 PL/pgSQL: Make plpgsql_start_datums and plpgsql_finish_datums extern This allows other source units to have the accompanying functions for the already exported plpgsql_adddatum. diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index cb0ce3900b..fbd0ad8bd0 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -106,8 +106,6 @@ static Node *make_datum_param(PLpgSQL_expr *expr, int dno, int location); static PLpgSQL_row *build_row_from_vars(PLpgSQL_variable **vars, int numvars); static PLpgSQL_type *build_datatype(HeapTuple typeTup, int32 typmod, Oid collation, TypeName *origtypname); -static void plpgsql_start_datums(void); -static void plpgsql_finish_datums(PLpgSQL_function *function); static void compute_function_hashkey(FunctionCallInfo fcinfo, Form_pg_proc procStruct, PLpgSQL_func_hashkey *hashkey, @@ -2272,7 +2270,7 @@ plpgsql_parse_err_condition(char *condname) * plpgsql_start_datums Initialize datum list at compile startup. * ---------- */ -static void +void plpgsql_start_datums(void) { datums_alloc = 128; @@ -2306,7 +2304,7 @@ plpgsql_adddatum(PLpgSQL_datum *newdatum) * plpgsql_finish_datums Copy completed datum info into function struct. * ---------- */ -static void +void plpgsql_finish_datums(PLpgSQL_function *function) { Size copiable_size = 0; diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h index bc6eefb60b..53864ca881 100644 --- a/src/pl/plpgsql/src/plpgsql.h +++ b/src/pl/plpgsql/src/plpgsql.h @@ -1241,6 +1241,8 @@ extern PLpgSQL_recfield *plpgsql_build_recfield(PLpgSQL_rec *rec, extern int plpgsql_recognize_err_condition(const char *condname, bool allow_sqlstate); extern PLpgSQL_condition *plpgsql_parse_err_condition(char *condname); +extern void plpgsql_start_datums(void); +extern void plpgsql_finish_datums(PLpgSQL_function *function); extern void plpgsql_adddatum(PLpgSQL_datum *newdatum); extern int plpgsql_add_initdatums(int **varnos); extern void plpgsql_HashTableInit(void);