Skip to content

Commit 5d91d78

Browse files
committed
Fix minor bug in isolationtester.
If the lock wait query failed, isolationtester would report the PQerrorMessage from some other connection, meaning there would be no message or an unrelated one. This seems like a pretty unlikely occurrence, but if it did happen, this bug could make it really difficult/confusing to figure out what happened. That seems to justify patching all the way back. In passing, clean up another place where the "wrong" conn was used for an error report. That one's not actually buggy because it's a different alias for the same connection, but it's still confusing to the reader.
1 parent 312f632 commit 5d91d78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/isolation/isolationtester.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
593593
if (!PQsendQuery(conn, step->sql))
594594
{
595595
fprintf(stdout, "failed to send query for step %s: %s\n",
596-
step->name, PQerrorMessage(conns[1 + step->session]));
596+
step->name, PQerrorMessage(conn));
597597
exit_nicely();
598598
}
599599

@@ -742,7 +742,7 @@ try_complete_step(Step *step, int flags)
742742
PQntuples(res) != 1)
743743
{
744744
fprintf(stderr, "lock wait query failed: %s",
745-
PQerrorMessage(conn));
745+
PQerrorMessage(conns[0]));
746746
exit_nicely();
747747
}
748748
waiting = ((PQgetvalue(res, 0, 0))[0] == 't');

0 commit comments

Comments
 (0)