From a5ed5106a40ee937e4ded086723aa6b824ccf154 Mon Sep 17 00:00:00 2001 From: Colm McHugh Date: Thu, 19 Dec 2024 14:43:41 +0000 Subject: [PATCH] PG17 compatibility: ensure get_progress() output is consistent in regress test isolation_progress_monitoring by adding an ORDER BY clause. The implementation of get_progress() uses a tuplestore to hold the step and progress values, and tuplestore does not provide any guarantee on the ordering of the tuples so applying ORDER BY ensures stable test output. Also make the output more user friendly by including the column names. --- .../isolation_progress_monitoring.out | 60 +++++++++---------- .../spec/isolation_progress_monitoring.spec | 4 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/test/regress/expected/isolation_progress_monitoring.out b/src/test/regress/expected/isolation_progress_monitoring.out index 6b8391e3f..eafb0ecb9 100644 --- a/src/test/regress/expected/isolation_progress_monitoring.out +++ b/src/test/regress/expected/isolation_progress_monitoring.out @@ -70,21 +70,21 @@ step s3-start-operation: SELECT sample_operation(3778, 30, 9); step show-progress: - SELECT show_progress(1337); - SELECT show_progress(3778); + SELECT step, progress FROM show_progress(1337) ORDER BY 1, 2; + SELECT step, progress FROM show_progress(3778) ORDER BY 1, 2; -show_progress +step|progress --------------------------------------------------------------------- -(0,0) -(1,0) -(0,0) -(1,0) + 0| 0 + 0| 0 + 1| 0 + 1| 0 (4 rows) -show_progress +step|progress --------------------------------------------------------------------- -(0,0) -(1,0) + 0| 0 + 1| 0 (2 rows) step release-locks-1: @@ -109,21 +109,21 @@ t (1 row) step show-progress: - SELECT show_progress(1337); - SELECT show_progress(3778); + SELECT step, progress FROM show_progress(1337) ORDER BY 1, 2; + SELECT step, progress FROM show_progress(3778) ORDER BY 1, 2; -show_progress +step|progress --------------------------------------------------------------------- -(0,-1) -(1,0) -(0,2) -(1,0) + 0| -1 + 0| 2 + 1| 0 + 1| 0 (4 rows) -show_progress +step|progress --------------------------------------------------------------------- -(0,9) -(1,0) + 0| 9 + 1| 0 (2 rows) step release-locks-2: @@ -148,21 +148,21 @@ t (1 row) step show-progress: - SELECT show_progress(1337); - SELECT show_progress(3778); + SELECT step, progress FROM show_progress(1337) ORDER BY 1, 2; + SELECT step, progress FROM show_progress(3778) ORDER BY 1, 2; -show_progress +step|progress --------------------------------------------------------------------- -(0,-1) -(1,-1) -(0,2) -(1,2) + 0| -1 + 0| 2 + 1| -1 + 1| 2 (4 rows) -show_progress +step|progress --------------------------------------------------------------------- -(0,9) -(1,9) + 0| 9 + 1| 9 (2 rows) step release-locks-3: diff --git a/src/test/regress/spec/isolation_progress_monitoring.spec b/src/test/regress/spec/isolation_progress_monitoring.spec index 225451ec8..0a88c6b00 100644 --- a/src/test/regress/spec/isolation_progress_monitoring.spec +++ b/src/test/regress/spec/isolation_progress_monitoring.spec @@ -126,8 +126,8 @@ session "monitor" step "show-progress" { - SELECT show_progress(1337); - SELECT show_progress(3778); + SELECT step, progress FROM show_progress(1337) ORDER BY 1, 2; + SELECT step, progress FROM show_progress(3778) ORDER BY 1, 2; } permutation "take-locks" "s1-start-operation" "s2-start-operation" "s3-start-operation" "show-progress" "release-locks-1" "show-progress" "release-locks-2" "show-progress" "release-locks-3"