Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

Next:From: Tom LaneDate: 2002-04-09 13:20:22
Subject: Re: timeout implementation issues
Previous:From: Michael LoftisDate: 2002-04-09 08:47:53
Subject: Re: timeout implementation issues

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group