Thread: Patch to allow contrib/pgbench files to have blank lines

Patch to allow contrib/pgbench files to have blank lines

From
David Fetter
Date:
Folks,

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 :)

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

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

From
Tatsuo Ishii
Date:
> 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 :)

Thanks. I have committed your patches to current and 8.1 stable.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

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

From
Bruce Momjian
Date:
Patch already applied.  Thanks.

---------------------------------------------------------------------------

David Fetter wrote:
> Folks,
>
> 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 :)
>
> Cheers,
> D
> --
> David Fetter david@fetter.org http://fetter.org/
> phone: +1 415 235 3778
>
> Remember to vote!

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

From
Nicolas Barbier
Date:
On 11/23/05, David Fetter <david@fetter.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

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

From
David Fetter
Date:
On Wed, Nov 23, 2005 at 10:24:00PM +0900, Tatsuo Ishii 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 :)
>
> Thanks. I have committed your patches to current and 8.1 stable.

Please apply the following patch that removes an unneeded (and broken)
counter increment.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

Attachment

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

From
Tom Lane
Date:
David Fetter <david@fetter.org> writes:
> Please apply the following patch that removes an unneeded (and broken)
> counter increment.

Done.

            regards, tom lane