mirror of https://github.com/citusdata/citus.git
Merge pull request #2618 from citusdata/fix_relation_size_leak
Make sure to clear `PGresult` in missing placespull/2597/head
commit
6594ffafa1
|
@ -237,6 +237,7 @@ DistributedTableSizeOnWorker(WorkerNode *workerNode, Oid relationId, char *sizeQ
|
|||
tableSizeString = tableSizeStringInfo->data;
|
||||
tableSize = atol(tableSizeString);
|
||||
|
||||
PQclear(result);
|
||||
ClearResults(connection, raiseErrors);
|
||||
|
||||
return tableSize;
|
||||
|
|
|
@ -196,6 +196,7 @@ GetRemoteProcessId(MultiConnection *connection)
|
|||
StringInfo queryStringInfo = makeStringInfo();
|
||||
PGresult *result = NULL;
|
||||
int64 rowCount = 0;
|
||||
int64 resultValue = 0;
|
||||
|
||||
appendStringInfo(queryStringInfo, GET_PROCESS_ID);
|
||||
|
||||
|
@ -208,7 +209,10 @@ GetRemoteProcessId(MultiConnection *connection)
|
|||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
resultValue = ParseIntField(result, 0, 0);
|
||||
|
||||
PQclear(result);
|
||||
ClearResults(connection, false);
|
||||
|
||||
return ParseIntField(result, 0, 0);
|
||||
return resultValue;
|
||||
}
|
||||
|
|
|
@ -563,6 +563,7 @@ TableDDLCommandList(const char *nodeName, uint32 nodePort, const char *tableName
|
|||
ExecuteOptionalRemoteCommand(connection, queryString->data, &result);
|
||||
ddlCommandList = ReadFirstColumnAsText(result);
|
||||
|
||||
PQclear(result);
|
||||
ForgetResults(connection);
|
||||
CloseConnection(connection);
|
||||
|
||||
|
|
Loading…
Reference in New Issue