OSDN Git Service

Use tuple-only mode to stablize EXPLAIN output containing @abs_srcdir@.
authorJunseok Yang <protodef@gmail.com>
Fri, 16 Mar 2018 20:42:44 +0000 (13:42 -0700)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Thu, 13 Feb 2020 11:42:45 +0000 (20:42 +0900)
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.

output/ut-W.source
sql/ut-W.sql

index 998c397..1cdea18 100644 (file)
@@ -909,6 +909,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*) */
@@ -934,8 +937,6 @@ Parallel(s1 3 hard)
 duplication hint:
 error hint:
 
-                                          QUERY PLAN                                           
------------------------------------------------------------------------------------------------
  Append
    ->  Result
          ->  Append
@@ -969,8 +970,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 
index 755d8f1..4ae1c0e 100644 (file)
@@ -170,6 +170,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*) */
@@ -183,6 +186,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();