Misc bugfixes

This commit is contained in:
dengxuyue
2021-03-06 12:36:55 +08:00
parent 4ecea327e5
commit 3d79c59118
1729 changed files with 44948 additions and 32888 deletions

View File

@ -61,12 +61,15 @@ typedef struct OpMemInfo {
*/
/* Copy a simple scalar field (int, float, bool, enum, etc) */
#define COPY_SCALAR_FIELD(fldname) \
do { \
errno_t rc; \
rc = memcpy_s(&newnode->fldname, sizeof(newnode->fldname), &from->fldname, sizeof(from->fldname)); \
securec_check(rc, "", ""); \
} while (0)
#define COPY_SCALAR_FIELD(fldname) (newnode->fldname = from->fldname)
#define COPY_ARRAY_FIELD(fldname) \
do { \
errno_t rc; \
rc = memcpy_s(&newnode->fldname, sizeof(newnode->fldname), &from->fldname, sizeof(from->fldname)); \
securec_check(rc, "", ""); \
} while (0)
/* Copy a field that is a pointer to some kind of Node or Node tree */
#define COPY_NODE_FIELD(fldname) \
@ -5040,7 +5043,7 @@ static VacuumStmt* _copyVacuumStmt(const VacuumStmt* from)
COPY_SCALAR_FIELD(num_samples);
COPY_NODE_FIELD(sampleRows);
COPY_SCALAR_FIELD(tableidx);
COPY_SCALAR_FIELD(pstGlobalStatEx);
COPY_ARRAY_FIELD(pstGlobalStatEx);
COPY_SCALAR_FIELD(memUsage.work_mem);
COPY_SCALAR_FIELD(memUsage.max_mem);
@ -5345,6 +5348,7 @@ static CreateRlsPolicyStmt* _copyCreateRlsPolicyStmt(const CreateRlsPolicyStmt*
COPY_NODE_FIELD(relation);
COPY_STRING_FIELD(cmdName);
COPY_SCALAR_FIELD(isPermissive);
COPY_SCALAR_FIELD(fromExternal);
COPY_NODE_FIELD(roleList);
COPY_NODE_FIELD(usingQual);
@ -5972,7 +5976,7 @@ static BloomFilterSet* _copyBloomFilterSet(const BloomFilterSet* from)
if (from->startupEntries > 0) {
newnode->valuePositions = (ValueBit*)palloc0(from->startupEntries * sizeof(ValueBit));
for (uint64 cell = 0; cell < from->startupEntries; cell++) {
COPY_SCALAR_FIELD(valuePositions[cell].position);
COPY_ARRAY_FIELD(valuePositions[cell].position);
/* test valuePositions value */
for (int i = 0; i < 4; i++) {