Re: plperl & sort

From: "Alex Hunsaker" <badalex(at)gmail(dot)com>
To: "Andrew Gierth" <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: plperl & sort
Date: 2008-11-06 16:25:24
Message-ID: 34d269d40811060825w166f4ce9q6407b73e804c63b4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Nov 6, 2008 at 09:00, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
> If it helps any, I've tracked down in the perl guts exactly why this
> happens:

Cool

> Notice, though, that without ithreads, the COP points directly to the
> stash, but with ithreads, it points instead to the _name_ of the stash
> (e.g. "main"). The problem arises because with Safe in use, the
> package created by Safe to use as a container _thinks_ that its name
> is "main" even though it's not, so the COPs compiled inside it point
> to the name "main" rather than to the real name of the container.

Ok so I kind of analyzed it right, just missed the threading issue.
(namely that its referencing a different main when we execute it
outside of "Safe")

FYI the commit that changd it is
http://perl5.git.perl.org/?p=perl.git;a=commitdiff;h=18537ab8315c273284bfe269f1678095c399c053;hp=89cb812aee601e19db5eb36b2c6e74980a348661

It been this way since 1999 with the descriptive commit message 'avoid
stash pointers in optree under USE_ITHREADS'

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michal szymanski 2008-11-06 16:38:12 BUG #4516: FOUND variable does not work after RETURN QUERY
Previous Message Alex Hunsaker 2008-11-06 16:14:29 Re: plperl & sort