Re: Plperl trigger variables no longer global
От
Alex Hunsaker
Тема
Re: Plperl trigger variables no longer global
Дата
Msg-id
BANLkTi=GdrMOdKQndgYq46chmfULMiEUuA@mail.gmail.com
Ответ на
Re: Plperl trigger variables no longer global (Alex Hunsaker)
Список
Дерево обсуждения
Plperl trigger variables no longer global Greg Sabino Mullane <greg@endpoint.com>
Re: Plperl trigger variables no longer global Alex Hunsaker <badalex@gmail.com>
Re: Plperl trigger variables no longer global Alex Hunsaker <badalex@gmail.com>
Re: Plperl trigger variables no longer global Alvaro Herrera <alvherre@commandprompt.com>
Re: Plperl trigger variables no longer global Alex Hunsaker <badalex@gmail.com>
Re: Plperl trigger variables no longer global Robert Haas <robertmhaas@gmail.com>
Re: Plperl trigger variables no longer global Alex Hunsaker <badalex@gmail.com>
Re: Plperl trigger variables no longer global Greg Sabino Mullane <greg@endpoint.com>
Re: Plperl trigger variables no longer global Alvaro Herrera <alvherre@commandprompt.com>
On Wed, May 4, 2011 at 16:20, Alex Hunsaker wrote:
>
> This seems to be broken by
> http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=ef19dc6d39dd2490ff61489da55d95d6941140bf
> (Set up PLPerl trigger data using C code instead of Perl code.)
>
> Im not sure what the right fix is. Copying what
> plperl_call_trigger_func() does for _TD ("get_sv("_TD", GV_ADD); ..."
> into plperl_create_sub() does not seem to work.
Just a small clarification, this only breaks when running under use strict;.
After playing with it a bit more I see 2 clear options:
1) make $_TD global like %_SHARED. This should not cause any problems
as we make $_TD private via local() before each trigger call. Also pre
9.1 non trigger functions could still access and check the definedness
of $_TD so if someone was relying on that (for whatever unknown
reason) that will work again.
2) revert the optimization
#1 is very small and I don't see any downsides (maybe we should local
$_TD before regular perl calls as well??). Find it attached.
В списке pgsql-bugs по дате отправления