Remove VLA from UpdateNodeLocation

pull/1965/head
Brian Cloutier 2018-01-18 12:09:57 -08:00 committed by Brian Cloutier
parent a2ed45e206
commit e6ebfc1f53
1 changed files with 2 additions and 3 deletions

View File

@ -501,11 +501,10 @@ static void
UpdateNodeLocation(int32 nodeId, char *newNodeName, int32 newNodePort) UpdateNodeLocation(int32 nodeId, char *newNodeName, int32 newNodePort)
{ {
const bool indexOK = true; const bool indexOK = true;
const int scanKeyCount = 1;
Relation pgDistNode = NULL; Relation pgDistNode = NULL;
TupleDesc tupleDescriptor = NULL; TupleDesc tupleDescriptor = NULL;
ScanKeyData scanKey[scanKeyCount]; ScanKeyData scanKey[1];
SysScanDesc scanDescriptor = NULL; SysScanDesc scanDescriptor = NULL;
HeapTuple heapTuple = NULL; HeapTuple heapTuple = NULL;
Datum values[Natts_pg_dist_node]; Datum values[Natts_pg_dist_node];
@ -519,7 +518,7 @@ UpdateNodeLocation(int32 nodeId, char *newNodeName, int32 newNodePort)
BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(nodeId)); BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(nodeId));
scanDescriptor = systable_beginscan(pgDistNode, DistNodeNodeIdIndexId(), indexOK, scanDescriptor = systable_beginscan(pgDistNode, DistNodeNodeIdIndexId(), indexOK,
NULL, scanKeyCount, scanKey); NULL, 1, scanKey);
heapTuple = systable_getnext(scanDescriptor); heapTuple = systable_getnext(scanDescriptor);
if (!HeapTupleIsValid(heapTuple)) if (!HeapTupleIsValid(heapTuple))