Commit 27f3bbfa authored by Teodor Sigaev's avatar Teodor Sigaev

Fixes in bloom contrib module missed during review

- macroses llike (var & FLAG) are changed to ((var & FLAG) != 0)
- do not copy uninitialized part of notFullPage array to page
parent f402b995
...@@ -44,10 +44,14 @@ typedef BloomPageOpaqueData *BloomPageOpaque; ...@@ -44,10 +44,14 @@ typedef BloomPageOpaqueData *BloomPageOpaque;
/* Macros for accessing bloom page structures */ /* Macros for accessing bloom page structures */
#define BloomPageGetOpaque(page) ((BloomPageOpaque) PageGetSpecialPointer(page)) #define BloomPageGetOpaque(page) ((BloomPageOpaque) PageGetSpecialPointer(page))
#define BloomPageGetMaxOffset(page) (BloomPageGetOpaque(page)->maxoff) #define BloomPageGetMaxOffset(page) (BloomPageGetOpaque(page)->maxoff)
#define BloomPageIsMeta(page) (BloomPageGetOpaque(page)->flags & BLOOM_META) #define BloomPageIsMeta(page) \
#define BloomPageIsDeleted(page) (BloomPageGetOpaque(page)->flags & BLOOM_DELETED) ((BloomPageGetOpaque(page)->flags & BLOOM_META) != 0)
#define BloomPageSetDeleted(page) (BloomPageGetOpaque(page)->flags |= BLOOM_DELETED) #define BloomPageIsDeleted(page) \
#define BloomPageSetNonDeleted(page) (BloomPageGetOpaque(page)->flags &= ~BLOOM_DELETED) ((BloomPageGetOpaque(page)->flags & BLOOM_DELETED) != 0)
#define BloomPageSetDeleted(page) \
(BloomPageGetOpaque(page)->flags |= BLOOM_DELETED)
#define BloomPageSetNonDeleted(page) \
(BloomPageGetOpaque(page)->flags &= ~BLOOM_DELETED)
#define BloomPageGetData(page) ((BloomTuple *)PageGetContents(page)) #define BloomPageGetData(page) ((BloomTuple *)PageGetContents(page))
#define BloomPageGetTuple(state, page, offset) \ #define BloomPageGetTuple(state, page, offset) \
((BloomTuple *)(PageGetContents(page) \ ((BloomTuple *)(PageGetContents(page) \
......
...@@ -142,7 +142,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, ...@@ -142,7 +142,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
page = GenericXLogRegister(gxlogState, buffer, false); page = GenericXLogRegister(gxlogState, buffer, false);
metaData = BloomPageGetMeta(page); metaData = BloomPageGetMeta(page);
memcpy(metaData->notFullPage, notFullPage, sizeof(FreeBlockNumberArray)); memcpy(metaData->notFullPage, notFullPage, sizeof(BlockNumber) * countPage);
metaData->nStart = 0; metaData->nStart = 0;
metaData->nEnd = countPage; metaData->nEnd = countPage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment