Merge pull request #1326 from citusdata/fix_node_copy_error

Fix node copy error
pull/1332/head
Burak Yücesoy 2017-04-17 09:19:55 -08:00 committed by GitHub
commit f5a406a23e
1 changed files with 4 additions and 1 deletions

View File

@ -639,6 +639,7 @@ GetNodeTuple(char *nodeName, int32 nodePort)
ScanKeyData scanKey[scanKeyCount]; ScanKeyData scanKey[scanKeyCount];
SysScanDesc scanDescriptor = NULL; SysScanDesc scanDescriptor = NULL;
HeapTuple heapTuple = NULL; HeapTuple heapTuple = NULL;
HeapTuple nodeTuple = NULL;
ScanKeyInit(&scanKey[0], Anum_pg_dist_node_nodename, ScanKeyInit(&scanKey[0], Anum_pg_dist_node_nodename,
BTEqualStrategyNumber, F_TEXTEQ, CStringGetTextDatum(nodeName)); BTEqualStrategyNumber, F_TEXTEQ, CStringGetTextDatum(nodeName));
@ -654,10 +655,12 @@ GetNodeTuple(char *nodeName, int32 nodePort)
nodeName, nodePort))); nodeName, nodePort)));
} }
nodeTuple = heap_copytuple(heapTuple);
systable_endscan(scanDescriptor); systable_endscan(scanDescriptor);
heap_close(pgDistNode, AccessShareLock); heap_close(pgDistNode, AccessShareLock);
return heapTuple; return nodeTuple;
} }