diff --git a/concourse/tasks/compile_gpdb.yml b/concourse/tasks/compile_gpdb.yml index 6fb72147fecdfdc3e67cbc26872f9d3c065ac0a5..d0030afcaee3f34d8252f192f27d5f45596c6c33 100644 --- a/concourse/tasks/compile_gpdb.yml +++ b/concourse/tasks/compile_gpdb.yml @@ -19,4 +19,4 @@ params: BLD_TARGETS: OUTPUT_ARTIFACT_DIR: gpdb_artifacts CONFIGURE_FLAGS: - ORCA_TAG: v3.52.0 + ORCA_TAG: v3.53.0 diff --git a/config/orca.m4 b/config/orca.m4 index 90d743a68820a3f773ef07f32450b20b10f717f3..9fae15e25b0fb0767b086c527b68407f12c811ee 100644 --- a/config/orca.m4 +++ b/config/orca.m4 @@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include ]], [ -return strncmp("3.52.", GPORCA_VERSION_STRING, 5); +return strncmp("3.53.", GPORCA_VERSION_STRING, 5); ])], [AC_MSG_RESULT([[ok]])], -[AC_MSG_ERROR([Your ORCA version is expected to be 3.52.XXX])] +[AC_MSG_ERROR([Your ORCA version is expected to be 3.53.XXX])] ) AC_LANG_POP([C++]) ])# PGAC_CHECK_ORCA_VERSION diff --git a/configure b/configure index 168501bbc365d18b96d3dbb2713a1d0e8bb4e414..9b6916eaac92884f7788f82ae7c994465d76fe05 100755 --- a/configure +++ b/configure @@ -13982,7 +13982,7 @@ int main () { -return strncmp("3.52.", GPORCA_VERSION_STRING, 5); +return strncmp("3.53.", GPORCA_VERSION_STRING, 5); ; return 0; @@ -13992,7 +13992,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else - as_fn_error $? "Your ORCA version is expected to be 3.52.XXX" "$LINENO" 5 + as_fn_error $? "Your ORCA version is expected to be 3.53.XXX" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ diff --git a/depends/conanfile_orca.txt b/depends/conanfile_orca.txt index 02a4214b4d2217076b7179c83264720a01bcb0e8..b2bda3708fd80324f1b7374c498193be570ae4a6 100644 --- a/depends/conanfile_orca.txt +++ b/depends/conanfile_orca.txt @@ -1,5 +1,5 @@ [requires] -orca/v3.52.0@gpdb/stable +orca/v3.53.0@gpdb/stable [imports] include, * -> build/include diff --git a/src/test/regress/expected/qp_subquery.out b/src/test/regress/expected/qp_subquery.out index 70fa16e858a499b969ea9ccfb79b45e389c7200e..6f8d81c08c98fa58ccd57ca92a5b26d501b9aef2 100644 --- a/src/test/regress/expected/qp_subquery.out +++ b/src/test/regress/expected/qp_subquery.out @@ -1315,5 +1315,34 @@ with test as (select * from (select * from append_rel) p where att1 in (select a 20 (1 row) +-- Check correct results for subqueries in the target list +begin; +drop table if exists temp_a, temp_b, temp_c; +NOTICE: table "temp_a" does not exist, skipping +NOTICE: table "temp_b" does not exist, skipping +NOTICE: table "temp_c" does not exist, skipping +create table temp_a (a int ,b int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +create table temp_b (b int ,c int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'b' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +create table temp_c (c int, d int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +insert into temp_a values (1,2), (2,3), (3,4), (4,7), (5,19), (6,13), (7,23), (7,17); +insert into temp_b values (1,2), (2,2), (3,2), (4,2), (5,3), (6,3), (7,3), (8,3), (10,4); +insert into temp_c values (NULL, 2), (2, 2), (4, NULL), (NULL, 3), (1, 3), (8, NULL), (7, 2), (NULL, NULL); +commit; +select sum(case when b in (select b from temp_b where t.a>c) then 1 else 0 end),sum(case when not( b in (select b from temp_b where t.a>c)) then 1 else 0 end) from temp_a t; + sum | sum +-----+----- + 2 | 6 +(1 row) + +select sum(case when b in (select b from temp_b where EXISTS (select sum(d) from temp_c where t.a > d)) then 1 else 0 end),sum(case when not( b in (select b from temp_b where t.a>c)) then 1 else 0 end) from temp_a t; +ERROR: correlated subquery with skip-level correlations is not supported +select sum(case when b in (select b from temp_b where EXISTS (select sum(d) from temp_c where t.a > d or t.a > temp_b.c)) then 1 else 0 end),sum(case when not( b in (select b from temp_b, temp_c where t.a>temp_b.c or t.a > temp_c.d)) then 1 else 0 end) from temp_a t; +ERROR: correlated subquery with skip-level correlations is not supported set client_min_messages='warning'; drop schema qp_subquery cascade; diff --git a/src/test/regress/expected/qp_subquery_optimizer.out b/src/test/regress/expected/qp_subquery_optimizer.out index 87922a862f878045cac7b581cdd9012ae8a22efc..5c39b8d9e0787e54137fa4df88b9835cf9a3b1eb 100644 --- a/src/test/regress/expected/qp_subquery_optimizer.out +++ b/src/test/regress/expected/qp_subquery_optimizer.out @@ -1318,5 +1318,42 @@ with test as (select * from (select * from append_rel) p where att1 in (select a 20 (1 row) +-- Check correct results for subqueries in the target list +begin; +drop table if exists temp_a, temp_b, temp_c; +NOTICE: table "temp_a" does not exist, skipping +NOTICE: table "temp_b" does not exist, skipping +NOTICE: table "temp_c" does not exist, skipping +create table temp_a (a int ,b int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +create table temp_b (b int ,c int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'b' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +create table temp_c (c int, d int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c' as the Greenplum Database data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +insert into temp_a values (1,2), (2,3), (3,4), (4,7), (5,19), (6,13), (7,23), (7,17); +insert into temp_b values (1,2), (2,2), (3,2), (4,2), (5,3), (6,3), (7,3), (8,3), (10,4); +insert into temp_c values (NULL, 2), (2, 2), (4, NULL), (NULL, 3), (1, 3), (8, NULL), (7, 2), (NULL, NULL); +commit; +select sum(case when b in (select b from temp_b where t.a>c) then 1 else 0 end),sum(case when not( b in (select b from temp_b where t.a>c)) then 1 else 0 end) from temp_a t; + sum | sum +-----+----- + 2 | 6 +(1 row) + +select sum(case when b in (select b from temp_b where EXISTS (select sum(d) from temp_c where t.a > d)) then 1 else 0 end),sum(case when not( b in (select b from temp_b where t.a>c)) then 1 else 0 end) from temp_a t; + sum | sum +-----+----- + 4 | 6 +(1 row) + +select sum(case when b in (select b from temp_b where EXISTS (select sum(d) from temp_c where t.a > d or t.a > temp_b.c)) then 1 else 0 end),sum(case when not( b in (select b from temp_b, temp_c where t.a>temp_b.c or t.a > temp_c.d)) then 1 else 0 end) from temp_a t; + sum | sum +-----+----- + 4 | 6 +(1 row) + set client_min_messages='warning'; drop schema qp_subquery cascade; diff --git a/src/test/regress/sql/qp_subquery.sql b/src/test/regress/sql/qp_subquery.sql index 146e48c6b7b279eee09ade94d62d4ede603d8d73..6bdbb1f7640f0749512a87776596c59ad430c1c3 100644 --- a/src/test/regress/sql/qp_subquery.sql +++ b/src/test/regress/sql/qp_subquery.sql @@ -582,5 +582,21 @@ insert into append_rel values(1,10),(2,20),(3,30); explain with test as (select * from (select * from append_rel) p where att1 in (select att1 from append_rel where att2 >= 19) ) select att2 from append_rel where att1 in (select att1 from test where att2 <= 21); with test as (select * from (select * from append_rel) p where att1 in (select att1 from append_rel where att2 >= 19) ) select att2 from append_rel where att1 in (select att1 from test where att2 <= 21); + +-- Check correct results for subqueries in the target list +begin; +drop table if exists temp_a, temp_b, temp_c; +create table temp_a (a int ,b int); +create table temp_b (b int ,c int); +create table temp_c (c int, d int); +insert into temp_a values (1,2), (2,3), (3,4), (4,7), (5,19), (6,13), (7,23), (7,17); +insert into temp_b values (1,2), (2,2), (3,2), (4,2), (5,3), (6,3), (7,3), (8,3), (10,4); +insert into temp_c values (NULL, 2), (2, 2), (4, NULL), (NULL, 3), (1, 3), (8, NULL), (7, 2), (NULL, NULL); +commit; + +select sum(case when b in (select b from temp_b where t.a>c) then 1 else 0 end),sum(case when not( b in (select b from temp_b where t.a>c)) then 1 else 0 end) from temp_a t; +select sum(case when b in (select b from temp_b where EXISTS (select sum(d) from temp_c where t.a > d)) then 1 else 0 end),sum(case when not( b in (select b from temp_b where t.a>c)) then 1 else 0 end) from temp_a t; +select sum(case when b in (select b from temp_b where EXISTS (select sum(d) from temp_c where t.a > d or t.a > temp_b.c)) then 1 else 0 end),sum(case when not( b in (select b from temp_b, temp_c where t.a>temp_b.c or t.a > temp_c.d)) then 1 else 0 end) from temp_a t; + set client_min_messages='warning'; drop schema qp_subquery cascade;