|
1 | 1 | /* |
2 | | - * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.48 2005/11/23 12:19:12 ishii Exp $ |
| 2 | + * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.49 2005/12/10 01:09:07 tgl Exp $ |
3 | 3 | * |
4 | 4 | * pgbench: a simple benchmark program for PostgreSQL |
5 | 5 | * written by Tatsuo Ishii |
@@ -411,6 +411,7 @@ doCustom(CState * state, int n, int debug) |
411 | 411 | CState*st=&state[n]; |
412 | 412 | Command**commands; |
413 | 413 |
|
| 414 | +top: |
414 | 415 | commands=sql_files[st->use_file]; |
415 | 416 |
|
416 | 417 | if (st->listen) |
@@ -489,6 +490,7 @@ doCustom(CState * state, int n, int debug) |
489 | 490 | { |
490 | 491 | st->state=0; |
491 | 492 | st->use_file=getrand(0,num_files-1); |
| 493 | +commands=sql_files[st->use_file]; |
492 | 494 | } |
493 | 495 | } |
494 | 496 |
|
@@ -572,6 +574,8 @@ doCustom(CState * state, int n, int debug) |
572 | 574 | free(val); |
573 | 575 | st->listen=1; |
574 | 576 | } |
| 577 | + |
| 578 | +gototop; |
575 | 579 | } |
576 | 580 | } |
577 | 581 |
|
@@ -894,10 +898,8 @@ process_file(char *filename) |
894 | 898 | fclose(fd); |
895 | 899 | return false; |
896 | 900 | } |
897 | | -}else { |
898 | | -lineno++; |
| 901 | +}else |
899 | 902 | continue; |
900 | | -} |
901 | 903 |
|
902 | 904 | my_commands[lineno]=commands; |
903 | 905 | lineno++; |
|