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