Re: BUG #5571: global hash %_SHARED is not declared as global in the new version
От | Alex Hunsaker |
---|---|
Тема | Re: BUG #5571: global hash %_SHARED is not declared as global in the new version |
Дата | |
Msg-id | AANLkTinhL=sSbRe4xsczTt_OsFWvWqB2y7wjgRa5v7rB@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #5571: global hash %_SHARED is not declared as global in the new version ("mile" <mile@avangardsolutions.com>) |
Ответы |
Re: BUG #5571: global hash %_SHARED is not declared as global in the new version
|
Список | pgsql-bugs |
On Mon, Jul 26, 2010 at 03:58, mile <mile@avangardsolutions.com> wrote: > To reproduce this use the following function: > > create or replace function perl_shared() returns void as $$ > use strict; > elog(INFO, $_SHARED{'stuff'}); > $_SHARED{'stuff'} = '1'; > for my $k (keys %_SHARED) > { > elog(INFO, $k); > } > $$ language plperl; Great, Thanks! The below patch fixes it for me. Basically we declared %_SHARED inside the PostgreSQL::InServer; package when it needed to be declared in main::. For the curious 8.4 and down don't have this issue as the "use vars qw(%_SHARED)" is in the PERL_BOOT define, which gets run at the interp start-up time (basically its perl -e PERL_BOOT). *** a/src/pl/plperl/plc_perlboot.pl --- b/src/pl/plperl/plc_perlboot.pl *************** *** 2,7 **** --- 2,8 ---- # $PostgreSQL: pgsql/src/pl/plperl/plc_perlboot.pl,v 1.5 2010/02/16 21:39:52 adunstan Exp $ use 5.008001; + use vars qw(%_SHARED); PostgreSQL::InServer::Util::bootstrap(); *************** *** 9,15 **** package PostgreSQL::InServer; use strict; use warnings; - use vars qw(%_SHARED); sub plperl_warn { (my $msg = shift) =~ s/\(eval \d+\) //g; --- 10,15 ----
Вложения
В списке pgsql-bugs по дате отправления: