Thread: BUG #5570: global hash %_SHARED does not work in the new version

BUG #5570: global hash %_SHARED does not work in the new version

From
"Milen"
Date:
The following bug has been logged online:

Bug reference:      5570
Logged by:          Milen
Email address:      mile@avangardsolutions.com
PostgreSQL version: v9.0beta2
Operating system:   Linux
Description:        global hash %_SHARED does not work in the new version
Details:

Hello,
We can't find the global hash %_SHARED in the new version of plperl.c.

The error that we receive from the server when we try to use the global hash
%_SHARED is :

ERROR: Global symbol %_SHARED requires explicit package name

Please inform us for any progress on this issue.

Thanks in advance

Re: BUG #5570: global hash %_SHARED does not work in the new version

From
Alex Hunsaker
Date:
On Fri, Jul 23, 2010 at 10:17, Milen <mile@avangardsolutions.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =C2=A0 =C2=A0 =C2=A05570
> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Milen
> Email address: =C2=A0 =C2=A0 =C2=A0mile@avangardsolutions.com
> PostgreSQL version: v9.0beta2
> Operating system: =C2=A0 Linux
> Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0global hash %_SHARED does not wor=
k in the new version
> Details:
>
> Hello,
> We can't find the global hash %_SHARED in the new version of plperl.c.

Huh, can we get more info? are you using plperl or plperlu?  A
complete testcase would also help.

It works for me:
=3D> SELECT version();
                                                    version
---------------------------------------------------------------------------=
-------------------------------------
 PostgreSQL 9.0beta3 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 4.5.0 20100610 (prerelease), 64-bit

=3D> create or replace function perl_shared() returns void as $$
elog(INFO, $_SHARED{'stuff'});
$_SHARED{'stuff'} =3D '1';
for my $k (keys %_SHARED)
{
    elog(INFO, $k);
}
$$ language plperl;

=3D> select perl_shared();
INFO:
CONTEXT:  PL/Perl function "perl_shared"
INFO:  stuff
CONTEXT:  PL/Perl function "perl_shared"
 perl_shared
-------------

(1 row)

=3D> select perl_shared();
INFO:  1
CONTEXT:  PL/Perl function "perl_shared"
INFO:  stuff
CONTEXT:  PL/Perl function "perl_shared"
 perl_shared
-------------

(1 row)