You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-5050 EM Index dbroot container out-of-bound access checks doing EM deletes
This commit is contained in:
@ -527,12 +527,19 @@ ExtentMapIndexFindResult ExtentMapIndexImpl::search3dLayer(PartitionIndexContain
|
|||||||
void ExtentMapIndexImpl::deleteDbRoot(const DBRootT dbroot)
|
void ExtentMapIndexImpl::deleteDbRoot(const DBRootT dbroot)
|
||||||
{
|
{
|
||||||
auto& extMapIndex = *get();
|
auto& extMapIndex = *get();
|
||||||
|
if (dbroot >= extMapIndex.size())
|
||||||
|
return; // nothing to delete
|
||||||
extMapIndex[dbroot].clear();
|
extMapIndex[dbroot].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtentMapIndexImpl::deleteOID(const DBRootT dbroot, const OID_t oid)
|
void ExtentMapIndexImpl::deleteOID(const DBRootT dbroot, const OID_t oid)
|
||||||
{
|
{
|
||||||
auto& extMapIndex = *get();
|
auto& extMapIndex = *get();
|
||||||
|
// nothing to delete
|
||||||
|
if (dbroot >= extMapIndex.size())
|
||||||
|
return;
|
||||||
|
if (extMapIndex[dbroot].empty())
|
||||||
|
return;
|
||||||
auto oidsIter = extMapIndex[dbroot].find(oid);
|
auto oidsIter = extMapIndex[dbroot].find(oid);
|
||||||
// Nothing to delete. Might be a sign of a problem.
|
// Nothing to delete. Might be a sign of a problem.
|
||||||
if (oidsIter == extMapIndex[dbroot].end())
|
if (oidsIter == extMapIndex[dbroot].end())
|
||||||
@ -544,6 +551,10 @@ void ExtentMapIndexImpl::deleteEMEntry(const EMEntry& emEntry, const ExtentMapId
|
|||||||
{
|
{
|
||||||
// find partition
|
// find partition
|
||||||
auto& extMapIndex = *get();
|
auto& extMapIndex = *get();
|
||||||
|
if (emEntry.dbRoot >= extMapIndex.size())
|
||||||
|
return;
|
||||||
|
if (extMapIndex[emEntry.dbRoot].empty())
|
||||||
|
return;
|
||||||
auto oidsIter = extMapIndex[emEntry.dbRoot].find(emEntry.fileID);
|
auto oidsIter = extMapIndex[emEntry.dbRoot].find(emEntry.fileID);
|
||||||
if (oidsIter == extMapIndex[emEntry.dbRoot].end())
|
if (oidsIter == extMapIndex[emEntry.dbRoot].end())
|
||||||
return;
|
return;
|
||||||
@ -1646,7 +1657,6 @@ void ExtentMap::loadVersion4or5(T* in, bool upgradeV4ToV5)
|
|||||||
}
|
}
|
||||||
|
|
||||||
growEMShmseg(nrows);
|
growEMShmseg(nrows);
|
||||||
growEMIndexShmseg(ExtentMapIndexImpl::estimateEMIndexSize(emNumElements));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t progress = 0, writeSize = emNumElements * sizeof(EMEntry);
|
size_t progress = 0, writeSize = emNumElements * sizeof(EMEntry);
|
||||||
|
Reference in New Issue
Block a user