mirror of https://github.com/citusdata/citus.git
GetNextNodeId() incorrectly called PG_RETURN_DATUM
- Also stabilize the output of a multi_router_planner testrelease-7.2
parent
d4147632c5
commit
939385cf1e
|
@ -1192,20 +1192,18 @@ GetNextNodeId()
|
|||
Datum sequenceIdDatum = ObjectIdGetDatum(sequenceId);
|
||||
Oid savedUserId = InvalidOid;
|
||||
int savedSecurityContext = 0;
|
||||
Datum nextNodedIdDatum = 0;
|
||||
Datum nextNodeIdDatum;
|
||||
int nextNodeId = 0;
|
||||
|
||||
GetUserIdAndSecContext(&savedUserId, &savedSecurityContext);
|
||||
SetUserIdAndSecContext(CitusExtensionOwner(), SECURITY_LOCAL_USERID_CHANGE);
|
||||
|
||||
/* generate new and unique shardId from sequence */
|
||||
nextNodedIdDatum = DirectFunctionCall1(nextval_oid, sequenceIdDatum);
|
||||
nextNodeIdDatum = DirectFunctionCall1(nextval_oid, sequenceIdDatum);
|
||||
|
||||
SetUserIdAndSecContext(savedUserId, savedSecurityContext);
|
||||
|
||||
PG_RETURN_DATUM(nextNodedIdDatum);
|
||||
|
||||
nextNodeId = DatumGetUInt32(nextNodeId);
|
||||
nextNodeId = DatumGetUInt32(nextNodeIdDatum);
|
||||
|
||||
return nextNodeId;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue