From 49233bbf4adce015bb36859b327f37b517c7eeed Mon Sep 17 00:00:00 2001 From: zhaosen Date: Fri, 10 May 2024 11:43:44 +0800 Subject: [PATCH] =?UTF-8?q?ustore=E5=AD=98=E5=82=A8=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E7=9A=84regression=E7=94=A8=E4=BE=8B11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../composite_datum_record_ustore.out | 37 +++++++++++++++++++ .../sql/composite_datum_record_ustore.sql | 11 ++++++ 2 files changed, 48 insertions(+) create mode 100644 src/test/regress/expected/composite_datum_record_ustore.out create mode 100644 src/test/regress/sql/composite_datum_record_ustore.sql diff --git a/src/test/regress/expected/composite_datum_record_ustore.out b/src/test/regress/expected/composite_datum_record_ustore.out new file mode 100644 index 000000000..056abb97c --- /dev/null +++ b/src/test/regress/expected/composite_datum_record_ustore.out @@ -0,0 +1,37 @@ +-- +-- check for over-optimization of whole-row Var referencing an Append plan +-- +create table int4_test(f1 int4) with (storage_type = ustore); +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6 where f1<=0) q) from int4_test; + q +--- +(0 rows) + +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6.0 where f1<=0) q) from int4_test; + q +--- +(0 rows) + +insert into int4_test(f1) values(' 0 '); +insert into int4_test(f1) values('123456 '); +select * from int4_test; + f1 +-------- + 0 + 123456 +(2 rows) + +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6 where f1<=0) q) from int4_test; + q +--------- + (4,5,6) + (1,2,3) +(2 rows) + +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6.0 where f1<=0) q) from int4_test; + q +----------- + (4,5,6.0) + (1,2,3) +(2 rows) + diff --git a/src/test/regress/sql/composite_datum_record_ustore.sql b/src/test/regress/sql/composite_datum_record_ustore.sql new file mode 100644 index 000000000..0c2b98d54 --- /dev/null +++ b/src/test/regress/sql/composite_datum_record_ustore.sql @@ -0,0 +1,11 @@ +-- +-- check for over-optimization of whole-row Var referencing an Append plan +-- +create table int4_test(f1 int4) with (storage_type = ustore); +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6 where f1<=0) q) from int4_test; +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6.0 where f1<=0) q) from int4_test; +insert into int4_test(f1) values(' 0 '); +insert into int4_test(f1) values('123456 '); +select * from int4_test; +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6 where f1<=0) q) from int4_test; +select (select q from (select 1,2,3 where f1>0 union all select 4,5,6.0 where f1<=0) q) from int4_test; \ No newline at end of file