Ensure all node record structures are initialised

This commit is contained in:
Ian Barwick
2016-07-05 11:33:06 +09:00
parent 8cd79fd7dd
commit e8a0cd33b5
2 changed files with 16 additions and 16 deletions

View File

@@ -52,18 +52,6 @@ typedef struct s_node_info
} t_node_info;
/*
* Struct to store replication slot information
*/
typedef struct s_replication_slot
{
char slot_name[MAXLEN];
char slot_type[MAXLEN];
bool active;
} t_replication_slot;
#define T_NODE_INFO_INITIALIZER { \
NODE_NOT_FOUND, \
NO_UPSTREAM_NODE, \
@@ -78,6 +66,19 @@ typedef struct s_replication_slot
InvalidXLogRecPtr \
}
/*
* Struct to store replication slot information
*/
typedef struct s_replication_slot
{
char slot_name[MAXLEN];
char slot_type[MAXLEN];
bool active;
} t_replication_slot;
PGconn *_establish_db_connection(const char *conninfo,
const bool exit_on_error,
const bool log_notice);

View File

@@ -1,4 +1,3 @@
/*
* repmgr.c - Command interpreter for the repmgr package
* Copyright (C) 2ndQuadrant, 2010-2016
@@ -1128,7 +1127,7 @@ do_standby_register(void)
int ret;
bool record_created;
t_node_info node_record;
t_node_info node_record = T_NODE_INFO_INITIALIZER;
int node_result;
log_info(_("connecting to standby database\n"));
@@ -2762,7 +2761,7 @@ do_standby_switchover(void)
char repmgr_db_cli_params[MAXLEN] = "";
int query_result;
t_node_info remote_node_record;
t_node_info remote_node_record = T_NODE_INFO_INITIALIZER;
bool connection_success,
shutdown_success;
@@ -3455,7 +3454,7 @@ do_standby_switchover(void)
if (options.use_replication_slots)
{
t_node_info local_node_record;
t_node_info local_node_record = T_NODE_INFO_INITIALIZER;
query_result = get_node_record(local_conn, options.cluster_name, options.node, &local_node_record);