Commit 69525fc0 authored by Tom Lane's avatar Tom Lane

Remove incorrect increment of lineno, per David Fetter.

Sync HEAD and 8.1 branches of pgbench.
parent ecf4df61
/* /*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.48 2005/11/23 12:19:12 ishii Exp $ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.49 2005/12/10 01:09:07 tgl Exp $
* *
* pgbench: a simple benchmark program for PostgreSQL * pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii * written by Tatsuo Ishii
...@@ -411,6 +411,7 @@ doCustom(CState * state, int n, int debug) ...@@ -411,6 +411,7 @@ doCustom(CState * state, int n, int debug)
CState *st = &state[n]; CState *st = &state[n];
Command **commands; Command **commands;
top:
commands = sql_files[st->use_file]; commands = sql_files[st->use_file];
if (st->listen) if (st->listen)
...@@ -489,6 +490,7 @@ doCustom(CState * state, int n, int debug) ...@@ -489,6 +490,7 @@ doCustom(CState * state, int n, int debug)
{ {
st->state = 0; st->state = 0;
st->use_file = getrand(0, num_files - 1); st->use_file = getrand(0, num_files - 1);
commands = sql_files[st->use_file];
} }
} }
...@@ -572,6 +574,8 @@ doCustom(CState * state, int n, int debug) ...@@ -572,6 +574,8 @@ doCustom(CState * state, int n, int debug)
free(val); free(val);
st->listen = 1; st->listen = 1;
} }
goto top;
} }
} }
...@@ -894,10 +898,8 @@ process_file(char *filename) ...@@ -894,10 +898,8 @@ process_file(char *filename)
fclose(fd); fclose(fd);
return false; return false;
} }
} else { } else
lineno++;
continue; continue;
}
my_commands[lineno] = commands; my_commands[lineno] = commands;
lineno++; lineno++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment