postgres.git / summary / log / commit / refs

commit    7a1e7b291d0691461cff5d2ae7eff114f035f6de
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Wed Oct 17 19:06:38 2018 +0000
First released in: 12.0, 9.3.25, 9.4.20, 9.5.15, 9.6.11, 10.6, 11.1

    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.


src/test/isolation/isolationtester.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c index 18e1445d81c..4660cb48c61 100644 --- a/src/test/isolation/isolationtester.c +++ b/src/test/isolation/isolationtester.c @@ -600,7 +600,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(); } @@ -728,7 +728,7 @@ try_complete_step(Step *step, int flags) if (PQresultStatus(res) != PGRES_TUPLES_OK) { fprintf(stderr, "lock wait query failed: %s", - PQerrorMessage(conn)); + PQerrorMessage(conns[0])); exit_nicely(); } ntuples = PQntuples(res); [parent: fb38d9a2e1ed]