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

From: John Gray <jgray(at)azuli(dot)co(dot)uk>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-patches(at)postgresql(dot)org, lockhart(at)fourpalms(dot)org
Subject: Re: unknownin/out patch (was [HACKERS] PQescapeBytea is
Date: 2002-04-09 09:11:02
Message-ID: 1018343465.3587.56.camel@adzuki
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-04-09 13:20:22 Re: timeout implementation issues
Previous Message Michael Loftis 2002-04-09 08:47:53 Re: timeout implementation issues

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2002-04-09 18:13:19 Re: unknownin/out patch (was [HACKERS] PQescapeBytea is
Previous Message Joe Conway 2002-04-09 05:57:47 Re: unknownin/out patch (was [HACKERS] PQescapeBytea is