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

Поиск
Список
Период
Сортировка
От Tim Bunce
Тема Re: BUG #5334: Version 2.22 of Perl Safe module breaks UTF8 PostgreSQL 8.4
Дата
Msg-id 20100222140323.GF1018@timac.local
обсуждение исходный текст
Ответ на Re: BUG #5334: Version 2.22 of Perl Safe module breaks UTF8 PostgreSQL 8.4  (Alex Hunsaker <badalex@gmail.com>)
Список 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.Bunce@pobox.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@gmail.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.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Ravi
Дата:
Сообщение: Fwd: exception in plsql
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Fwd: exception in plsql