diff --git a/src/gausskernel/process/tcop/utility.cpp b/src/gausskernel/process/tcop/utility.cpp old mode 100755 new mode 100644 index 0f7057ceb..2eedf9d36 --- a/src/gausskernel/process/tcop/utility.cpp +++ b/src/gausskernel/process/tcop/utility.cpp @@ -3586,7 +3586,7 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi } break; case T_AlterDomainStmt: -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported."))); #endif /* PGXC */ { @@ -4929,12 +4929,12 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi * ******************************** DOMAIN statements **** */ case T_CreateDomainStmt: -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES if (!IsInitdb && !u_sess->attr.attr_common.IsInplaceUpgrade) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported."))); #endif /* PGXC */ DefineDomain((CreateDomainStmt*)parse_tree); -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES if (IS_PGXC_COORDINATOR) ExecUtilityStmtOnNodes(query_string, NULL, sent_to_remote, false, EXEC_ON_ALL_NODES, false); #endif @@ -8566,9 +8566,10 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string) case OBJECT_LANGUAGE: tag = "LANGUAGE"; break; - case OBJECT_DOMAIN: + /*Single node support domain feature.*/ + /* case OBJECT_DOMAIN: tag = "DOMAIN"; - break; + break;*/ case OBJECT_CONVERSION: tag = "CONVERSION"; break; diff --git a/src/test/regress/expected/alter_table_003.out b/src/test/regress/expected/alter_table_003.out index 8f76b2a6c..1d10df993 100644 --- a/src/test/regress/expected/alter_table_003.out +++ b/src/test/regress/expected/alter_table_003.out @@ -294,56 +294,50 @@ drop table p1 cascade; -- test that operations with a dropped column do not try to reference -- its datatype create domain mytype as text; -ERROR: domain is not yet supported. create table foo (f1 text, f2 mytype, f3 text);; -ERROR: type "mytype" does not exist -LINE 1: create table foo (f1 text, f2 mytype, f3 text); - ^ insert into foo values('bb','cc','dd'); -ERROR: relation "foo" does not exist on datanode1 -LINE 1: insert into foo values('bb','cc','dd'); - ^ select * from foo order by f1; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: select * from foo order by f1; - ^ + f1 | f2 | f3 +----+----+---- + bb | cc | dd +(1 row) + drop domain mytype cascade; -ERROR: type "mytype" does not exist +NOTICE: drop cascades to table foo column f2 select * from foo order by f1; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: select * from foo order by f1; - ^ + f1 | f3 +----+---- + bb | dd +(1 row) + insert into foo values('qq','rr'); -ERROR: relation "foo" does not exist on datanode1 -LINE 1: insert into foo values('qq','rr'); - ^ select * from foo order by f1; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: select * from foo order by f1; - ^ + f1 | f3 +----+---- + bb | dd + qq | rr +(2 rows) + update foo set f3 = 'zz'; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: update foo set f3 = 'zz'; - ^ select * from foo order by f1; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: select * from foo order by f1; - ^ + f1 | f3 +----+---- + bb | zz + qq | zz +(2 rows) + select f3,max(f1) from foo group by f3; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: select f3,max(f1) from foo group by f3; - ^ + f3 | max +----+----- + zz | qq +(1 row) + -- Simple tests for alter table column type delete from foo where f1 = 'qq'; -ERROR: relation "foo" does not exist on datanode1 -LINE 1: delete from foo where f1 = 'qq'; - ^ alter table foo alter f1 TYPE integer; -- fails -ERROR: relation "foo" does not exist +ERROR: invalid input syntax for integer: "bb" alter table foo alter f1 TYPE varchar(10); -ERROR: relation "foo" does not exist drop table foo; -ERROR: table "foo" does not exist create table anothertab (atcol1 serial8, atcol2 boolean, constraint anothertab_chk check (atcol1 <= 3));; NOTICE: CREATE TABLE will create implicit sequence "anothertab_atcol1_seq" for serial column "anothertab.atcol1" @@ -446,11 +440,8 @@ ERROR: composite type recur1 cannot be made a member of itself alter table recur1 add column f2 recur1[]; -- fails ERROR: composite type recur1 cannot be made a member of itself create domain array_of_recur1 as recur1[]; -ERROR: domain is not yet supported. alter table recur1 add column f2 array_of_recur1; -- fails -ERROR: type "array_of_recur1" does not exist -LINE 1: alter table recur1 add column f2 array_of_recur1; - ^ +ERROR: composite type recur1 cannot be made a member of itself create table recur2 (f1 int, f2 recur1); alter table recur1 add column f2 recur2; -- fails ERROR: composite type recur1 cannot be made a member of itself @@ -649,7 +640,6 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for tab create view alter1.v1 as select * from alter1.t1; create function alter1.plus1(int) returns int as 'select $1+1' language sql; create domain alter1.posint integer check (value > 0); -ERROR: domain is not yet supported. create type alter1.ctype as (f1 int, f2 text); create function alter1.same(alter1.ctype, alter1.ctype) returns boolean language sql as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2'; @@ -675,7 +665,6 @@ ERROR: There's dependent sequence, but ALTER SEQUENCE SET SCHEMA is not yet sup alter table alter1.v1 set schema alter2; alter function alter1.plus1(int) set schema alter2; alter domain alter1.posint set schema alter2; -ERROR: type "alter1.posint" does not exist alter operator class alter1.ctype_hash_ops using hash set schema alter2; ERROR: operator class "alter1.ctype_hash_ops" does not exist for access method "hash" alter operator family alter1.ctype_hash_ops using hash set schema alter2; @@ -727,9 +716,10 @@ select alter2.plus1(41); -- clean up drop schema alter2 cascade; -NOTICE: drop cascades to 4 other objects +NOTICE: drop cascades to 5 other objects DETAIL: drop cascades to view alter2.v1 drop cascades to function alter2.plus1(integer) +drop cascades to type alter2.posint drop cascades to type alter2.ctype drop cascades to function alter2.same(alter2.ctype,alter2.ctype) drop schema alter1 cascade; diff --git a/src/test/regress/expected/collate.out b/src/test/regress/expected/collate.out index 879231661..c959b4f67 100644 --- a/src/test/regress/expected/collate.out +++ b/src/test/regress/expected/collate.out @@ -71,39 +71,36 @@ ERROR: collation mismatch between explicit collations "C" and "POSIX" LINE 1: ...* FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "P... ^ CREATE DOMAIN testdomain_p AS text COLLATE "POSIX"; -ERROR: domain is not yet supported. CREATE DOMAIN testdomain_i AS int COLLATE "POSIX"; -- fail -ERROR: domain is not yet supported. +ERROR: collations are not supported by type integer CREATE TABLE collate_test4 ( a int, b testdomain_p ); -ERROR: type "testdomain_p" does not exist -LINE 3: b testdomain_p - ^ INSERT INTO collate_test4 SELECT * FROM collate_test1; -ERROR: relation "collate_test4" does not exist on datanode1 -LINE 1: INSERT INTO collate_test4 SELECT * FROM collate_test1; - ^ SELECT a, b FROM collate_test4 ORDER BY b; -ERROR: relation "collate_test4" does not exist on datanode1 -LINE 1: SELECT a, b FROM collate_test4 ORDER BY b; - ^ + a | b +---+----- + 4 | ABD + 2 | Abc + 1 | abc + 3 | bbc +(4 rows) + CREATE TABLE collate_test5 ( a int, b testdomain_p COLLATE "C" ); -ERROR: type "testdomain_p" does not exist -LINE 3: b testdomain_p COLLATE "C" - ^ INSERT INTO collate_test5 SELECT * FROM collate_test1; -ERROR: relation "collate_test5" does not exist on datanode1 -LINE 1: INSERT INTO collate_test5 SELECT * FROM collate_test1; - ^ SELECT a, b FROM collate_test5 ORDER BY b; -ERROR: relation "collate_test5" does not exist on datanode1 -LINE 1: SELECT a, b FROM collate_test5 ORDER BY b; - ^ + a | b +---+----- + 4 | ABD + 2 | Abc + 1 | abc + 3 | bbc +(4 rows) + SELECT a, b FROM collate_test1 ORDER BY b; a | b ---+----- @@ -299,27 +296,40 @@ SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test2 ORDER BY 2 (4 rows) CREATE DOMAIN testdomain AS text; -ERROR: domain is not yet supported. SELECT a, b::testdomain FROM collate_test1 ORDER BY 2; -ERROR: type "testdomain" does not exist -LINE 1: SELECT a, b::testdomain FROM collate_test1 ORDER BY 2; - ^ -CONTEXT: referenced column: b + a | b +---+----- + 4 | ABD + 2 | Abc + 1 | abc + 3 | bbc +(4 rows) + SELECT a, b::testdomain FROM collate_test2 ORDER BY 2; -ERROR: type "testdomain" does not exist -LINE 1: SELECT a, b::testdomain FROM collate_test2 ORDER BY 2; - ^ -CONTEXT: referenced column: b + a | b +---+----- + 4 | ABD + 2 | Abc + 1 | abc + 3 | bbc +(4 rows) + SELECT a, b::testdomain_p FROM collate_test2 ORDER BY 2; -ERROR: type "testdomain_p" does not exist -LINE 1: SELECT a, b::testdomain_p FROM collate_test2 ORDER BY 2; - ^ -CONTEXT: referenced column: b + a | b +---+----- + 4 | ABD + 2 | Abc + 1 | abc + 3 | bbc +(4 rows) + SELECT a, lower(x::testdomain), lower(y::testdomain) FROM collate_test10 ORDER BY 1, 2, 3; -ERROR: type "testdomain" does not exist -LINE 1: SELECT a, lower(x::testdomain), lower(y::testdomain) FROM co... - ^ -CONTEXT: referenced column: lower + a | lower | lower +---+-------+------- + 1 | hij | hij + 2 | hij | hij +(2 rows) + SELECT min(b), max(b) FROM collate_test1; min | max -----+----- @@ -608,14 +618,18 @@ explain (verbose, costs off, nodes off) SELECT collation for ((SELECT b FROM col -- must get rid of them. -- DROP SCHEMA collate_tests CASCADE; -NOTICE: drop cascades to 11 other objects +NOTICE: drop cascades to 15 other objects DETAIL: drop cascades to table collate_test1 drop cascades to table collate_test_like drop cascades to table collate_test2 +drop cascades to type testdomain_p +drop cascades to table collate_test4 +drop cascades to table collate_test5 drop cascades to table collate_test10 drop cascades to view collview1 drop cascades to view collview2 drop cascades to view collview3 +drop cascades to type testdomain drop cascades to function dup(anyelement) drop cascades to table collate_test20 drop cascades to table collate_test21 diff --git a/src/test/regress/expected/drop_if_exists.out b/src/test/regress/expected/drop_if_exists.out index f1c618497..012c26826 100644 --- a/src/test/regress/expected/drop_if_exists.out +++ b/src/test/regress/expected/drop_if_exists.out @@ -58,9 +58,7 @@ ERROR: type "test_domain_exists" does not exist DROP DOMAIN IF EXISTS test_domain_exists; NOTICE: type "test_domain_exists" does not exist, skipping CREATE domain test_domain_exists as int not null check (value > 0); -ERROR: domain is not yet supported. DROP DOMAIN IF EXISTS test_domain_exists; -NOTICE: type "test_domain_exists" does not exist, skipping DROP DOMAIN test_domain_exists; ERROR: type "test_domain_exists" does not exist --- diff --git a/src/test/regress/expected/enum.out b/src/test/regress/expected/enum.out index 75c73ddbd..b28571e38 100644 --- a/src/test/regress/expected/enum.out +++ b/src/test/regress/expected/enum.out @@ -402,24 +402,19 @@ RESET enable_bitmapscan; -- Domains over enums -- CREATE DOMAIN rgb AS rainbow CHECK (VALUE IN ('red', 'green', 'blue')); -ERROR: domain is not yet supported. SELECT 'red'::rgb; -ERROR: type "rgb" does not exist -LINE 1: SELECT 'red'::rgb; - ^ -CONTEXT: referenced column: rgb + rgb +----- + red +(1 row) + SELECT 'purple'::rgb; -ERROR: type "rgb" does not exist -LINE 1: SELECT 'purple'::rgb; - ^ +ERROR: value for domain rgb violates check constraint "rgb_check" CONTEXT: referenced column: rgb SELECT 'purple'::rainbow::rgb; -ERROR: type "rgb" does not exist -LINE 1: SELECT 'purple'::rainbow::rgb; - ^ +ERROR: value for domain rgb violates check constraint "rgb_check" CONTEXT: referenced column: rgb DROP DOMAIN rgb; -ERROR: type "rgb" does not exist -- -- Arrays -- diff --git a/src/test/regress/expected/single_node_enum.out b/src/test/regress/expected/single_node_enum.out index 041ebaf6d..a7c80858d 100644 --- a/src/test/regress/expected/single_node_enum.out +++ b/src/test/regress/expected/single_node_enum.out @@ -380,24 +380,19 @@ RESET enable_bitmapscan; -- Domains over enums -- CREATE DOMAIN rgb AS rainbow CHECK (VALUE IN ('red', 'green', 'blue')); -ERROR: domain is not yet supported. SELECT 'red'::rgb; -ERROR: type "rgb" does not exist -LINE 1: SELECT 'red'::rgb; - ^ -CONTEXT: referenced column: rgb + rgb +----- + red +(1 row) + SELECT 'purple'::rgb; -ERROR: type "rgb" does not exist -LINE 1: SELECT 'purple'::rgb; - ^ +ERROR: value for domain rgb violates check constraint "rgb_check" CONTEXT: referenced column: rgb SELECT 'purple'::rainbow::rgb; -ERROR: type "rgb" does not exist -LINE 1: SELECT 'purple'::rainbow::rgb; - ^ +ERROR: value for domain rgb violates check constraint "rgb_check" CONTEXT: referenced column: rgb DROP DOMAIN rgb; -ERROR: type "rgb" does not exist -- -- Arrays -- diff --git a/src/test/regress/expected/single_node_rangetypes.out b/src/test/regress/expected/single_node_rangetypes.out index 92662641a..8b02ca47f 100644 --- a/src/test/regress/expected/single_node_rangetypes.out +++ b/src/test/regress/expected/single_node_rangetypes.out @@ -921,32 +921,32 @@ drop table float8range_test; -- Test range types over domains -- create domain mydomain as int4; -ERROR: domain is not yet supported. create type mydomainrange as range(subtype=mydomain); -ERROR: type "mydomain" does not exist select '[4,50)'::mydomainrange @> 7::mydomain; -ERROR: type "mydomainrange" does not exist -LINE 1: select '[4,50)'::mydomainrange @> 7::mydomain; - ^ + ?column? +---------- + t +(1 row) + drop domain mydomain; -- fail -ERROR: type "mydomain" does not exist +ERROR: cannot drop type mydomain because other objects depend on it +DETAIL: type mydomainrange depends on type mydomain +HINT: Use DROP ... CASCADE to drop the dependent objects too. drop domain mydomain cascade; -ERROR: type "mydomain" does not exist +NOTICE: drop cascades to type mydomainrange -- -- Test domains over range types -- create domain restrictedrange as int4range check (upper(value) < 10); -ERROR: domain is not yet supported. select '[4,5)'::restrictedrange @> 7; -ERROR: type "restrictedrange" does not exist -LINE 1: select '[4,5)'::restrictedrange @> 7; - ^ + ?column? +---------- + f +(1 row) + select '[4,50)'::restrictedrange @> 7; -- should fail -ERROR: type "restrictedrange" does not exist -LINE 1: select '[4,50)'::restrictedrange @> 7; - ^ +ERROR: value for domain restrictedrange violates check constraint "restrictedrange_check" drop domain restrictedrange; -ERROR: type "restrictedrange" does not exist -- -- Test multiple range types over the same subtype -- diff --git a/src/test/regress/expected/sqlLLT.out b/src/test/regress/expected/sqlLLT.out index a55e5a970..6dce518a2 100644 --- a/src/test/regress/expected/sqlLLT.out +++ b/src/test/regress/expected/sqlLLT.out @@ -3205,7 +3205,6 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for tab create view alter_llt1.v1 as select * from alter_llt1.t1; create function alter_llt1.plus1(int) returns int as 'select $1+1' language sql; create domain alter_llt1.posint integer check (value > 0); -ERROR: domain is not yet supported. create type alter_llt1.ctype as (f1 int, f2 text); create function alter_llt1.same(alter_llt1.ctype, alter_llt1.ctype) returns boolean language sql as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';