1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Merge pull request #1981 from denis0x0D/MCOL-4685_fix_rebase

MCOL-4685 Fix bug after rebase and add comments.
This commit is contained in:
Roman Nozdrin
2021-06-08 20:45:05 +03:00
committed by GitHub

View File

@ -590,10 +590,15 @@ int ColumnBufferCompressed::saveCompressionHeaders( )
fColInfo->column.compressionType); fColInfo->column.compressionType);
fCompressor->setBlockCount(hdrBuf, fCompressor->setBlockCount(hdrBuf,
(fColInfo->getFileSize() / BYTE_PER_BLOCK) ); (fColInfo->getFileSize() / BYTE_PER_BLOCK) );
// If lbid written in the header is not 0 - we are running for the next extent for column // If lbid written in the header is not 0 and not equal to `lastupdatedlbid` - we are running
// segment file. // for the next extent for column segment file.
if (lbid) const auto lastUpdatedLbid = fColInfo->getLastUpdatedLBID();
fCompressor->setLBIDByIndex(hdrBuf, fColInfo->getLastUpdatedLBID(), 1); if (lbid && lastUpdatedLbid != lbid)
{
// Write back lbid, after header initialization.
fCompressor->setLBIDByIndex(hdrBuf, lbid, 0);
fCompressor->setLBIDByIndex(hdrBuf, lastUpdatedLbid, 1);
}
else else
fCompressor->setLBIDByIndex(hdrBuf, fColInfo->getLastUpdatedLBID(), 0); fCompressor->setLBIDByIndex(hdrBuf, fColInfo->getLastUpdatedLBID(), 0);