Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a7896cd

Browse files
committed
Make all tests for pg_hint_plan runnable on *nix from contrib tree, adding neccessary extensions to EXTRA_INSTALL (for make check), creating additional configuration file to preload pg_stat_statements and modifying expected output
1 parent 7434127 commit a7896cd

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

contrib/pg_hint_plan/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ REGRESS_OPTS = --encoding=UTF8
1515

1616
EXTENSION = pg_hint_plan
1717
DATA = pg_hint_plan--1.1.3.sql
18+
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
19+
EXTRA_INSTALL=contrib/pg_stat_statements contrib/btree_gist contrib/btree_gin contrib/file_fdw
1820

1921
EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out
2022

@@ -28,7 +30,7 @@ top_builddir = ../..
2830
include $(top_builddir)/src/Makefile.global
2931
include $(top_srcdir)/contrib/contrib-global.mk
3032
override CFLAGS += -I$(top_srcdir)/src/pl/plpgsql/src
31-
REGRESS = init base_plan
33+
#REGRESS = init base_plan
3234
endif
3335

3436
STARBALL96 = pg_hint_plan96-$(HINTPLANVER).tar.gz

contrib/pg_hint_plan/conf.add

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shared_preload_libraries='pg_stat_statements'

contrib/pg_hint_plan/expected/ut-R.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,11 +660,11 @@ EXPLAIN SELECT * FROM t_pg_class t1, t_pg_class t2 WHERE t1.oid = t2.oid;
660660
\! sql/maskout.sh results/ut-R.tmpout
661661
QUERY PLAN
662662
------------------------------------------------------------------------------
663-
Hash Join (cost=xxx rows=360 width=xxx)
663+
Hash Join (cost=xxx rows=340 width=xxx)
664664
Hash Cond: (t1.oid = t2.oid)
665-
-> Seq Scan on t_pg_class t1 (cost=xxx rows=360 width=xxx)
666-
-> Hash (cost=xxx rows=360 width=xxx)
667-
-> Seq Scan on t_pg_class t2 (cost=xxx rows=360 width=xxx)
665+
-> Seq Scan on t_pg_class t1 (cost=xxx rows=340 width=xxx)
666+
-> Hash (cost=xxx rows=340 width=xxx)
667+
-> Seq Scan on t_pg_class t2 (cost=xxx rows=340 width=xxx)
668668
(5 rows)
669669

670670
\o results/ut-R.tmpout
@@ -683,9 +683,9 @@ error hint:
683683
------------------------------------------------------------------------------
684684
Hash Join (cost=xxx rows=1 width=xxx)
685685
Hash Cond: (t1.oid = t2.oid)
686-
-> Seq Scan on t_pg_class t1 (cost=xxx rows=360 width=xxx)
687-
-> Hash (cost=xxx rows=360 width=xxx)
688-
-> Seq Scan on t_pg_class t2 (cost=xxx rows=360 width=xxx)
686+
-> Seq Scan on t_pg_class t1 (cost=xxx rows=340 width=xxx)
687+
-> Hash (cost=xxx rows=340 width=xxx)
688+
-> Seq Scan on t_pg_class t2 (cost=xxx rows=340 width=xxx)
689689
(5 rows)
690690

691691
-- No. R-1-6-6

contrib/pg_hint_plan/expected/ut-S.out

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4696,7 +4696,7 @@ SELECT max(b2t1.c1) FROM s1.t1 b2t1 WHERE b2t1.c1 = 1
46964696
SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
46974697
QUERY PLAN
46984698
---------------------------------------------------------------------
4699-
Result
4699+
Aggregate
47004700
InitPlan 2 (returns $1)
47014701
-> Result
47024702
InitPlan 1 (returns $0)
@@ -4709,11 +4709,9 @@ SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
47094709
-> Limit
47104710
-> Index Only Scan using t1_i1 on t1 b4t1
47114711
Index Cond: ((c1 IS NOT NULL) AND (c1 = 1))
4712-
InitPlan 5 (returns $4)
4713-
-> Limit
4714-
-> Index Only Scan using t1_i1 on t1 b3t1
4715-
Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4716-
(17 rows)
4712+
-> Index Only Scan using t1_i1 on t1 b3t1
4713+
Index Cond: (c1 = $3)
4714+
(15 rows)
47174715

47184716
/*+SeqScan(b1t1)IndexScan(b2t1 t1_pkey)BitmapScan(b3t1 t1_pkey)TidScan(b4t1)
47194717
*/
@@ -4727,7 +4725,6 @@ SELECT max(b4t1.c1) FROM s1.t1 b4t1 WHERE b4t1.c1 = 1);
47274725
LOG: available indexes for IndexScan(b2t1): t1_pkey
47284726
LOG: available indexes for IndexScan(b2t1): t1_pkey
47294727
LOG: available indexes for BitmapScan(b3t1): t1_pkey
4730-
LOG: available indexes for BitmapScan(b3t1): t1_pkey
47314728
LOG: pg_hint_plan:
47324729
used hint:
47334730
IndexScan(b2t1 t1_pkey)
@@ -4740,7 +4737,7 @@ error hint:
47404737

47414738
QUERY PLAN
47424739
---------------------------------------------------------------------
4743-
Result
4740+
Aggregate
47444741
InitPlan 2 (returns $1)
47454742
-> Result
47464743
InitPlan 1 (returns $0)
@@ -4753,13 +4750,11 @@ error hint:
47534750
-> Limit
47544751
-> Seq Scan on t1 b4t1
47554752
Filter: ((c1 IS NOT NULL) AND (c1 = 1))
4756-
InitPlan 5 (returns $4)
4757-
-> Limit
4758-
-> Bitmap Heap Scan on t1 b3t1
4759-
Recheck Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4760-
-> Bitmap Index Scan on t1_pkey
4761-
Index Cond: ((c1 IS NOT NULL) AND (c1 = $3))
4762-
(19 rows)
4753+
-> Bitmap Heap Scan on t1 b3t1
4754+
Recheck Cond: (c1 = $3)
4755+
-> Bitmap Index Scan on t1_pkey
4756+
Index Cond: (c1 = $3)
4757+
(17 rows)
47634758

47644759
-- No. S-3-7-2
47654760
EXPLAIN (COSTS false)

0 commit comments

Comments
 (0)