Skip to content

Commit

Permalink
Use tuple-only mode to stablize EXPLAIN output containing @abs_srcdir@.
Browse files Browse the repository at this point in the history
The line containing @abs_srcdir@ can be longer than the header line
and if it is, the test will fail. Use tuple-only mode to get rid of
the unstable part from the EXPLAIN output.
  • Loading branch information
protodef authored and horiguti committed Feb 13, 2020
1 parent 3f47bfd commit 88d3fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions output/ut-W.source
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,9 @@ Parallel()
-> Parallel Seq Scan on p2_c3_c2
(21 rows)

-- Use tuples-only mode so that long \@abs_srcdir\@ won't let the
-- following query make an unstable result.
\t
-- Hints on unhintable relations are just ignored
/*+Parallel(p1 5 hard) Parallel(s1 3 hard) IndexScan(ft1) SeqScan(cte1)
TidScan(fs1) IndexScan(t) IndexScan(*VALUES*) */
Expand All @@ -910,8 +913,6 @@ Parallel(s1 3 hard)
duplication hint:
error hint:

QUERY PLAN
-----------------------------------------------------------------------------------------------
Append
-> Result
-> Append
Expand Down Expand Up @@ -945,8 +946,9 @@ error hint:
-> Function Scan on pg_stat_statements
-> Subquery Scan on "*SELECT* 5"
-> Values Scan on "*VALUES*"
(33 rows)

-- Turn off tuples-only mode
\t
ALTER SYSTEM SET session_preload_libraries TO DEFAULT;
SELECT pg_reload_conf();
pg_reload_conf
Expand Down
6 changes: 5 additions & 1 deletion sql/ut-W.sql
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ EXPLAIN (COSTS false) SELECT * FROM p1;
Parallel(p1 8 hoge)Parallel(p1)Parallel(p1 100 soft x)*/
EXPLAIN (COSTS false) SELECT id FROM p1 UNION ALL SELECT id FROM p2;

-- Use tuples-only mode so that long \@abs_srcdir\@ won't let the
-- following query make an unstable result.
\t
-- Hints on unhintable relations are just ignored
/*+Parallel(p1 5 hard) Parallel(s1 3 hard) IndexScan(ft1) SeqScan(cte1)
TidScan(fs1) IndexScan(t) IndexScan(*VALUES*) */
Expand All @@ -170,6 +173,7 @@ SELECT userid FROM pg_stat_statements fs1
UNION ALL
SELECT x FROM (VALUES (1), (2), (3)) t(x);


-- Turn off tuples-only mode
\t
ALTER SYSTEM SET session_preload_libraries TO DEFAULT;
SELECT pg_reload_conf();

0 comments on commit 88d3fb3

Please sign in to comment.