diff --git a/src/bin/gs_guc/pg_guc.cpp b/src/bin/gs_guc/pg_guc.cpp index e22ea41a5..4bc1a2bb3 100644 --- a/src/bin/gs_guc/pg_guc.cpp +++ b/src/bin/gs_guc/pg_guc.cpp @@ -1059,6 +1059,12 @@ parse_next_sync_groups(char **pgroup, char *result) static int transform_az_name(char *config_value, char *allAZString, int allAZStringBufLen, const char *data_dir) { + if (strcmp(config_value, "''") == 0) { + errno_t rc = strncpy_s(allAZString, allAZStringBufLen, config_value, strlen(config_value)); + securec_check_c(rc, "\0", "\0"); + return SUCCESS; + } + char *azString = NULL; char *buf = allAZString; int buflen = allAZStringBufLen; diff --git a/src/common/backend/catalog/builtin_funcs.ini b/src/common/backend/catalog/builtin_funcs.ini index db57ccec1..3bce48d3f 100755 --- a/src/common/backend/catalog/builtin_funcs.ini +++ b/src/common/backend/catalog/builtin_funcs.ini @@ -7557,7 +7557,7 @@ ), AddFuncGroup( "pg_stat_get_wal_senders", 1, - AddBuiltinFunc(_0(3099), _1("pg_stat_get_wal_senders"), _2(0), _3(false), _4(true), _5(pg_stat_get_wal_senders), _6(2249), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(10), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('s'), _19(0), _20(0), _21(22, 20, 23, 25, 25, 25, 25, 1184, 1184, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 23, 25, 25), _22(22, 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o'), _23(22, "pid", "sender_pid", "local_role", "peer_role", "peer_state", "state", "catchup_start", "catchup_end", "sender_sent_location", "sender_write_location", "sender_flush_location", "sender_replay_location", "receiver_received_location", "receiver_write_location", "receiver_flush_location", "receiver_replay_location", "sync_percent", "sync_state", "sync_group", "sync_priority", "sync_most_available", "channel"), _24(NULL), _25("pg_stat_get_wal_senders"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) + AddBuiltinFunc(_0(3099), _1("pg_stat_get_wal_senders"), _2(0), _3(false), _4(true), _5(pg_stat_get_wal_senders), _6(2249), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(10), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('s'), _19(0), _20(0), _21(21, 20, 23, 25, 25, 25, 25, 1184, 1184, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 25), _22(21, 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o'), _23(21, "pid", "sender_pid", "local_role", "peer_role", "peer_state", "state", "catchup_start", "catchup_end", "sender_sent_location", "sender_write_location", "sender_flush_location", "sender_replay_location", "receiver_received_location", "receiver_write_location", "receiver_flush_location", "receiver_replay_location", "sync_percent", "sync_state", "sync_priority", "sync_most_available", "channel"), _24(NULL), _25("pg_stat_get_wal_senders"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f')) ), AddFuncGroup( "pg_stat_get_wlm_ec_operator_info", 1, diff --git a/src/common/backend/utils/init/globals.cpp b/src/common/backend/utils/init/globals.cpp index 7db66384a..81716296e 100644 --- a/src/common/backend/utils/init/globals.cpp +++ b/src/common/backend/utils/init/globals.cpp @@ -59,7 +59,7 @@ bool open_join_children = true; bool will_shutdown = false; /* hard-wired binary version number */ -const uint32 GRAND_VERSION_NUM = 92301; +const uint32 GRAND_VERSION_NUM = 92300; const uint32 MATVIEW_VERSION_NUM = 92213; const uint32 PARTIALPUSH_VERSION_NUM = 92087; diff --git a/src/gausskernel/storage/replication/walsender.cpp b/src/gausskernel/storage/replication/walsender.cpp index 151182ab6..dc7aa3fb4 100644 --- a/src/gausskernel/storage/replication/walsender.cpp +++ b/src/gausskernel/storage/replication/walsender.cpp @@ -4605,7 +4605,7 @@ static void set_xlog_location(ServerMode local_role, XLogRecPtr* sndWrite, XLogR */ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) { -#define PG_STAT_GET_WAL_SENDERS_COLS 22 +#define PG_STAT_GET_WAL_SENDERS_COLS 21 TupleDesc tupdesc; Tuplestorestate *tupstore = NULL; @@ -4830,11 +4830,9 @@ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) /* sync_state and sync_prority */ if (!SyncRepRequested()) { values[j++] = CStringGetTextDatum("Async"); - nulls[j++] = true; values[j++] = Int32GetDatum(0); } else { values[j++] = CStringGetTextDatum("Sync"); - nulls[j++] = true; values[j++] = Int32GetDatum(sync_priority[i]); } } else { @@ -4856,15 +4854,12 @@ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) */ if (priority == 0) { values[j++] = CStringGetTextDatum("Async"); - nulls[j++] = true; } else if (list_member_int((List*)list_nth(sync_standbys, group), i)) { values[j++] = GetWalsndSyncRepConfig(walsnd)->syncrep_method == SYNC_REP_PRIORITY ? CStringGetTextDatum("Sync") : CStringGetTextDatum("Quorum"); - values[j++] = Int32GetDatum(group); } else { values[j++] = CStringGetTextDatum("Potential"); - values[j++] = Int32GetDatum(group); } values[j++] = Int32GetDatum(priority); diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_301.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_301.sql deleted file mode 100644 index 1461f7fee..000000000 --- a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_301.sql +++ /dev/null @@ -1,29 +0,0 @@ -DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; -CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text -) RETURNS SETOF record -STABLE NOT FENCED NOT SHIPPABLE ROWS 10 -LANGUAGE internal AS 'pg_stat_get_wal_senders'; - -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_301.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_301.sql deleted file mode 100644 index 1461f7fee..000000000 --- a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_301.sql +++ /dev/null @@ -1,29 +0,0 @@ -DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; -CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text -) RETURNS SETOF record -STABLE NOT FENCED NOT SHIPPABLE ROWS 10 -LANGUAGE internal AS 'pg_stat_get_wal_senders'; - -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_301.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_301.sql deleted file mode 100644 index 6324361ea..000000000 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_301.sql +++ /dev/null @@ -1,30 +0,0 @@ -DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; -CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_group integer, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text -) RETURNS SETOF record -STABLE NOT FENCED NOT SHIPPABLE ROWS 10 -LANGUAGE internal AS 'pg_stat_get_wal_senders'; - -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_301.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_301.sql deleted file mode 100644 index 6324361ea..000000000 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_301.sql +++ /dev/null @@ -1,30 +0,0 @@ -DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; -CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_group integer, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text -) RETURNS SETOF record -STABLE NOT FENCED NOT SHIPPABLE ROWS 10 -LANGUAGE internal AS 'pg_stat_get_wal_senders'; - -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; \ No newline at end of file