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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-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

Browse pgsql-bugs by date

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

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2005-12-07 21:24:05 Inherited Constraints
Previous Message Kaitlin Bledsoe 2005-12-07 20:03:06 Save money! zlwuanej