diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 0bba9a7..07e4ae0 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -241,7 +241,7 @@ InitializeParallelDSM(ParallelContext *pcxt) PARALLEL_ERROR_QUEUE_SIZE, "parallel error queue size not buffer-aligned"); shm_toc_estimate_chunk(&pcxt->estimator, - PARALLEL_ERROR_QUEUE_SIZE * pcxt->nworkers); + PARALLEL_ERROR_QUEUE_SIZE * (Size)pcxt->nworkers); shm_toc_estimate_keys(&pcxt->estimator, 1); /* Estimate how much we'll need for extension entrypoint info. */ @@ -347,7 +347,7 @@ InitializeParallelDSM(ParallelContext *pcxt) */ error_queue_space = shm_toc_allocate(pcxt->toc, - PARALLEL_ERROR_QUEUE_SIZE * pcxt->nworkers); + PARALLEL_ERROR_QUEUE_SIZE * (Size)pcxt->nworkers); for (i = 0; i < pcxt->nworkers; ++i) { char *start; diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c index 6df62a7..a90e82c 100644 --- a/src/backend/executor/execParallel.c +++ b/src/backend/executor/execParallel.c @@ -278,7 +278,7 @@ ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize) /* Allocate memory for shared memory queue handles. */ responseq = (shm_mq_handle **) - palloc(pcxt->nworkers * sizeof(shm_mq_handle *)); + palloc((Size)pcxt->nworkers * sizeof(shm_mq_handle *)); /* * If not reinitializing, allocate space from the DSM for the queues; @@ -287,7 +287,7 @@ ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize) if (!reinitialize) tqueuespace = shm_toc_allocate(pcxt->toc, - PARALLEL_TUPLE_QUEUE_SIZE * pcxt->nworkers); + PARALLEL_TUPLE_QUEUE_SIZE * (Size)pcxt->nworkers); else tqueuespace = shm_toc_lookup(pcxt->toc, PARALLEL_KEY_TUPLE_QUEUE); @@ -296,7 +296,7 @@ ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize) { shm_mq *mq; - mq = shm_mq_create(tqueuespace + i * PARALLEL_TUPLE_QUEUE_SIZE, + mq = shm_mq_create(tqueuespace + (Size)i * PARALLEL_TUPLE_QUEUE_SIZE, (Size) PARALLEL_TUPLE_QUEUE_SIZE); shm_mq_set_receiver(mq, MyProc); @@ -380,12 +380,12 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers) * looking at pgBufferUsage, so do it unconditionally. */ shm_toc_estimate_chunk(&pcxt->estimator, - sizeof(BufferUsage) * pcxt->nworkers); + sizeof(BufferUsage) * (Size)pcxt->nworkers); shm_toc_estimate_keys(&pcxt->estimator, 1); /* Estimate space for tuple queues. */ shm_toc_estimate_chunk(&pcxt->estimator, - PARALLEL_TUPLE_QUEUE_SIZE * pcxt->nworkers); + PARALLEL_TUPLE_QUEUE_SIZE * (Size)pcxt->nworkers); shm_toc_estimate_keys(&pcxt->estimator, 1); /* @@ -432,7 +432,7 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers) /* Allocate space for each worker's BufferUsage; no need to initialize. */ bufusage_space = shm_toc_allocate(pcxt->toc, - sizeof(BufferUsage) * pcxt->nworkers); + sizeof(BufferUsage) * (Size)pcxt->nworkers); shm_toc_insert(pcxt->toc, PARALLEL_KEY_BUFFER_USAGE, bufusage_space); pei->buffer_usage = bufusage_space;