Re: unknownin/out patch (was [HACKERS] PQescapeBytea is

Поиск
Список
Период
Сортировка
От John Gray
Тема Re: unknownin/out patch (was [HACKERS] PQescapeBytea is
Дата
Msg-id 1018343465.3587.56.camel@adzuki
обсуждение исходный текст
Ответ на Re: unknownin/out patch (was [HACKERS] PQescapeBytea is  (Joe Conway <mail@joeconway.com>)
Список pgsql-patches
On Tue, 2002-04-09 at 06:57, Joe Conway wrote:
[snipped]
> > Yes, I was just looking at that also. It doesn't consider the case of n
> > = -1 for MB. See the lines:
> >
> > #ifdef MULTIBYTE
> >    eml = pg_database_encoding_max_length ();
> >
> >    if (eml > 1)
> >    {
> >       sm = 0;
> >       sn = (m + n) * eml + 3;
> >    }
> > #endif
> >
> > When n = -1 this does the wrong thing. And also a few lines later:
> >
> > #ifdef MULTIBYTE
> >    len = pg_mbstrlen_with_len (VARDATA (string), sn - 3);
> >
> > I think both places need to test for n = -1. Do you agree?
> >

Sorry folks! I hadn't thought through the logic of that in the n = -1
and multibyte case. The patch looks OK to me.

John




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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: unknownin/out patch (was [HACKERS] PQescapeBytea is
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: unknownin/out patch (was [HACKERS] PQescapeBytea is