File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -4495,16 +4495,20 @@ mtm_collect_cluster_info(PG_FUNCTION_ARGS)
4495
4495
result = PQexec (conn , "select * from mtm.get_cluster_state()" );
4496
4496
4497
4497
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 );
4499
4502
}
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 ));
4503
4511
}
4504
- tuple = BuildTupleFromCStrings (funcctx -> attinmeta , values );
4505
- PQclear (result );
4506
- PQfinish (conn );
4507
- SRF_RETURN_NEXT (funcctx , HeapTupleGetDatum (tuple ));
4508
4512
}
4509
4513
}
4510
4514
You can’t perform that action at this time.
0 commit comments