OSDN Git Service

Fix regression tests.
authorKyotaro Horiguchi <horikyota.ntt@gmail.com>
Tue, 29 Oct 2019 09:49:22 +0000 (18:49 +0900)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Tue, 29 Oct 2019 09:49:22 +0000 (18:49 +0900)
Fix regression tests to work for PG12.

expected/pg_hint_plan.out
expected/ut-S.out
expected/ut-W.out
sql/maskout2.sh [new file with mode: 0755]
sql/pg_hint_plan.sql
sql/ut-W.sql

index 01f698d..cacfb55 100644 (file)
@@ -5388,7 +5388,7 @@ ERROR:  1.23457e+63 is outside the valid range for parameter "cursor_tuple_fract
 /*+ Set(enable_seqscan 100)Set(seq_page_cost on)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
 INFO:  parameter "enable_seqscan" requires a Boolean value
-INFO:  parameter "seq_page_cost" requires a numeric value
+INFO:  invalid value for parameter "seq_page_cost": "on"
 LOG:  pg_hint_plan:
 used hint:
 not used hint:
@@ -8181,6 +8181,12 @@ END;
 $$ VOLATILE LANGUAGE plpgsql;
 vacuum analyze t1;
 SET pg_hint_plan.enable_hint = false;
+SELECT pg_sleep(1);
+ pg_sleep 
+----------
+(1 row)
+
 SELECT reset_stats_and_wait();
  reset_stats_and_wait 
 ----------------------
index 00a30ce..7ab53b2 100644 (file)
@@ -5085,6 +5085,8 @@ error hint:
 EXPLAIN (COSTS false) UPDATE s1.p1 SET c4 = c4 WHERE c1 = 1;
 LOG:  available indexes for IndexScan(p1): p1_pkey
 LOG:  available indexes for IndexScan(p1c1): p1c1_pkey
+LOG:  available indexes for IndexScan(p1): p1_pkey
+LOG:  available indexes for IndexScan(p1c1): p1c1_pkey
 LOG:  pg_hint_plan:
 used hint:
 IndexScan(p1 p1_pkey)
index bf5126b..f12ace1 100644 (file)
@@ -1216,6 +1216,7 @@ Parallel()
 -- 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*) */
+\o results/ut-W.tmpout
 EXPLAIN (COSTS false) SELECT id FROM p1_c1_c1 as s1 TABLESAMPLE SYSTEM(10)
  UNION ALL
 SELECT id FROM ft1
@@ -1238,15 +1239,17 @@ Parallel(s1 3 hard)
 duplication hint:
 error hint:
 
-                                          QUERY PLAN                                           
------------------------------------------------------------------------------------------------
+\o
+\! sql/maskout2.sh results/ut-W.tmpout
+                                            QUERY PLAN                                             
+--(snip..)
  Append
    ->  Result
          ->  Append
                ->  Sample Scan on p1_c1_c1 s1
                      Sampling: system ('10'::real)
                ->  Foreign Scan on ft1
-                     Foreign File: /home/horiguti/work/pg_hint_plan/pg_hint_plan/data/data.csv
+                     Foreign File:  (snip..)
                ->  Gather
                      Workers Planned: 5
                      ->  Parallel Append
diff --git a/sql/maskout2.sh b/sql/maskout2.sh
new file mode 100755 (executable)
index 0000000..b7dad75
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+cat $1 | \
+sed 's/^-\+$/--(snip..)/;s/^\( \+Foreign File: \).*$/\1 (snip..)/'
index 5886d97..a7cf883 100644 (file)
@@ -971,6 +971,7 @@ END;
 $$ VOLATILE LANGUAGE plpgsql;
 vacuum analyze t1;
 SET pg_hint_plan.enable_hint = false;
+SELECT pg_sleep(1);
 SELECT reset_stats_and_wait();
 SELECT dynsql1(9000);
 SELECT pg_sleep(1);
index f309235..1470f62 100644 (file)
@@ -205,6 +205,7 @@ EXPLAIN (COSTS false) SELECT id FROM p1 UNION ALL SELECT id FROM p2;
 -- 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*) */
+\o results/ut-W.tmpout
 EXPLAIN (COSTS false) SELECT id FROM p1_c1_c1 as s1 TABLESAMPLE SYSTEM(10)
  UNION ALL
 SELECT id FROM ft1
@@ -214,7 +215,8 @@ SELECT id FROM ft1
 SELECT userid FROM pg_stat_statements fs1
  UNION ALL
 SELECT x FROM (VALUES (1), (2), (3)) t(x);
-
+\o
+\! sql/maskout2.sh results/ut-W.tmpout
 
 ALTER SYSTEM SET session_preload_libraries TO DEFAULT;
 SELECT pg_reload_conf();