Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 09230e5

Browse filesBrowse files
committed
Remove some obsolete procedure-specific code from PLs
Since procedures are now declared to return void, code that handled return values for procedures separately is no longer necessary.
1 parent dd9ed0b commit 09230e5
Copy full SHA for 09230e5

File tree

Expand file treeCollapse file tree

3 files changed

+7
-13
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-13
lines changed

‎src/pl/plperl/plperl.c

Copy file name to clipboardExpand all lines: src/pl/plperl/plperl.c
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,8 +2832,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger, bool is_event_trigger)
28322832
* Get the required information for input conversion of the
28332833
* return value.
28342834
************************************************************/
2835-
if (!is_trigger && !is_event_trigger &&
2836-
procStruct->prokind != PROKIND_PROCEDURE)
2835+
if (!is_trigger && !is_event_trigger)
28372836
{
28382837
Oid rettype = procStruct->prorettype;
28392838

‎src/pl/plpython/plpy_procedure.c

Copy file name to clipboardExpand all lines: src/pl/plpython/plpy_procedure.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ PLy_procedure_create(HeapTuple procTup, Oid fn_oid, bool is_trigger)
206206

207207
/*
208208
* get information required for output conversion of the return value,
209-
* but only if this isn't a trigger or procedure.
209+
* but only if this isn't a trigger.
210210
*/
211-
if (!is_trigger && procStruct->prokind != PROKIND_PROCEDURE)
211+
if (!is_trigger)
212212
{
213213
Oid rettype = procStruct->prorettype;
214214
HeapTuple rvTypeTup;

‎src/pl/tcl/pltcl.c

Copy file name to clipboardExpand all lines: src/pl/tcl/pltcl.c
+4-9Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ typedef struct pltcl_proc_desc
146146
Oid result_typid; /* OID of fn's result type */
147147
FmgrInfo result_in_func; /* input function for fn's result type */
148148
Oid result_typioparam; /* param to pass to same */
149-
bool fn_is_procedure; /* true if this is a procedure */
150149
bool fn_retisset; /* true if function returns a set */
151150
bool fn_retistuple; /* true if function returns composite */
152151
bool fn_retisdomain; /* true if function returns domain */
@@ -982,7 +981,7 @@ pltcl_func_handler(PG_FUNCTION_ARGS, pltcl_call_state *call_state,
982981
retval = (Datum) 0;
983982
fcinfo->isnull = true;
984983
}
985-
else if (fcinfo->isnull && !prodesc->fn_is_procedure)
984+
else if (fcinfo->isnull)
986985
{
987986
retval = InputFunctionCall(&prodesc->result_in_func,
988987
NULL,
@@ -1040,13 +1039,11 @@ pltcl_func_handler(PG_FUNCTION_ARGS, pltcl_call_state *call_state,
10401039
call_state);
10411040
retval = HeapTupleGetDatum(tup);
10421041
}
1043-
else if (!prodesc->fn_is_procedure)
1042+
else
10441043
retval = InputFunctionCall(&prodesc->result_in_func,
10451044
utf_u2e(Tcl_GetStringResult(interp)),
10461045
prodesc->result_typioparam,
10471046
-1);
1048-
else
1049-
retval = 0;
10501047

10511048
return retval;
10521049
}
@@ -1523,9 +1520,7 @@ compile_pltcl_function(Oid fn_oid, Oid tgreloid,
15231520
* Get the required information for input conversion of the
15241521
* return value.
15251522
************************************************************/
1526-
prodesc->fn_is_procedure = (procStruct->prokind == PROKIND_PROCEDURE);
1527-
1528-
if (!is_trigger && !is_event_trigger && !prodesc->fn_is_procedure)
1523+
if (!is_trigger && !is_event_trigger)
15291524
{
15301525
Oid rettype = procStruct->prorettype;
15311526

@@ -2218,7 +2213,7 @@ pltcl_returnnext(ClientData cdata, Tcl_Interp *interp,
22182213
tuplestore_puttuple(call_state->tuple_store, tuple);
22192214
}
22202215
}
2221-
else if (!prodesc->fn_is_procedure)
2216+
else
22222217
{
22232218
Datum retval;
22242219
bool isNull = false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.