Skip to content

Commit 0635c0b

Browse files
committed
Repair plpgsql_validator breakage.
Commit 3a0e4d3 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.
1 parent a1e5705 commit 0635c0b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pl/plpgsql/src/pl_handler.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ plpgsql_validator(PG_FUNCTION_ARGS)
280280
FunctionCallInfoData fake_fcinfo;
281281
FmgrInfo flinfo;
282282
int rc;
283+
TriggerData trigdata;
284+
EventTriggerData etrigdata;
283285

284286
/*
285287
* Connect to SPI manager (is this needed for compilation?)
@@ -298,17 +300,15 @@ plpgsql_validator(PG_FUNCTION_ARGS)
298300
flinfo.fn_mcxt = CurrentMemoryContext;
299301
if (is_dml_trigger)
300302
{
301-
TriggerData trigdata;
302303
MemSet(&trigdata, 0, sizeof(trigdata));
303304
trigdata.type = T_TriggerData;
304305
fake_fcinfo.context = (Node *) &trigdata;
305306
}
306307
else if (is_event_trigger)
307308
{
308-
EventTriggerData trigdata;
309-
MemSet(&trigdata, 0, sizeof(trigdata));
310-
trigdata.type = T_EventTriggerData;
311-
fake_fcinfo.context = (Node *) &trigdata;
309+
MemSet(&etrigdata, 0, sizeof(etrigdata));
310+
etrigdata.type = T_EventTriggerData;
311+
fake_fcinfo.context = (Node *) &etrigdata;
312312
}
313313

314314
/* Test-compile the function */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy