Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 09e5ed1

Browse files
committed
fix for PGPRO-1714
1 parent c42e368 commit 09e5ed1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

multimaster.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4495,16 +4495,20 @@ mtm_collect_cluster_info(PG_FUNCTION_ARGS)
44954495
result = PQexec(conn, "select * from mtm.get_cluster_state()");
44964496

44974497
if (PQresultStatus(result) != PGRES_TUPLES_OK || PQntuples(result) != 1) {
4498-
MTM_ELOG(ERROR, "Failed to receive data from %d", usrfctx->nodeId);
4498+
MTM_ELOG(WARNING, "Failed to receive data from %d", usrfctx->nodeId);
4499+
PQclear(result);
4500+
PQfinish(conn);
4501+
SRF_RETURN_NEXT_NULL(funcctx);
44994502
}
4500-
4501-
for (i = 0; i < Natts_mtm_cluster_state; i++) {
4502-
values[i] = PQgetvalue(result, 0, i);
4503+
else
4504+
{
4505+
for (i = 0; i < Natts_mtm_cluster_state; i++)
4506+
values[i] = PQgetvalue(result, 0, i);
4507+
tuple = BuildTupleFromCStrings(funcctx->attinmeta, values);
4508+
PQclear(result);
4509+
PQfinish(conn);
4510+
SRF_RETURN_NEXT(funcctx, HeapTupleGetDatum(tuple));
45034511
}
4504-
tuple = BuildTupleFromCStrings(funcctx->attinmeta, values);
4505-
PQclear(result);
4506-
PQfinish(conn);
4507-
SRF_RETURN_NEXT(funcctx, HeapTupleGetDatum(tuple));
45084512
}
45094513
}
45104514

0 commit comments

Comments
 (0)