pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix PL/Tcl's encoding conversion logic.
Date: Wed, 02 Mar 2016 18:30:22 +0000
Message-ID: <E1abBXS-0006ju-Ax@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix PL/Tcl's encoding conversion logic.

PL/Tcl appears to contain logic to convert strings between the database
encoding and UTF8, which is the only encoding modern Tcl will deal with.
However, that code has been disabled since commit 034895125d648b86, which
made it "#if defined(UNICODE_CONVERSION)" and neglected to provide any way
for that symbol to become defined.  That might have been all right back
in 2001, but these days we take a dim view of allowing strings with
incorrect encoding into the database.

Remove the conditional compilation, fix warnings about signed/unsigned char
conversions, clean up assorted places that didn't bother with conversions.
(Notably, there were lots of assumptions that database table and field
names didn't need conversion...)

Add a regression test based on plpython_unicode.  It's not terribly
thorough, but better than no test at all.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c8c7c93de8e116d802eddfd8821f8f77588aee00

Modified Files
--------------
src/pl/tcl/Makefile                   |   2 +-
src/pl/tcl/expected/pltcl_unicode.out |  45 ++++++++++++
src/pl/tcl/pltcl.c                    | 132 ++++++++++++++++------------------
src/pl/tcl/sql/pltcl_unicode.sql      |  38 ++++++++++
4 files changed, 145 insertions(+), 72 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1abBXS-0006ju-Ax@gemulon.postgresql.org>
Permalink:  ../E1abBXS-0006ju-Ax@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1abBXS-0006ju-Ax@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix PL/Tcl's encoding conversion logic.
  In-Reply-To: <E1abBXS-0006ju-Ax@gemulon.postgresql.org>
  References: <E1abBXS-0006ju-Ax@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox