Commit 0635c0b5 authored by Robert Haas's avatar Robert Haas

Repair plpgsql_validator breakage.

Commit 3a0e4d36 arranged to
reference stack-allocated variables after they were out of scope.
That's no good, so let's arrange to not do that after all.
parent a1e5705c
...@@ -280,6 +280,8 @@ plpgsql_validator(PG_FUNCTION_ARGS) ...@@ -280,6 +280,8 @@ plpgsql_validator(PG_FUNCTION_ARGS)
FunctionCallInfoData fake_fcinfo; FunctionCallInfoData fake_fcinfo;
FmgrInfo flinfo; FmgrInfo flinfo;
int rc; int rc;
TriggerData trigdata;
EventTriggerData etrigdata;
/* /*
* Connect to SPI manager (is this needed for compilation?) * Connect to SPI manager (is this needed for compilation?)
...@@ -298,17 +300,15 @@ plpgsql_validator(PG_FUNCTION_ARGS) ...@@ -298,17 +300,15 @@ plpgsql_validator(PG_FUNCTION_ARGS)
flinfo.fn_mcxt = CurrentMemoryContext; flinfo.fn_mcxt = CurrentMemoryContext;
if (is_dml_trigger) if (is_dml_trigger)
{ {
TriggerData trigdata;
MemSet(&trigdata, 0, sizeof(trigdata)); MemSet(&trigdata, 0, sizeof(trigdata));
trigdata.type = T_TriggerData; trigdata.type = T_TriggerData;
fake_fcinfo.context = (Node *) &trigdata; fake_fcinfo.context = (Node *) &trigdata;
} }
else if (is_event_trigger) else if (is_event_trigger)
{ {
EventTriggerData trigdata; MemSet(&etrigdata, 0, sizeof(etrigdata));
MemSet(&trigdata, 0, sizeof(trigdata)); etrigdata.type = T_EventTriggerData;
trigdata.type = T_EventTriggerData; fake_fcinfo.context = (Node *) &etrigdata;
fake_fcinfo.context = (Node *) &trigdata;
} }
/* Test-compile the function */ /* Test-compile the function */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment