Re: PQescapeBytea is not multibyte aware

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: PQescapeBytea is not multibyte aware
Дата
Msg-id 3CADEDFC.508@joeconway.com
обсуждение исходный текст
Ответ на PQescapeBytea is not multibyte aware  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Ответы Re: PQescapeBytea is not multibyte aware  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> 
> OTOH, I was surprised to read your message because I had assumed the
> damage was being done much further upstream, viz during collection of
> the query string by pq_getstr().  Do we need to think twice about that
> processing, as well?
> 

I just looked in pq_getstr() I see:

#ifdef MULTIBYTE
p = (char *) pg_client_to_server((unsigned char *) s->data, s->len);
if (p != s->data)          /* actual conversion has been done? */


and in pg_client_to_server I see:

if (ClientEncoding->encoding == DatabaseEncoding->encoding)return s;


So I'm guessing that in Tatsuo's case, both client and database encoding 
are the same, and therefore the string was passed as-is downstream. I 
think you're correct that in a client/database encoding mismatch 
scenario, there would be bigger problems. Thoughts on this?

Joe





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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PQescapeBytea is not multibyte aware
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PQescapeBytea is not multibyte aware