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.1
parent
73e786b0c6
commit
d9cf5ff3ab
|
@ -1192,20 +1192,18 @@ GetNextNodeId()
|
||||||
Datum sequenceIdDatum = ObjectIdGetDatum(sequenceId);
|
Datum sequenceIdDatum = ObjectIdGetDatum(sequenceId);
|
||||||
Oid savedUserId = InvalidOid;
|
Oid savedUserId = InvalidOid;
|
||||||
int savedSecurityContext = 0;
|
int savedSecurityContext = 0;
|
||||||
Datum nextNodedIdDatum = 0;
|
Datum nextNodeIdDatum;
|
||||||
int nextNodeId = 0;
|
int nextNodeId = 0;
|
||||||
|
|
||||||
GetUserIdAndSecContext(&savedUserId, &savedSecurityContext);
|
GetUserIdAndSecContext(&savedUserId, &savedSecurityContext);
|
||||||
SetUserIdAndSecContext(CitusExtensionOwner(), SECURITY_LOCAL_USERID_CHANGE);
|
SetUserIdAndSecContext(CitusExtensionOwner(), SECURITY_LOCAL_USERID_CHANGE);
|
||||||
|
|
||||||
/* generate new and unique shardId from sequence */
|
/* generate new and unique shardId from sequence */
|
||||||
nextNodedIdDatum = DirectFunctionCall1(nextval_oid, sequenceIdDatum);
|
nextNodeIdDatum = DirectFunctionCall1(nextval_oid, sequenceIdDatum);
|
||||||
|
|
||||||
SetUserIdAndSecContext(savedUserId, savedSecurityContext);
|
SetUserIdAndSecContext(savedUserId, savedSecurityContext);
|
||||||
|
|
||||||
PG_RETURN_DATUM(nextNodedIdDatum);
|
nextNodeId = DatumGetUInt32(nextNodeIdDatum);
|
||||||
|
|
||||||
nextNodeId = DatumGetUInt32(nextNodeId);
|
|
||||||
|
|
||||||
return nextNodeId;
|
return nextNodeId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1153,7 +1153,8 @@ SELECT
|
||||||
FROM
|
FROM
|
||||||
articles_hash_mx
|
articles_hash_mx
|
||||||
GROUP BY
|
GROUP BY
|
||||||
author_id;
|
author_id
|
||||||
|
ORDER BY c;
|
||||||
c
|
c
|
||||||
---
|
---
|
||||||
4
|
4
|
||||||
|
|
|
@ -1832,7 +1832,8 @@ SELECT
|
||||||
FROM
|
FROM
|
||||||
articles_hash
|
articles_hash
|
||||||
GROUP BY
|
GROUP BY
|
||||||
author_id;
|
author_id
|
||||||
|
ORDER BY c;
|
||||||
c
|
c
|
||||||
---
|
---
|
||||||
4
|
4
|
||||||
|
|
|
@ -530,7 +530,8 @@ SELECT
|
||||||
FROM
|
FROM
|
||||||
articles_hash_mx
|
articles_hash_mx
|
||||||
GROUP BY
|
GROUP BY
|
||||||
author_id;
|
author_id
|
||||||
|
ORDER BY c;
|
||||||
|
|
||||||
-- queries inside transactions can be router plannable
|
-- queries inside transactions can be router plannable
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
|
@ -900,7 +900,8 @@ SELECT
|
||||||
FROM
|
FROM
|
||||||
articles_hash
|
articles_hash
|
||||||
GROUP BY
|
GROUP BY
|
||||||
author_id;
|
author_id
|
||||||
|
ORDER BY c;
|
||||||
|
|
||||||
-- queries inside transactions can be router plannable
|
-- queries inside transactions can be router plannable
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
Loading…
Reference in New Issue