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