!4337 tableof: pljson_list_data support

Merge pull request !4337 from 吴岳川/master
This commit is contained in:
opengauss_bot
2023-10-24 06:36:59 +00:00
committed by Gitee
4 changed files with 40 additions and 3 deletions

View File

@ -5302,7 +5302,7 @@ static void CheckColumnTableOfType(Type ctype)
errmsg("type %u cannot get tupledesc", HeapTupleGetOid(ctype))));
}
for (int i = 0; i < tupleDesc->natts; i++) {
if (tupleDesc->attrs[i].attisdropped) {
if (tupleDesc->attrs[i].attisdropped || strcmp(NameStr(tupleDesc->attrs[i].attname), "pljson_list_data") == 0) {
continue;
}
HeapTuple typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(tupleDesc->attrs[i].atttypid));

View File

@ -1,3 +1,5 @@
create schema tableof_unsupported;
set search_path to tableof_unsupported;
------ Prepare ------
-- create type of TYPTYPE_TABLEOF
create type r0 is (c1 int1, c2 int2);
@ -14,3 +16,24 @@ DETAIL: "t0" is a nest table type
create table tableof_unsupported(id t2);
ERROR: type "t2" is not supported as column type
DETAIL: "t2" is a nest table type
-- composite type cannot be made a member of itself
create type test as (a int);
create type test_arr as(a test[]);
alter type test add attribute b test_arr;
ERROR: composite type test cannot be made a member of itself
-- pljson_list_data is an exception
create type pljson as (a int);
create type pljson_list_data as (pljson_list_data pljson[]);
alter type pljson add attribute b pljson_list_data;
reset search_path;
drop schema tableof_unsupported cascade;
NOTICE: drop cascades to 9 other objects
DETAIL: drop cascades to type tableof_unsupported.r0
drop cascades to type _int4[]
drop cascades to type tableof_unsupported.t1
drop cascades to type tableof_unsupported._r0[]
drop cascades to type tableof_unsupported.test
drop cascades to type tableof_unsupported.test_arr
drop cascades to type tableof_unsupported.pljson
drop cascades to type tableof_unsupported.pljson_list_data
drop cascades to composite type tableof_unsupported.pljson column b

View File

@ -1013,7 +1013,7 @@ test: gtt_trunc_pre
test: gtt_trunc_parallel_dml1 gtt_trunc_parallel_dml2 gtt_trunc_parallel_ddl1 gtt_trunc_parallel_ddl2
#test: gtt_trunc_clean
test: toomanyparams
test: toomanyparams tableof_unsupported
test: test_astore_multixact
test: row_compression/pg_table_size row_compression/unsupported_feature row_compression/normal_test row_compression/alter_compress_params

View File

@ -1,3 +1,5 @@
create schema tableof_unsupported;
set search_path to tableof_unsupported;
------ Prepare ------
-- create type of TYPTYPE_TABLEOF
create type r0 is (c1 int1, c2 int2);
@ -9,4 +11,16 @@ create type t2 is table of r0;
-- create table
create table tableof_unsupported(id t0);
create table tableof_unsupported(id t1);
create table tableof_unsupported(id t2);
create table tableof_unsupported(id t2);
-- composite type cannot be made a member of itself
create type test as (a int);
create type test_arr as(a test[]);
alter type test add attribute b test_arr;
-- pljson_list_data is an exception
create type pljson as (a int);
create type pljson_list_data as (pljson_list_data pljson[]);
alter type pljson add attribute b pljson_list_data;
reset search_path;
drop schema tableof_unsupported cascade;