!231 Fix compile warning.

Merge pull request !231 from TotaJ/feature/parallel
This commit is contained in:
opengauss-bot
2020-09-17 20:31:31 +08:00
committed by Gitee
3 changed files with 19 additions and 16 deletions

View File

@ -1067,7 +1067,7 @@ BgwHandleStatus GetBackgroundWorkerPid(const BackgroundWorkerHandle *handle, Thr
/* All done. */
LWLockRelease(BackgroundWorkerLock);
ereport(LOG,
ereport(DEBUG1,
(errmsg("GetBackgroundWorkerPid slot: %d, pid: %lu",
handle->slot, pid)));
if (pid == 0) {

View File

@ -670,22 +670,25 @@ shm_mq_result shm_mq_receive(shm_mq_handle *mqh, Size *nbytesp, void **datap, bo
/* Copy as much as we can. */
Assert(mqh->mqh_partial_bytes + rb <= nbytes);
errno_t rc = memcpy_s(&mqh->mqh_buffer[mqh->mqh_partial_bytes], rb, rawdata, rb);
securec_check(rc, "\0", "\0");
mqh->mqh_partial_bytes += rb;
if (rb != 0) {
errno_t rc = memcpy_s(&mqh->mqh_buffer[mqh->mqh_partial_bytes], rb, rawdata, rb);
securec_check(rc, "\0", "\0");
mqh->mqh_partial_bytes += rb;
/*
* Update count of bytes that can be consumed, accounting for
* alignment padding. Note that this will never actually insert any
* padding except at the end of a message, because the buffer size is
* a multiple of MAXIMUM_ALIGNOF, and each read and write is as well.
*/
Assert(mqh->mqh_partial_bytes == nbytes || rb == MAXALIGN(rb));
mqh->mqh_consume_pending += MAXALIGN(rb);
/*
* Update count of bytes that can be consumed, accounting for
* alignment padding. Note that this will never actually insert any
* padding except at the end of a message, because the buffer size is
* a multiple of MAXIMUM_ALIGNOF, and each read and write is as well.
*/
Assert(mqh->mqh_partial_bytes == nbytes || rb == MAXALIGN(rb));
mqh->mqh_consume_pending += MAXALIGN(rb);
}
/* If we got all the data, exit the loop. */
if (mqh->mqh_partial_bytes >= nbytes)
if (mqh->mqh_partial_bytes >= nbytes) {
break;
}
/* Wait for some more data. */
still_needed = nbytes - mqh->mqh_partial_bytes;

View File

@ -45,7 +45,6 @@
#include <signal.h>
#include "c.h"
#include "access/heapam.h"
#include "datatype/timestamp.h"
#include "gs_thread.h"
#include "knl/knl_guc.h"
@ -60,7 +59,6 @@
#include "storage/backendid.h"
#include "storage/s_lock.h"
#include "storage/shmem.h"
#include "storage/predicate.h"
#include "postmaster/bgworker.h"
#include "storage/dsm.h"
#include "utils/palloc.h"
@ -2042,6 +2040,8 @@ typedef struct knl_u_ext_fdw_context {
} knl_u_ext_fdw_context;
/* Info need to pass from leader to worker */
struct ParallelHeapScanDescData;
typedef uint64 XLogRecPtr;
typedef struct ParallelInfoContext {
Oid database_id;
Oid authenticated_user_id;
@ -2060,7 +2060,7 @@ typedef struct ParallelInfoContext {
char *param_space;
Size param_len;
int pscan_num;
ParallelHeapScanDesc *pscan;
ParallelHeapScanDescData **pscan;
int usedComboCids;
int sizeComboCids;
HTAB *comboHash;