Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
plperl: Package-qualify _TD
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 19 Mar 2012 20:29:05 +0000 (17:29 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 19 Mar 2012 20:29:05 +0000 (17:29 -0300)
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

src/pl/plperl/plperl.c

index fb23ae2d935fb04bc16f78e7af999deaadffd799..7a92f3d8e28374c694ff51b27db0b0203a750e8d 100644 (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");