From 0ad9497335efd0c2625e24054f4c6a33caaed6d2 Mon Sep 17 00:00:00 2001 From: duzhuolin Date: Tue, 8 Aug 2023 15:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=87=BD=E6=95=B0=E5=92=8C?= =?UTF-8?q?=E6=8C=87=E9=92=88=E8=B5=8B=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/parser/parse_utilcmd.cpp | 2 +- src/common/backend/utils/adt/timestamp.cpp | 4 +++- src/gausskernel/storage/mot/core/system/mot_error.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/backend/parser/parse_utilcmd.cpp b/src/common/backend/parser/parse_utilcmd.cpp index 3747f843b..7c3ac0e17 100644 --- a/src/common/backend/parser/parse_utilcmd.cpp +++ b/src/common/backend/parser/parse_utilcmd.cpp @@ -3706,7 +3706,7 @@ static IndexStmt* transformIndexConstraint(Constraint* constraint, CreateStmtCon } else if (attnum == 0) { // expresional index Node *indexkey = NULL; - attform = 0; + attform = NULL; if (indexpr_item == NULL) { ereport(ERROR, diff --git a/src/common/backend/utils/adt/timestamp.cpp b/src/common/backend/utils/adt/timestamp.cpp index 168ba556e..9f5bdcbf2 100644 --- a/src/common/backend/utils/adt/timestamp.cpp +++ b/src/common/backend/utils/adt/timestamp.cpp @@ -4916,6 +4916,7 @@ Datum generate_series_timestamptz(PG_FUNCTION_ARGS) Interval* step = PG_GETARG_INTERVAL_P(2); MemoryContext oldcontext; Interval interval_zero; + errno_t rc; /* create a function context for cross-call persistence */ funcctx = SRF_FIRSTCALL_INIT(); @@ -4937,7 +4938,8 @@ Datum generate_series_timestamptz(PG_FUNCTION_ARGS) fctx->step = *step; /* Determine sign of the interval */ - MemSet(&interval_zero, 0, sizeof(Interval)); + rc = memset_s(&interval_zero, sizeof(Interval), 0, sizeof(Interval)); + securec_check(rc, "\0", "\0"); fctx->step_sign = interval_cmp_internal(&fctx->step, &interval_zero); if (fctx->step_sign == 0) diff --git a/src/gausskernel/storage/mot/core/system/mot_error.cpp b/src/gausskernel/storage/mot/core/system/mot_error.cpp index 3f24413c1..c11265b44 100644 --- a/src/gausskernel/storage/mot/core/system/mot_error.cpp +++ b/src/gausskernel/storage/mot/core/system/mot_error.cpp @@ -161,7 +161,7 @@ extern void PushErrorV(int errorCode, int severity, const char* file, int line, va_list args2; va_copy(args2, args); errno_t erc = vsnprintf_truncated_s(errorFrame->m_errorMessage, MOT_MAX_ERROR_MESSAGE, format, args2); - securec_check_ss(erc, "\0", "\0"); + securec_check_ss_c(erc, "\0", "\0"); errorFrame->m_errorMessage[MOT_MAX_ERROR_MESSAGE - 1] = 0; ++errorFrameCount; }