Re: Re: [COMMITTERS] pgsql: Force strings passed to and from plperl to be in UTF8 encoding.

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Force strings passed to and from plperl to be in UTF8 encoding.
Date: 2011-10-03 17:07:01
Message-ID: CAFaPBrTRG2+4rA+QowWWx0dHrhXNBG0eoP+dhEKS19-yTJ9i2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Oct 3, 2011 at 04:20, Amit Khandekar
<amit(dot)khandekar(at)enterprisedb(dot)com> wrote:

> Is there a plan to commit this issue? I am still seeing this issue on
> PG 9.1 STABLE branch. Attached is a small patch that targets only the
> specific issue in the described testcase :
>
> create or replace function zerob() returns text as $$ return
> "abcd\0efg"; $$ language plperl;
> SELECT zerob();
>
> The patch does the perl data validation in the function utf_u2e() itself.

I think thats fine, but as coded it will verify the string twice in
the GetDatabaseEncoding() != PG_UTF8 case (once for
pg_do_encoding_conversion() and again with the added
pg_verify_mbstr_len), which seems a bit wasteful.

It might be worth adding a regression test also...

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message User Itagaki 2011-10-04 02:36:30 textsearch-ja - textsearch_groonga: Support server version 9.1 and
Previous Message Tom Lane 2011-10-03 16:18:49 pgsql: ProcedureCreate neglected to record dependencies on default expr

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-10-03 18:07:49 Re: Bug with pg_ctl -w/wait and config-only directories
Previous Message Tom Lane 2011-10-03 16:54:56 Re: Bug with pg_ctl -w/wait and config-only directories