From 2fae132e45c482a8907974795f4559f596f88f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 28 Feb 2020 14:06:06 +0000 Subject: [PATCH] =?UTF-8?q?repartition=5Fjoin=5Fexecution:=20Don't=20store?= =?UTF-8?q?=2064=20bit=20integers=20as=20poin=E2=80=A6=20(#3551)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pointers are not necessarily 64bit --- .../executor/repartition_join_execution.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/backend/distributed/executor/repartition_join_execution.c b/src/backend/distributed/executor/repartition_join_execution.c index e170a8d50..751b0bc87 100644 --- a/src/backend/distributed/executor/repartition_join_execution.c +++ b/src/backend/distributed/executor/repartition_join_execution.c @@ -106,7 +106,10 @@ ExtractJobsInJobTree(Job *job) static void TraverseJobTree(Job *curJob, List **jobIds) { - *jobIds = lappend(*jobIds, (void *) curJob->jobId); + uint64 *jobIdPointer = palloc(sizeof(uint64)); + *jobIdPointer = curJob->jobId; + + *jobIds = lappend(*jobIds, jobIdPointer); Job *childJob = NULL; foreach_ptr(childJob, curJob->dependentJobList) @@ -124,10 +127,10 @@ GenerateCreateSchemasCommand(List *jobIds, char *ownerName) { StringInfo createSchemaCommand = makeStringInfo(); - void *jobIdPointer = NULL; + uint64 *jobIdPointer = NULL; foreach_ptr(jobIdPointer, jobIds) { - uint64 jobId = (uint64) jobIdPointer; + uint64 jobId = *jobIdPointer; appendStringInfo(createSchemaCommand, WORKER_CREATE_SCHEMA_QUERY, jobId, quote_literal_cstr(ownerName)); } @@ -147,10 +150,10 @@ GenerateJobCommands(List *jobIds, char *templateCommand) { StringInfo createSchemaCommand = makeStringInfo(); - void *jobIdPointer = NULL; + uint64 *jobIdPointer = NULL; foreach_ptr(jobIdPointer, jobIds) { - uint64 jobId = (uint64) jobIdPointer; + uint64 jobId = *jobIdPointer; appendStringInfo(createSchemaCommand, templateCommand, jobId); } return createSchemaCommand->data;