do not exit in get_cluster_size

This commit is contained in:
Christian Kruse
2014-01-16 15:04:31 +01:00
parent 6f149ead8f
commit 192ee3cdb0
2 changed files with 11 additions and 6 deletions

View File

@@ -280,7 +280,7 @@ const char *
get_cluster_size(PGconn *conn)
{
PGresult *res;
const char *size;
const char *size = NULL;
char sqlquery[QUERY_STR_LEN];
sqlquery_snprintf(
@@ -293,11 +293,12 @@ get_cluster_size(PGconn *conn)
{
log_err(_("Get cluster size PQexec failed: %s"),
PQerrorMessage(conn));
PQclear(res);
PQfinish(conn);
exit(ERR_DB_QUERY);
}
size = PQgetvalue(res, 0, 0);
else
{
size = PQgetvalue(res, 0, 0);
}
PQclear(res);
return size;
}

View File

@@ -779,6 +779,7 @@ do_standby_clone(void)
PGconn *conn;
PGresult *res;
char sqlquery[QUERY_STR_LEN], *ret;
const char *cluster_size;
int r = 0, retval = SUCCESS;
int i, is_standby_retval;
@@ -980,7 +981,10 @@ do_standby_clone(void)
}
PQclear(res);
log_info(_("Successfully connected to primary. Current installation size is %s\n"), get_cluster_size(conn));
cluster_size = get_cluster_size(conn);
if (cluster_size == NULL)
exit(ERR_DB_QUERY);
log_info(_("Successfully connected to primary. Current installation size is %s\n"), cluster_size);
/*
* XXX master_xlog_directory should be discovered from master configuration