dbTalk Databases Forums  

[BUGS] Patch to allow contrib/pgbench files to have blank lines

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Patch to allow contrib/pgbench files to have blank lines in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Fetter
 
Posts: n/a

Default [BUGS] Patch to allow contrib/pgbench files to have blank lines - 11-22-2005 , 08:46 PM






--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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 (AT) fetter (DOT) org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pgbench_blank_lines_ok.diff"

Index: contrib/pgbench/pgbench.c
================================================== =================
RCS file: /projects/cvsroot/pgsql/contrib/pgbench/pgbench.c,v
retrieving revision 1.46
diff -c -r1.46 pgbench.c
*** contrib/pgbench/pgbench.c 22 Nov 2005 18:17:04 -0000 1.46
--- contrib/pgbench/pgbench.c 23 Nov 2005 02:41:42 -0000
***************
*** 886,896 ****
{
Command *commands;

! commands = process_commands(buf);
! if (commands == NULL)
! {
! fclose(fd);
! return false;
}

my_commands[lineno] = commands;
--- 886,902 ----
{
Command *commands;

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

my_commands[lineno] = commands;

--h31gzZEtNLTqOjlF
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--h31gzZEtNLTqOjlF--

Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] Patch to allow contrib/pgbench files to have blank lines - 11-26-2005 , 09:15 PM







Patch already applied. Thanks.

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

David Fetter wrote:
Quote:
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 (AT) fetter (DOT) org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!
[ Attachment, skipping... ]

Quote:
---------------------------(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 (AT) candle (DOT) 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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.