summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/join.out30
-rw-r--r--src/test/regress/sql/join.sql20
2 files changed, 50 insertions, 0 deletions
diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index cbc882d47ba..dc6262be43a 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -2674,6 +2674,36 @@ select * from a left join b on i = x and i = y and x = i;
rollback;
--
+-- test handling of merge clauses using record_ops
+--
+begin;
+create type mycomptype as (id int, v bigint);
+create temp table tidv (idv mycomptype);
+create index on tidv (idv);
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+ QUERY PLAN
+----------------------------------------------------------
+ Merge Join
+ Merge Cond: (a.idv = b.idv)
+ -> Index Only Scan using tidv_idv_idx on tidv a
+ -> Materialize
+ -> Index Only Scan using tidv_idv_idx on tidv b
+(5 rows)
+
+set enable_mergejoin = 0;
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+ QUERY PLAN
+----------------------------------------------------
+ Nested Loop
+ -> Seq Scan on tidv a
+ -> Index Only Scan using tidv_idv_idx on tidv b
+ Index Cond: (idv = a.idv)
+(4 rows)
+
+rollback;
+--
-- test NULL behavior of whole-row Vars, per bug #5025
--
select t1.q2, count(t2.*)
diff --git a/src/test/regress/sql/join.sql b/src/test/regress/sql/join.sql
index 86c6d5be283..d3ba2a1c339 100644
--- a/src/test/regress/sql/join.sql
+++ b/src/test/regress/sql/join.sql
@@ -674,6 +674,26 @@ select * from a left join b on i = x and i = y and x = i;
rollback;
--
+-- test handling of merge clauses using record_ops
+--
+begin;
+
+create type mycomptype as (id int, v bigint);
+
+create temp table tidv (idv mycomptype);
+create index on tidv (idv);
+
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+
+set enable_mergejoin = 0;
+
+explain (costs off)
+select a.idv, b.idv from tidv a, tidv b where a.idv = b.idv;
+
+rollback;
+
+--
-- test NULL behavior of whole-row Vars, per bug #5025
--
select t1.q2, count(t2.*)