!1626 修复问题:truncate时错误将正确页面的nchunks置0

Merge pull request !1626 from 吴岳川/master
This commit is contained in:
opengauss-bot 2022-03-26 01:40:37 +00:00 committed by Gitee
commit 8c3c4ef12a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -2403,7 +2403,7 @@ void mdtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
chunk_size = PageCompressChunkSize(reln);
pcMap = GetPageCompressMemoryMap(v->mdfd_vfd_pca, chunk_size);
for (BlockNumber blk = 0; blk < RELSEG_SIZE; ++blk) {
for (BlockNumber blk = last_seg_blocks; blk < RELSEG_SIZE; ++blk) {
pcAddr = GET_PAGE_COMPRESS_ADDR(pcMap, chunk_size, blk);
pcAddr->nchunks = 0;
pcAddr->checksum = AddrChecksum32(blk, pcAddr, chunk_size);