diff --git a/src/bin/pg_ctl/pg_ctl.cpp b/src/bin/pg_ctl/pg_ctl.cpp index 84459bb4d3bc18d1f2bce1d502437ff9ab7387ee..0fcefc0759a6e7edcec94ae903646c33f4733651 100644 --- a/src/bin/pg_ctl/pg_ctl.cpp +++ b/src/bin/pg_ctl/pg_ctl.cpp @@ -1035,8 +1035,9 @@ static PGPing test_postmaster_connection(pgpid_t pm_pid, bool do_checkpoint, str _("could not stat file gaussdb_state_file %s: %s\n"), gaussdb_state_file, strerror(errno)); - } else { - if (beforeStat.st_mtime != afterStat.st_mtime) { + } else if (errno != ENOENT) { + if (beforeStat.st_mtim.tv_sec != afterStat.st_mtim.tv_sec || + beforeStat.st_mtim.tv_nsec != afterStat.st_mtim.tv_nsec) { nRet = memset_s(&state, sizeof(state), 0, sizeof(state)); securec_check_c(nRet, "\0", "\0"); ReadDBStateFile(&state); diff --git a/src/gausskernel/optimizer/rewrite/rewriteDefine.cpp b/src/gausskernel/optimizer/rewrite/rewriteDefine.cpp index a672b3ef93eedb7ae0e72002ea0b565441c9f1f3..0cce979ae0457dd5fd289006d95f4a1a3047c6a1 100755 --- a/src/gausskernel/optimizer/rewrite/rewriteDefine.cpp +++ b/src/gausskernel/optimizer/rewrite/rewriteDefine.cpp @@ -585,7 +585,7 @@ void DefineQueryRewrite( heap_freetuple_ext(classTup); heap_close(relationRelation, RowExclusiveLock); -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES RemovePgxcClass(event_relid); (void)deleteDependencyRecordsFor(PgxcClassRelationId, event_relid, false); if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) { diff --git a/src/gausskernel/process/tcop/utility.cpp b/src/gausskernel/process/tcop/utility.cpp index 0f7057ceb74efe9ad90d96de5ad28170130dd5c8..d2d0ee3c1f322d99f97f1975b0961d5225913bc4 100755 --- a/src/gausskernel/process/tcop/utility.cpp +++ b/src/gausskernel/process/tcop/utility.cpp @@ -2779,7 +2779,7 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi switch (((DropStmt*)parse_tree)->removeType) { case OBJECT_INDEX: -#ifdef ENABLE_MULTIPLE_NODES +#ifdef PGXC if (((DropStmt*)parse_tree)->concurrent) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), @@ -3586,9 +3586,9 @@ 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 */ +#endif /* ENABLE_MULTIPLE_NODES */ { AlterDomainStmt* stmt = (AlterDomainStmt*)parse_tree; @@ -3795,12 +3795,12 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi switch (stmt->kind) { case OBJECT_AGGREGATE: -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES if (!u_sess->attr.attr_common.IsInplaceUpgrade && !u_sess->exec_cxt.extension_is_valid) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("user defined aggregate is not yet supported."))); -#endif /* PGXC */ +#endif /* ENABLE_MULTIPLE_NODES */ DefineAggregate(stmt->defnames, stmt->args, stmt->oldstyle, stmt->definition); break; case OBJECT_OPERATOR: @@ -3928,10 +3928,10 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi } break; case T_CreateRangeStmt: /* CREATE TYPE AS RANGE */ -#ifdef ENABLE_MULTIPLE_NODES +#ifdef PGXC ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("user defined range type is not yet supported."))); -#endif /* ENABLE_MULTIPLE_NODES */ +#endif /* PGXC */ DefineRange((CreateRangeStmt*)parse_tree); #ifdef PGXC if (IS_PGXC_COORDINATOR) @@ -4140,14 +4140,12 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi is_first_node = (strcmp(first_exec_node, g_instance.attr.attr_common.PGXCNodeName) == 0); } -#ifdef ENABLE_MULTIPLE_NODES if (stmt->concurrent) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("PGXC does not support concurrent INDEX yet"), errdetail("The feature is not currently supported"))); } -#endif /* INDEX on a temporary table cannot use 2PC at commit */ rel_id = RangeVarGetRelidExtended(stmt->relation, AccessShareLock, true, false, false, true, NULL, NULL); @@ -4242,10 +4240,10 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi } break; case T_RuleStmt: /* CREATE RULE */ -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES if (!IsInitdb && !u_sess->attr.attr_sql.enable_cluster_resize && !u_sess->exec_cxt.extension_is_valid) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RULE is not yet supported."))); -#endif /* PGXC */ +#endif /* ENABLE_MULTIPLE_NODES */ DefineRule((RuleStmt*)parse_tree, query_string); #ifdef PGXC if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) { @@ -4929,10 +4927,10 @@ 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 */ +#endif /* ENABLE_MULTIPLE_NODES */ DefineDomain((CreateDomainStmt*)parse_tree); #ifdef PGXC if (IS_PGXC_COORDINATOR) @@ -8533,9 +8531,11 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string) return; else break; +#ifdef ENABLE_MULTIPLE_NODES case OBJECT_AGGREGATE: tag = "AGGREGATE"; break; +#endif case OBJECT_OPERATOR: tag = "OPERATOR"; break; @@ -8548,9 +8548,11 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string) case OBJECT_COLLATION: tag = "COLLATION"; break; +#ifdef ENABLE_MULTIPLE_NODES case OBJECT_RULE: tag = "RULE"; break; +#endif case OBJECT_TSDICTIONARY: case OBJECT_TSCONFIGURATION: ts_check_feature_disable(); @@ -8598,6 +8600,7 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string) */ bool CheckExtensionInWhiteList(const char* extension_name, uint32 hash_value, bool hash_check) { +#ifdef ENABLE_MULTIPLE_NODES /* 2902411162 hash for fastcheck, the sql file is much shorter than published version. */ uint32 postgisHashHistory[POSTGIS_VERSION_NUM] = {2902411162, 2959454932}; @@ -8619,7 +8622,7 @@ bool CheckExtensionInWhiteList(const char* extension_name, uint32 hash_value, bo return true; } } - +#endif return true; } diff --git a/src/test/regress/expected/single_node_enum.out b/src/test/regress/expected/single_node_enum.out index 041ebaf6d9fb27c6b94b18b8461d93b211133a2c..a7c80858dbb268ff651cbc84c8f432f1f2de783e 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_errors.out b/src/test/regress/expected/single_node_errors.out index 497dc1fb32ecdf1e0f804a1a84b2858d68ed1610..299262e3587ad844e9d90db0b939f0d9d0367597 100644 --- a/src/test/regress/expected/single_node_errors.out +++ b/src/test/regress/expected/single_node_errors.out @@ -127,12 +127,12 @@ create aggregate newavg2 (sfunc = int4pl, stype = int4, finalfunc = int2um, initcond = '0'); -ERROR: user defined aggregate is not yet supported. +ERROR: function int2um(smallint) requires run-time type coercion -- left out basetype create aggregate newcnt1 (sfunc = int4inc, stype = int4, initcond = '0'); -ERROR: user defined aggregate is not yet supported. +ERROR: aggregate input type must be specified -- -- DROP INDEX -- missing index name diff --git a/src/test/regress/expected/single_node_rangetypes.out b/src/test/regress/expected/single_node_rangetypes.out index 92662641a4b5d4a82f59e4c23f2906779ca51485..171b90296ad760e1a6979043a19813d6c9b221c9 100644 --- a/src/test/regress/expected/single_node_rangetypes.out +++ b/src/test/regress/expected/single_node_rangetypes.out @@ -1,195 +1,167 @@ -- Tests for range data types. create type textrange as range (subtype=text, collation="C"); +ERROR: user defined range type is not yet supported. -- -- test input parser -- -- negative tests; should fail select ''::textrange; - textrange ------------ - -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select ''::textrange; + ^ +CONTEXT: referenced column: textrange select '-[a,z)'::textrange; -ERROR: malformed range literal: "-[a,z)" +ERROR: type "textrange" does not exist LINE 1: select '-[a,z)'::textrange; - ^ -DETAIL: Missing left parenthesis or bracket. + ^ CONTEXT: referenced column: textrange select '[a,z) - '::textrange; -ERROR: malformed range literal: "[a,z) - " +ERROR: type "textrange" does not exist LINE 1: select '[a,z) - '::textrange; - ^ -DETAIL: Junk after right parenthesis or bracket. + ^ CONTEXT: referenced column: textrange select '(",a)'::textrange; -ERROR: malformed range literal: "(",a)" +ERROR: type "textrange" does not exist LINE 1: select '(",a)'::textrange; - ^ -DETAIL: Unexpected end of input. + ^ CONTEXT: referenced column: textrange select '(,,a)'::textrange; -ERROR: malformed range literal: "(,,a)" +ERROR: type "textrange" does not exist LINE 1: select '(,,a)'::textrange; - ^ -DETAIL: Too many commas. + ^ CONTEXT: referenced column: textrange select '(),a)'::textrange; -ERROR: malformed range literal: "(),a)" +ERROR: type "textrange" does not exist LINE 1: select '(),a)'::textrange; - ^ -DETAIL: Missing comma after lower bound. + ^ CONTEXT: referenced column: textrange select '(a,))'::textrange; -ERROR: malformed range literal: "(a,))" +ERROR: type "textrange" does not exist LINE 1: select '(a,))'::textrange; - ^ -DETAIL: Junk after right parenthesis or bracket. + ^ CONTEXT: referenced column: textrange select '(],a)'::textrange; -ERROR: malformed range literal: "(],a)" +ERROR: type "textrange" does not exist LINE 1: select '(],a)'::textrange; - ^ -DETAIL: Missing comma after lower bound. + ^ CONTEXT: referenced column: textrange select '(a,])'::textrange; -ERROR: malformed range literal: "(a,])" +ERROR: type "textrange" does not exist LINE 1: select '(a,])'::textrange; - ^ -DETAIL: Junk after right parenthesis or bracket. + ^ CONTEXT: referenced column: textrange select '[z,a]'::textrange; -ERROR: range lower bound must be less than or equal to range upper bound +ERROR: type "textrange" does not exist LINE 1: select '[z,a]'::textrange; - ^ + ^ CONTEXT: referenced column: textrange -- should succeed select ' empty '::textrange; - textrange ------------ - empty -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select ' empty '::textrange; + ^ +CONTEXT: referenced column: textrange select ' ( empty, empty ) '::textrange; - textrange ----------------------- - (" empty"," empty ") -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select ' ( empty, empty ) '::textrange; + ^ +CONTEXT: referenced column: textrange select ' ( " a " " a ", " z " " z " ) '::textrange; - textrange --------------------------- - (" a a "," z z ") -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select ' ( " a " " a ", " z " " z " ) '::textrange; + ^ +CONTEXT: referenced column: textrange select '(,z)'::textrange; - textrange ------------ - (,z) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(,z)'::textrange; + ^ +CONTEXT: referenced column: textrange select '(a,)'::textrange; - textrange ------------ - (a,) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(a,)'::textrange; + ^ +CONTEXT: referenced column: textrange select '[,z]'::textrange; - textrange ------------ - (,z] -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '[,z]'::textrange; + ^ +CONTEXT: referenced column: textrange select '[a,]'::textrange; - textrange ------------ - [a,) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '[a,]'::textrange; + ^ +CONTEXT: referenced column: textrange select '(,)'::textrange; - textrange ------------ - (,) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(,)'::textrange; + ^ +CONTEXT: referenced column: textrange select '[ , ]'::textrange; - textrange ------------ - [" "," "] -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '[ , ]'::textrange; + ^ +CONTEXT: referenced column: textrange select '["",""]'::textrange; -ERROR: rangetypes.cpp : 2140 : The parameter destMax is equal to zero or larger than the macro : SECUREC_STRING_MAX_LEN. +ERROR: type "textrange" does not exist LINE 1: select '["",""]'::textrange; - ^ + ^ CONTEXT: referenced column: textrange select '[",",","]'::textrange; - textrange ------------ - [",",","] -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '[",",","]'::textrange; + ^ +CONTEXT: referenced column: textrange select '["\\","\\"]'::textrange; - textrange -------------- - ["\\","\\"] -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '["\\","\\"]'::textrange; + ^ +CONTEXT: referenced column: textrange select '(\\,a)'::textrange; - textrange ------------ - ("\\",a) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(\\,a)'::textrange; + ^ +CONTEXT: referenced column: textrange select '((,z)'::textrange; - textrange ------------ - ("(",z) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '((,z)'::textrange; + ^ +CONTEXT: referenced column: textrange select '([,z)'::textrange; - textrange ------------ - ("[",z) -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '([,z)'::textrange; + ^ +CONTEXT: referenced column: textrange select '(!,()'::textrange; - textrange ------------ - (!,"(") -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(!,()'::textrange; + ^ +CONTEXT: referenced column: textrange select '(!,[)'::textrange; - textrange ------------ - (!,"[") -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(!,[)'::textrange; + ^ +CONTEXT: referenced column: textrange select '[a,a]'::textrange; - textrange ------------ - [a,a] -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '[a,a]'::textrange; + ^ +CONTEXT: referenced column: textrange -- these are allowed but normalize to empty: select '[a,a)'::textrange; - textrange ------------ - empty -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '[a,a)'::textrange; + ^ +CONTEXT: referenced column: textrange select '(a,a]'::textrange; - textrange ------------ - empty -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(a,a]'::textrange; + ^ +CONTEXT: referenced column: textrange select '(a,a)'::textrange; - textrange ------------ - empty -(1 row) - +ERROR: type "textrange" does not exist +LINE 1: select '(a,a)'::textrange; + ^ +CONTEXT: referenced column: textrange -- -- create some test data and test the operators -- @@ -899,69 +871,75 @@ set timezone to default; -- --should fail create type float8range as range (subtype=float8, subtype_diff=float4mi); -ERROR: function float4mi(double precision, double precision) does not exist +ERROR: user defined range type is not yet supported. --should succeed create type float8range as range (subtype=float8, subtype_diff=float8mi); +ERROR: user defined range type is not yet supported. select '[123.001, 5.e9)'::float8range @> 888.882::float8; - ?column? ----------- - t -(1 row) - +ERROR: type "float8range" does not exist +LINE 1: select '[123.001, 5.e9)'::float8range @> 888.882::float8; + ^ create table float8range_test(f8r float8range, i int); +ERROR: type "float8range" does not exist +LINE 1: create table float8range_test(f8r float8range, i int); + ^ insert into float8range_test values(float8range(-100.00007, '1.111113e9'), 42); +ERROR: relation "float8range_test" does not exist on datanode1 +LINE 1: insert into float8range_test values(float8range(-100.00007, ... + ^ select * from float8range_test; - f8r | i --------------------------+---- - [-100.00007,1111113000) | 42 -(1 row) - +ERROR: relation "float8range_test" does not exist on datanode1 +LINE 1: select * from float8range_test; + ^ drop table float8range_test; +ERROR: table "float8range_test" does not exist -- -- 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 +ERROR: user defined range type is not yet supported. select '[4,50)'::mydomainrange @> 7::mydomain; ERROR: type "mydomainrange" does not exist LINE 1: select '[4,50)'::mydomainrange @> 7::mydomain; ^ drop domain mydomain; -- fail -ERROR: type "mydomain" does not exist drop domain mydomain cascade; ERROR: type "mydomain" does not exist -- -- 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 -- create type textrange1 as range(subtype=text, collation="C"); +ERROR: user defined range type is not yet supported. create type textrange2 as range(subtype=text, collation="C"); +ERROR: user defined range type is not yet supported. select textrange1('a','Z') @> 'b'::text; -ERROR: range lower bound must be less than or equal to range upper bound +ERROR: function textrange1(unknown, unknown) does not exist +LINE 1: select textrange1('a','Z') @> 'b'::text; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. select textrange2('a','z') @> 'b'::text; - ?column? ----------- - t -(1 row) - +ERROR: function textrange2(unknown, unknown) does not exist +LINE 1: select textrange2('a','z') @> 'b'::text; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. drop type textrange1; +ERROR: type "textrange1" does not exist drop type textrange2; +ERROR: type "textrange2" does not exist -- -- Test polymorphic type system -- @@ -1042,34 +1020,40 @@ drop table i8r_array; -- Ranges of arrays -- create type arrayrange as range (subtype=int4[]); +ERROR: user defined range type is not yet supported. select arrayrange(ARRAY[1,2], ARRAY[2,1]); - arrayrange -------------------- - ["{1,2}","{2,1}") -(1 row) - +ERROR: function arrayrange(integer[], integer[]) does not exist +LINE 1: select arrayrange(ARRAY[1,2], ARRAY[2,1]); + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: arrayrange select arrayrange(ARRAY[2,1], ARRAY[1,2]); -- fail -ERROR: range lower bound must be less than or equal to range upper bound +ERROR: function arrayrange(integer[], integer[]) does not exist +LINE 1: select arrayrange(ARRAY[2,1], ARRAY[1,2]); + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. CONTEXT: referenced column: arrayrange select array[1,1] <@ arrayrange(array[1,2], array[2,1]); - ?column? ----------- - f -(1 row) - +ERROR: function arrayrange(integer[], integer[]) does not exist +LINE 1: select array[1,1] <@ arrayrange(array[1,2], array[2,1]); + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. select array[1,3] <@ arrayrange(array[1,2], array[2,1]); - ?column? ----------- - t -(1 row) - +ERROR: function arrayrange(integer[], integer[]) does not exist +LINE 1: select array[1,3] <@ arrayrange(array[1,2], array[2,1]); + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- -- Check behavior when subtype lacks a hash function -- create type cashrange as range (subtype = money); +ERROR: user defined range type is not yet supported. set enable_sort = off; -- try to make it pick a hash setop implementation select '(2,5)'::cashrange except select '(5,6)'::cashrange; -ERROR: could not identify a hash function for type money +ERROR: type "cashrange" does not exist +LINE 1: select '(2,5)'::cashrange except select '(5,6)'::cashrange; + ^ +CONTEXT: referenced column: cashrange reset enable_sort; -- -- OUT/INOUT/TABLE functions