mirror of https://github.com/citusdata/citus.git
Fix NULL nodeClusterString crush on pg_worker_list.conf migrations
parent
b3d2f9ba71
commit
77626c4238
|
@ -1424,7 +1424,17 @@ TupleToWorkerNode(TupleDesc tupleDescriptor, HeapTuple heapTuple)
|
|||
{
|
||||
Name nodeClusterName = DatumGetName(nodeCluster);
|
||||
char *nodeClusterString = NameStr(*nodeClusterName);
|
||||
strlcpy(workerNode->nodeCluster, nodeClusterString, NAMEDATALEN);
|
||||
|
||||
/*
|
||||
* nodeClusterString can be null if nodecluster column is not present.
|
||||
* In the case of extension creation/upgrade, master_initialize_node_metadata
|
||||
* function is called before the nodecluster column is added to pg_dist_node
|
||||
* table.
|
||||
*/
|
||||
if (nodeClusterString != NULL)
|
||||
{
|
||||
strlcpy(workerNode->nodeCluster, nodeClusterString, NAMEDATALEN);
|
||||
}
|
||||
}
|
||||
|
||||
return workerNode;
|
||||
|
|
Loading…
Reference in New Issue