GetNextNodeId() incorrectly called PG_RETURN_DATUM

- Also stabilize the output of a multi_router_planner test
pull/1917/merge
Brian Cloutier 2018-01-29 15:32:36 -08:00 committed by GitHub
parent 61a6b846b9
commit b864d014ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 9 deletions

View File

@ -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;
}

View File

@ -1204,7 +1204,8 @@ SELECT
FROM
articles_hash_mx
GROUP BY
author_id;
author_id
ORDER BY c;
c
---
4

View File

@ -1902,7 +1902,8 @@ SELECT
FROM
articles_hash
GROUP BY
author_id;
author_id
ORDER BY c;
c
---
4

View File

@ -529,7 +529,8 @@ SELECT
FROM
articles_hash_mx
GROUP BY
author_id;
author_id
ORDER BY c;
-- queries inside transactions can be router plannable
BEGIN;

View File

@ -911,7 +911,8 @@ SELECT
FROM
articles_hash
GROUP BY
author_id;
author_id
ORDER BY c;
-- queries inside transactions can be router plannable
BEGIN;