Handle empty result set

Should never happen, but just in case.`
This commit is contained in:
Ian Barwick
2015-01-27 16:28:17 +09:00
parent 23ef305afb
commit 36d94c88ac

View File

@@ -448,6 +448,13 @@ get_upstream_connection(PGconn *standby_conn, char *cluster, int node_id,
return NULL;
}
if(!PQntuples(res))
{
log_notice(_("No upstream server record found"));
PQclear(res);
return NULL;
}
strncpy(upstream_conninfo, PQgetvalue(res, 0, 0), MAXCONNINFO);
if(upstream_node_id_ptr != NULL)