poke it around until it works less badly

This commit is contained in:
Ian Barwick
2017-06-29 09:35:09 +09:00
parent fa86fe4ad8
commit 3514e20367
7 changed files with 81 additions and 7 deletions

View File

@@ -2364,6 +2364,32 @@ set_voting_status_initiated(PGconn *conn)
}
bool
announce_candidature(PGconn *conn, t_node_info *this_node, t_node_info *other_node)
{
PQExpBufferData query;
PGresult *res;
bool retval;
initPQExpBuffer(&query);
appendPQExpBuffer(&query,
"SELECT repmgr.other_node_is_candidate(%i)",
this_node->node_id);
res = PQexec(conn, query.data);
termPQExpBuffer(&query);
retval = (strcmp(PQgetvalue(res, 0, 0), "t") == 0)
? true
: false;
PQclear(res);
return retval;
}
/* ============================ */
/* replication status functions */
/* ============================ */