repartition_join_execution: Don't store 64 bit integers as poin… (#3551)

Pointers are not necessarily 64bit
pull/3550/head
Philip Dubé 2020-02-28 14:06:06 +00:00 committed by GitHub
parent 20abc4d2b5
commit 2fae132e45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

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