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

2005-12-09 Thread David Fetter
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 [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778

Remember to vote!
Index: contrib/pgbench/pgbench.c
===
RCS file: /projects/cvsroot/pgsql/contrib/pgbench/pgbench.c,v
retrieving revision 1.48
diff -c -r1.48 pgbench.c
*** contrib/pgbench/pgbench.c   23 Nov 2005 12:19:12 -  1.48
--- contrib/pgbench/pgbench.c   9 Dec 2005 23:25:47 -
***
*** 895,901 
return false;
}
} else {
-   lineno++;
continue;
}
  
--- 895,900 

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


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

2005-12-09 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes:
 Please apply the following patch that removes an unneeded (and broken)
 counter increment.

Done.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


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

2005-12-07 Thread Nicolas Barbier
On 11/23/05, David Fetter [EMAIL PROTECTED] 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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


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

2005-11-22 Thread David Fetter
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 [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778

Remember to vote!
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 -  1.46
--- contrib/pgbench/pgbench.c   23 Nov 2005 02:41:42 -
***
*** 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;

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly