diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-08-18 13:36:37 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-08-18 16:41:52 +0300 |
commit | b9585e8f983863fc7e1e147f503091a5f82d6ccf (patch) | |
tree | 7654d3ee55aeabe0609eaeb5d0ade9b6847aaa9d /src/test/isolation/isolationtester.c | |
parent | 89c096c56542cdd7355925f826b3c67dc5265155 (diff) |
Add an SSI regression test that tests all interesting permutations in the
order of begin, prepare, and commit of three concurrent transactions that
have conflicts between them.
The test runs for a quite long time, and the expected output file is huge,
but this test caught some serious bugs during development, so seems
worthwhile to keep. The test uses prepared transactions, so it fails if the
server has max_prepared_transactions=0. Because of that, it's marked as
"ignore" in the schedule file.
Dan Ports
Diffstat (limited to 'src/test/isolation/isolationtester.c')
-rw-r--r-- | src/test/isolation/isolationtester.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c index 0f77917fb53..65a8fd2614b 100644 --- a/src/test/isolation/isolationtester.c +++ b/src/test/isolation/isolationtester.c @@ -278,7 +278,11 @@ run_permutation(TestSpec * testspec, int nsteps, Step ** steps) if (testspec->sessions[i]->setupsql) { res = PQexec(conns[i], testspec->sessions[i]->setupsql); - if (PQresultStatus(res) != PGRES_COMMAND_OK) + if (PQresultStatus(res) == PGRES_TUPLES_OK) + { + printResultSet(res); + } + else if (PQresultStatus(res) != PGRES_COMMAND_OK) { fprintf(stderr, "setup of session %s failed: %s", testspec->sessions[i]->name, @@ -340,7 +344,11 @@ run_permutation(TestSpec * testspec, int nsteps, Step ** steps) if (testspec->teardownsql) { res = PQexec(conns[0], testspec->teardownsql); - if (PQresultStatus(res) != PGRES_COMMAND_OK) + if (PQresultStatus(res) == PGRES_TUPLES_OK) + { + printResultSet(res); + } + else if (PQresultStatus(res) != PGRES_COMMAND_OK) { fprintf(stderr, "teardown failed: %s", PQerrorMessage(conns[0])); |