1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-27 21:01:50 +03:00

MCOL-5050 EM Index dbroot container out-of-bound access checks doing EM deletes

This commit is contained in:
Roman Nozdrin
2022-04-14 11:53:09 +00:00
parent e147184b8d
commit 8bf4e0eaa5

View File

@ -527,12 +527,19 @@ ExtentMapIndexFindResult ExtentMapIndexImpl::search3dLayer(PartitionIndexContain
void ExtentMapIndexImpl::deleteDbRoot(const DBRootT dbroot)
{
auto& extMapIndex = *get();
if (dbroot >= extMapIndex.size())
return; // nothing to delete
extMapIndex[dbroot].clear();
}
void ExtentMapIndexImpl::deleteOID(const DBRootT dbroot, const OID_t oid)
{
auto& extMapIndex = *get();
// nothing to delete
if (dbroot >= extMapIndex.size())
return;
if (extMapIndex[dbroot].empty())
return;
auto oidsIter = extMapIndex[dbroot].find(oid);
// Nothing to delete. Might be a sign of a problem.
if (oidsIter == extMapIndex[dbroot].end())
@ -544,6 +551,10 @@ void ExtentMapIndexImpl::deleteEMEntry(const EMEntry& emEntry, const ExtentMapId
{
// find partition
auto& extMapIndex = *get();
if (emEntry.dbRoot >= extMapIndex.size())
return;
if (extMapIndex[emEntry.dbRoot].empty())
return;
auto oidsIter = extMapIndex[emEntry.dbRoot].find(emEntry.fileID);
if (oidsIter == extMapIndex[emEntry.dbRoot].end())
return;
@ -1646,7 +1657,6 @@ void ExtentMap::loadVersion4or5(T* in, bool upgradeV4ToV5)
}
growEMShmseg(nrows);
growEMIndexShmseg(ExtentMapIndexImpl::estimateEMIndexSize(emNumElements));
}
size_t progress = 0, writeSize = emNumElements * sizeof(EMEntry);