Re: BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, digoal(at)126(dot)com
Subject: Re: BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding
Date: 2014-02-20 04:39:40
Message-ID: 20140220043940.GA3064539@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Wed, Feb 19, 2014 at 08:22:13PM -0500, Tom Lane wrote:
> The more I looked into mbutils.c, the less happy I got. The attached
> proposed patch takes care of the missing-verification hole in
> pg_do_encoding_conversion() and pg_server_to_any(), and also gets rid
> of what I believe to be obsolete provisions in pg_do_encoding_conversion
> to "work" if called outside a transaction --- if you consider it working
> to completely fail to honor its API contract. That should no longer be
> necessary now that we perform client<->server encoding conversions via
> perform_default_encoding_conversion rather than here.

I like these changes. In particular, coping with the absence of a conversion
function by calling ereport(LOG) and returning the source string was wrong for
nearly every caller, but you'd need to try an encoding like MULE_INTERNAL to
notice the problem. Good riddance.

> How much of this is back-patch material, do you think?

None of it. While many of the failures to validate against a character
encoding are clear bugs, applications hum along in spite of such bugs and
break when we tighten the checks. I don't see a concern to override that
here. Folks who want the tighter checking have some workarounds available.

Thanks,
nm

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message rgacogne-bugs 2014-02-20 19:05:45 BUG #9296: Symbol resolution issue: undefined symbol: CheckFunctionValidatorAccess
Previous Message Michael Paquier 2014-02-20 04:25:55 Re: BUG #9278: Error: SQLSTATE[42702]: Ambiguous column: 7 ERROR: column reference "tid" is ambiguous LINE 8: ...

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2014-02-20 04:53:57 Re: Priority table or Cache table
Previous Message Amit Kapila 2014-02-20 03:26:09 Re: Priority table or Cache table