Patch to allow contrib/pgbench files to have blank lines

Started by David Fetterover 20 years ago6 messagesbugs
Jump to latest
#1David Fetter
david@fetter.org

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!

Attachments:

pgbench_blank_lines_ok.difftext/plain; charset=us-asciiDownload+16-16
#2Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: David Fetter (#1)
Re: [PATCHES] Patch to allow contrib/pgbench files to have blank

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

#3Bruce Momjian
bruce@momjian.us
In reply to: David Fetter (#1)
Re: Patch to allow contrib/pgbench files to have blank lines

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
#4Nicolas Barbier
nicolas.barbier@gmail.com
In reply to: David Fetter (#1)
Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines

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

#5David Fetter
david@fetter.org
In reply to: Tatsuo Ishii (#2)
Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines

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!

Attachments:

fix_pgbench.difftext/plain; charset=us-asciiDownload+0-1
#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Fetter (#5)
Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines

David Fetter <david@fetter.org> writes:

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

Done.

regards, tom lane