From 29e1e353842e4f15ecfcc5bf64d45bac5a94c0ea Mon Sep 17 00:00:00 2001 From: Vasiliy Ivanov Date: Thu, 28 Apr 2022 09:53:10 +1000 Subject: [PATCH] Remove duplicate test case after syncing the same patch from upstream Own patch: dfd53de7474550583293deb584d5b02e84c214bc Upstream patch: edbc7234d1fd60de7b9cd4216888e93df49d3df4 --- src/test/regress/expected/gporca.out | 51 ------------------ .../regress/expected/gporca_optimizer.out | 53 ------------------- src/test/regress/sql/gporca.sql | 33 ------------ 3 files changed, 137 deletions(-) diff --git a/src/test/regress/expected/gporca.out b/src/test/regress/expected/gporca.out index c096027e9740..0b1dc9ad2863 100644 --- a/src/test/regress/expected/gporca.out +++ b/src/test/regress/expected/gporca.out @@ -14258,57 +14258,6 @@ SELECT gp_segment_id, * FROM result_tab; DROP TABLE IF EXISTS dist_tab_a; DROP TABLE IF EXISTS dist_tab_b; DROP TABLE IF EXISTS result_tab; --- Test ORCA not falling back to Postgres planner during --- SimplifySelectOnOuterJoin stage. Previously, we could get assertion error --- trying to EberEvaluate() strict function with zero arguments. --- Postgres planner will fold our function, because it has additional --- eval_const_expressions() call for subplan. ORCA has only one call to --- fold_constants() at the very beginning and doesn't perform folding later. -CREATE TABLE join_null_rej1(i int); -CREATE TABLE join_null_rej2(i int); -INSERT INTO join_null_rej1(i) VALUES (1), (2), (3); -INSERT INTO join_null_rej2 SELECT i FROM join_null_rej1; -CREATE OR REPLACE FUNCTION join_null_rej_func() RETURNS int AS $$ -BEGIN - RETURN 5; -END; -$$ LANGUAGE plpgsql STABLE STRICT; -EXPLAIN (COSTS OFF) SELECT ( - SELECT count(*) cnt - FROM join_null_rej1 t1 - LEFT JOIN join_null_rej2 t2 ON t1.i = t2.i - WHERE t2.i < join_null_rej_func() -); - QUERY PLAN ---------------------------------------------------------------------- - Result - InitPlan 1 (returns $0) (slice2) - -> Aggregate - -> Gather Motion 3:1 (slice1; segments: 3) - -> Aggregate - -> Hash Join - Hash Cond: (t1.i = t2.i) - -> Seq Scan on join_null_rej1 t1 - Filter: (i < 5) - -> Hash - -> Seq Scan on join_null_rej2 t2 - Filter: (i < 5) - Optimizer: Postgres query optimizer -(13 rows) - --- Optional, but let's check we get same result for both, folded and --- not folded now() frunction. -SELECT ( - SELECT count(*) cnt - FROM join_null_rej1 t1 - LEFT JOIN join_null_rej2 t2 ON t1.i = t2.i - WHERE t2.i < join_null_rej_func() -); - cnt ------ - 3 -(1 row) - -- Test if orca produces bitmap scan on mixed partitions create table mixed_part( a int) distributed randomly partition by range (a) diff --git a/src/test/regress/expected/gporca_optimizer.out b/src/test/regress/expected/gporca_optimizer.out index cf7d2aa27ed5..abe41d7b6e83 100644 --- a/src/test/regress/expected/gporca_optimizer.out +++ b/src/test/regress/expected/gporca_optimizer.out @@ -14520,59 +14520,6 @@ SELECT gp_segment_id, * FROM result_tab; DROP TABLE IF EXISTS dist_tab_a; DROP TABLE IF EXISTS dist_tab_b; DROP TABLE IF EXISTS result_tab; --- Test ORCA not falling back to Postgres planner during --- SimplifySelectOnOuterJoin stage. Previously, we could get assertion error --- trying to EberEvaluate() strict function with zero arguments. --- Postgres planner will fold our function, because it has additional --- eval_const_expressions() call for subplan. ORCA has only one call to --- fold_constants() at the very beginning and doesn't perform folding later. -CREATE TABLE join_null_rej1(i int); -CREATE TABLE join_null_rej2(i int); -INSERT INTO join_null_rej1(i) VALUES (1), (2), (3); -INSERT INTO join_null_rej2 SELECT i FROM join_null_rej1; -CREATE OR REPLACE FUNCTION join_null_rej_func() RETURNS int AS $$ -BEGIN - RETURN 5; -END; -$$ LANGUAGE plpgsql STABLE STRICT; -EXPLAIN (COSTS OFF) SELECT ( - SELECT count(*) cnt - FROM join_null_rej1 t1 - LEFT JOIN join_null_rej2 t2 ON t1.i = t2.i - WHERE t2.i < join_null_rej_func() -); - QUERY PLAN ----------------------------------------------------------------------------------------- - Result - -> Result - -> Nested Loop Left Join - Join Filter: true - -> Result - -> Aggregate - -> Materialize - -> Gather Motion 3:1 (slice1; segments: 3) - -> Hash Join - Hash Cond: (join_null_rej1.i = join_null_rej2.i) - -> Seq Scan on join_null_rej1 - -> Hash - -> Seq Scan on join_null_rej2 - Filter: (i < join_null_rej_func()) - Optimizer: Pivotal Optimizer (GPORCA) -(15 rows) - --- Optional, but let's check we get same result for both, folded and --- not folded now() frunction. -SELECT ( - SELECT count(*) cnt - FROM join_null_rej1 t1 - LEFT JOIN join_null_rej2 t2 ON t1.i = t2.i - WHERE t2.i < join_null_rej_func() -); - cnt ------ - 3 -(1 row) - -- Test if orca produces bitmap scan on mixed partitions create table mixed_part( a int) distributed randomly partition by range (a) diff --git a/src/test/regress/sql/gporca.sql b/src/test/regress/sql/gporca.sql index 509adcbc43bd..bc7ee66c4202 100644 --- a/src/test/regress/sql/gporca.sql +++ b/src/test/regress/sql/gporca.sql @@ -3213,39 +3213,6 @@ DROP TABLE IF EXISTS dist_tab_a; DROP TABLE IF EXISTS dist_tab_b; DROP TABLE IF EXISTS result_tab; --- Test ORCA not falling back to Postgres planner during --- SimplifySelectOnOuterJoin stage. Previously, we could get assertion error --- trying to EberEvaluate() strict function with zero arguments. --- Postgres planner will fold our function, because it has additional --- eval_const_expressions() call for subplan. ORCA has only one call to --- fold_constants() at the very beginning and doesn't perform folding later. -CREATE TABLE join_null_rej1(i int); -CREATE TABLE join_null_rej2(i int); - -INSERT INTO join_null_rej1(i) VALUES (1), (2), (3); -INSERT INTO join_null_rej2 SELECT i FROM join_null_rej1; - -CREATE OR REPLACE FUNCTION join_null_rej_func() RETURNS int AS $$ -BEGIN - RETURN 5; -END; -$$ LANGUAGE plpgsql STABLE STRICT; - -EXPLAIN (COSTS OFF) SELECT ( - SELECT count(*) cnt - FROM join_null_rej1 t1 - LEFT JOIN join_null_rej2 t2 ON t1.i = t2.i - WHERE t2.i < join_null_rej_func() -); --- Optional, but let's check we get same result for both, folded and --- not folded now() frunction. -SELECT ( - SELECT count(*) cnt - FROM join_null_rej1 t1 - LEFT JOIN join_null_rej2 t2 ON t1.i = t2.i - WHERE t2.i < join_null_rej_func() -); - -- Test if orca produces bitmap scan on mixed partitions create table mixed_part( a int) distributed randomly partition by range (a)