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

Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines

From: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines
Date: 2005-12-07 21:09:09
Message-ID: b0f3f5a10512071309p48c6e8c1nc3eeb2d2c7b52ba8@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
On 11/23/05, David Fetter <david(at)fetter(dot)org> wrote:

> Having blank lines in -f scripts was causing silent failures.  This
> fixes it, for some value of "fixes."  If it's OK, please apply to 8.1
> CURRENT and CVS TIP :)

> if (strncmp(buf, "\n", 1) != 0) {
>     commands = process_commands(buf);
>     if (commands == NULL)
>     {
>         fclose(fd);
>         return false;
>     }
> } else {
>     lineno++;

Above line will cause a skip in the my_commands array, leaving a
garbage pointer. Removing it will fix things.

>     continue;
> }
>
> my_commands[lineno] = commands;

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

In response to

pgsql-bugs by date

Next:From: Kasahara KenichiDate: 2005-12-08 04:35:34
Subject: There is a doubt of fatal bug on PostgreSQL 8.0.4.
Previous:From: Tom LaneDate: 2005-12-07 15:40:53
Subject: Re: BUG #2096: bug in a SPI sample document

pgsql-patches by date

Next:From: Simon RiggsDate: 2005-12-07 21:24:05
Subject: Inherited Constraints
Previous:From: Kaitlin BledsoeDate: 2005-12-07 20:03:06
Subject: Save money! zlwuanej

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