plperl: Package-qualify _TD

Failing to do so causes trigger invocation to fail when they are nested
within a function invocation that changes the current package.

Backpatch to 9.1; previous releases used a different method to obtain
_TD.  Per bug report from Mark Murawski (bug #6511)

Author: Alex Hunsaker
This commit is contained in:
Alvaro Herrera 2012-03-19 17:29:05 -03:00
parent 02b183acb4
commit 814e08e895
1 changed files with 1 additions and 1 deletions

View File

@ -2062,7 +2062,7 @@ plperl_call_perl_trigger_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo,
ENTER;
SAVETMPS;
TDsv = get_sv("_TD", 0);
TDsv = get_sv("main::_TD", 0);
if (!TDsv)
elog(ERROR, "couldn't fetch $_TD");