summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-04-29 21:56:28 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-04-29 21:56:28 -0400
commit8109a3c14486ff204b27a9c6e6df6a79c0735219 (patch)
tree5af101c5eea0682e1a31df9a58a1a9b1c3e90e96 /src
parent59c2df3ae8947c4c06217d1b330cfa529f480e17 (diff)
Fix bogus list-iteration code in pg_regress.c, affecting ecpg tests only.
While looking at a recent buildfarm failure in the ecpg tests, I wondered why the pg_regress output claimed the stderr part of the test failed, when the regression diffs were clearly for the stdout part. Looking into it, the reason is that pg_regress.c's logic for iterating over three parallel lists is wrong, and has been wrong since it was written: it advances the "tag" pointer at a different place in the loop than the other two pointers. Fix that.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/pg_regress.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index afb39649b78..b1c73c6d23b 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1899,14 +1899,11 @@ run_schedule(const char *schedule, test_function tfunc)
*/
for (rl = resultfiles[i], el = expectfiles[i], tl = tags[i];
rl != NULL; /* rl and el have the same length */
- rl = rl->next, el = el->next)
+ rl = rl->next, el = el->next,
+ tl = tl ? tl->next : NULL)
{
bool newdiff;
- if (tl)
- tl = tl->next; /* tl has the same length as rl and el
- * if it exists */
-
newdiff = results_differ(tests[i], rl->str, el->str);
if (newdiff && tl)
{
@@ -1986,14 +1983,11 @@ run_single_test(const char *test, test_function tfunc)
*/
for (rl = resultfiles, el = expectfiles, tl = tags;
rl != NULL; /* rl and el have the same length */
- rl = rl->next, el = el->next)
+ rl = rl->next, el = el->next,
+ tl = tl ? tl->next : NULL)
{
bool newdiff;
- if (tl)
- tl = tl->next; /* tl has the same length as rl and el if it
- * exists */
-
newdiff = results_differ(test, rl->str, el->str);
if (newdiff && tl)
{