Re: [v9.2] make_greater_string() does not return a string in some cases

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [v9.2] make_greater_string() does not return a string in some cases
Date: 2011-10-03 18:13:46
Message-ID: CA+TgmoZbG64f8yF-wzY9JvcMHz4yCRx7rVqv4_DXtjHqJ44Y=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Sep 29, 2011 at 6:24 AM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)oss(dot)ntt(dot)co(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jim Gray 2011-10-03 20:30:42 BUG #6237: Hang during install database initialization
Previous Message Vikas Mehta 2011-10-03 18:13:27 Re: BUG #6234: Memory leak from PQexec

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-10-03 18:14:44 Re: Bug with pg_ctl -w/wait and config-only directories
Previous Message Dave Page 2011-10-03 18:11:22 Re: Bug with pg_ctl -w/wait and config-only directories