Re: [v9.2] make_greater_string() does not return a string in some cases - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [v9.2] make_greater_string() does not return a string in some cases
Date
Msg-id CA+TgmoZbG64f8yF-wzY9JvcMHz4yCRx7rVqv4_DXtjHqJ44Y=w@mail.gmail.com
Whole thread Raw
In response to Re: [v9.2] make_greater_string() does not return a string in some cases  (Kyotaro HORIGUCHI <horiguchi.kyotaro@oss.ntt.co.jp>)
Responses Re: [v9.2] make_greater_string() does not return a string in some cases
List pgsql-hackers
On Thu, Sep 29, 2011 at 6:24 AM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@oss.ntt.co.jp> wrote:
> This is new version of make_greater_string patch.

According to the comments in the original source code, the purpose of
savelastchar is to avoid confusing pg_mbcliplen().  You've preserved
savelastchar only for the case where datatype == BYTEAOID, while
making it the increment function's job not to do anything permanent
unless it also returns true.  But it seems to me that if the datatype
is BYTEAOID then there's no need to restore anything at all, because
we're not going to call pg_mbcliplen() in that case anyway.  So I
think the logic here can be simplified.

Also, you haven't completely fixed the style issues.  Function
definitions should look like this:

static void
thingy()
{
}

Not like this:

static void thingy()
{
}

Opening curly braces should be on a line by themselves, not at the end
of the preceding if, while, etc. line.

"finnaly" is spelled incorrectly.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Bug with pg_ctl -w/wait and config-only directories
Next
From: Andrew Dunstan
Date:
Subject: Re: Bug with pg_ctl -w/wait and config-only directories