summaryrefslogtreecommitdiff
path: root/src/test/isolation/isolationtester.c
diff options
context:
space:
mode:
authorTom Lane2018-10-17 19:06:38 +0000
committerTom Lane2018-10-17 19:06:57 +0000
commit9958b2b2a8cc25e8d791fc965fff3f0496163be6 (patch)
tree174be845d3a5395ad542e9e7ac19ec6db1c8031d /src/test/isolation/isolationtester.c
parenta7a1b44516e7db89104c06440f759c2831fcb0ff (diff)
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.
Diffstat (limited to 'src/test/isolation/isolationtester.c')
-rw-r--r--src/test/isolation/isolationtester.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 4ecad038bdc..62097ab961e 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -594,7 +594,7 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
if (!PQsendQuery(conn, step->sql))
{
fprintf(stdout, "failed to send query for step %s: %s\n",
- step->name, PQerrorMessage(conns[1 + step->session]));
+ step->name, PQerrorMessage(conn));
exit_nicely();
}
@@ -743,7 +743,7 @@ try_complete_step(Step *step, int flags)
PQntuples(res) != 1)
{
fprintf(stderr, "lock wait query failed: %s",
- PQerrorMessage(conn));
+ PQerrorMessage(conns[0]));
exit_nicely();
}
waiting = ((PQgetvalue(res, 0, 0))[0] == 't');