summaryrefslogtreecommitdiffstats
path: root/src/bin/pgbench/pgbench.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pgbench/pgbench.c')
-rw-r--r--src/bin/pgbench/pgbench.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 895afcb..e5ee1a0 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3778,10 +3778,21 @@ advanceConnectionState(TState *thread, CState *st, StatsData *agg)
case CSTATE_START_COMMAND:
command = sql_script[st->use_file].commands[st->command];
- /* Transition to script end processing if done */
+ /*
+ * Transition to script end processing if done, but close up
+ * shop if a pipeline is open at this point.
+ */
if (command == NULL)
{
- st->state = CSTATE_END_TX;
+ if (PQpipelineStatus(st->con) == PQ_PIPELINE_OFF)
+ st->state = CSTATE_END_TX;
+ else
+ {
+ pg_log_error("client %d aborted: end of script reached with pipeline open",
+ st->id);
+ st->state = CSTATE_ABORTED;
+ }
+
break;
}