mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 08:06:29 +00:00
fix: sscanf() does not set variables to 0 on error
This commit is contained in:
@@ -848,6 +848,9 @@ do_failover(void)
|
|||||||
terminate(ERR_FAILOVER_FAIL);
|
terminate(ERR_FAILOVER_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uxlogid = 0;
|
||||||
|
uxrecoff = 0;
|
||||||
|
|
||||||
sqlquery_snprintf(sqlquery, "SELECT pg_last_xlog_receive_location()");
|
sqlquery_snprintf(sqlquery, "SELECT pg_last_xlog_receive_location()");
|
||||||
res = PQexec(nodeConn, sqlquery);
|
res = PQexec(nodeConn, sqlquery);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
@@ -934,6 +937,9 @@ do_failover(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uxlogid = 0;
|
||||||
|
uxrecoff = 0;
|
||||||
|
|
||||||
sqlquery_snprintf(sqlquery, "SELECT %s.repmgr_get_last_standby_location()", repmgr_schema);
|
sqlquery_snprintf(sqlquery, "SELECT %s.repmgr_get_last_standby_location()", repmgr_schema);
|
||||||
res = PQexec(nodeConn, sqlquery);
|
res = PQexec(nodeConn, sqlquery);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user