Re: BUG #5334: Version 2.22 of Perl Safe module breaks UTF8 PostgreSQL 8.4

From: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5334: Version 2.22 of Perl Safe module breaks UTF8 PostgreSQL 8.4
Date: 2010-02-22 14:03:23
Message-ID: 20100222140323.GF1018@timac.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Feb 19, 2010 at 02:22:33PM -0700, Alex Hunsaker wrote:
> On Fri, Feb 19, 2010 at 14:00, Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com> wrote:
> > On Fri, Feb 19, 2010 at 09:32:38AM -0700, Alex Hunsaker wrote:
> >> On Fri, Feb 19, 2010 at 09:18, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
> >> > It seems to me a more correct fix would be to require utf8; inside of
> >> > the safe like we do strict.
> >> > ....
> >> > Id favor this approach as if you have utf8 strings the likely hood
> >> > that you want ::upgrade, ::downgrade, ::encode, ::valid or ::is_utf8
> >> > is fairly high.  Then again, no one has complained thus far...  Maybe
> >> > thats just me :)
> >>
> >> On second thought, I dont think we should import any of those by
> >> default.  And your hack for just SWASHNEW is better.
>
> Funny.. Safe.pm already does this (share various utf8:: functions) so
> I think there should be no question that what you did in the patch
> below is correct and a bug with Safe. Sorry for the handwaves, that
> was me trying to understand the problem and your fix. :)

No worries. It took a lot of head banging for me to understand the
problem and the fix :)

> > Here's the corresponding perlbug http://rt.perl.org/rt3/Ticket/Display.html?id=72942
>
> Hrm... Is the require utf8; strictly needed? A reading of perldoc utf8
> seems to say the do { my $unicode = ... } (aka load utf8_heavy.pl)
> part should make it all work fine.
>
> It also seems to still work
> t/safeutf8.t ....... ok
>
> *shrug*

Yesh, it's not really needed. It's harmless though, and avoids someone
thinking they can simply replace the regex with the require.

> > I'll retest 8.4 and 9.0 against this on Monday.
>
> Ill see if I can squeeze in some pg 8.4 perl 5.10.1 linux x86_64
> testing tonight of the above. (Ill just reply to the perl bug )

The patched version of Safe works fine for me with 8.4.2 and 9.0.
So I no patch to PostgreSQL is needed. Though once Safe 2.23 is
released then Safe 2.20 should be detected and disabled, like Safe 2.21.
It's probably not very important though as I'd expect perl 5.12 to be
released with Safe 2.23 so very few people would have 2.20..2.22.

Tim.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2010-02-22 15:34:44 Re: Fwd: exception in plsql
Previous Message Ravi 2010-02-22 14:03:02 Fwd: exception in plsql