aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pgbench/pgbench.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index b67ad5e8231..e0ac131a0e2 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -2725,9 +2725,11 @@ readCommandResponse(CState *st, char *varprefix)
while (res != NULL)
{
- /* look now at the next result to know whether it is the last */
+ bool is_last;
+
+ /* peek at the next result to know whether the current is last */
next_res = PQgetResult(st->con);
- bool is_last = (next_res == NULL);
+ is_last = (next_res == NULL);
switch (PQresultStatus(res))
{