mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-27 22:41:57 +02:00
Repair plpgsql_validator breakage.
Commit 3a0e4d36eb
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.
This commit is contained in:
parent
a1e5705c9f
commit
0635c0b524
@ -280,6 +280,8 @@ plpgsql_validator(PG_FUNCTION_ARGS)
|
||||
FunctionCallInfoData fake_fcinfo;
|
||||
FmgrInfo flinfo;
|
||||
int rc;
|
||||
TriggerData trigdata;
|
||||
EventTriggerData etrigdata;
|
||||
|
||||
/*
|
||||
* Connect to SPI manager (is this needed for compilation?)
|
||||
@ -298,17 +300,15 @@ plpgsql_validator(PG_FUNCTION_ARGS)
|
||||
flinfo.fn_mcxt = CurrentMemoryContext;
|
||||
if (is_dml_trigger)
|
||||
{
|
||||
TriggerData trigdata;
|
||||
MemSet(&trigdata, 0, sizeof(trigdata));
|
||||
trigdata.type = T_TriggerData;
|
||||
fake_fcinfo.context = (Node *) &trigdata;
|
||||
}
|
||||
else if (is_event_trigger)
|
||||
{
|
||||
EventTriggerData trigdata;
|
||||
MemSet(&trigdata, 0, sizeof(trigdata));
|
||||
trigdata.type = T_EventTriggerData;
|
||||
fake_fcinfo.context = (Node *) &trigdata;
|
||||
MemSet(&etrigdata, 0, sizeof(etrigdata));
|
||||
etrigdata.type = T_EventTriggerData;
|
||||
fake_fcinfo.context = (Node *) &etrigdata;
|
||||
}
|
||||
|
||||
/* Test-compile the function */
|
||||
|
Loading…
Reference in New Issue
Block a user