1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fix(asan): fix ASAN warnings spoted

This commit is contained in:
drrtuy
2025-06-12 17:23:46 +00:00
parent 576f4fb81c
commit c4d60f66c4
3 changed files with 8 additions and 8 deletions

View File

@ -2116,8 +2116,8 @@ int SlaveComm::replayJournal(string prefix)
const char* filename = fName.c_str(); const char* filename = fName.c_str();
IDBDataFile* journalf = std::unique_ptr<IDBDataFile> journalf =
IDBDataFile::open(IDBPolicy::getType(filename, IDBPolicy::WRITEENG), filename, "rb", 0); std::unique_ptr<IDBDataFile>(IDBDataFile::open(IDBPolicy::getType(filename, IDBPolicy::WRITEENG), filename, "rb", 0));
if (!journalf) if (!journalf)
{ {

View File

@ -986,12 +986,12 @@ void VBBM::loadVersion2(IDBDataFile* in)
} }
size_t readSize = vbbmEntries * sizeof(entry); size_t readSize = vbbmEntries * sizeof(entry);
char* readBuf = new char[readSize]; std::unique_ptr<char[]> readBuf(new char[readSize]);
size_t progress = 0; size_t progress = 0;
int err; int err;
while (progress < readSize) while (progress < readSize)
{ {
err = in->read(readBuf + progress, readSize - progress); err = in->read(readBuf.get() + progress, readSize - progress);
if (err < 0) if (err < 0)
{ {
log_errno("VBBM::load()"); log_errno("VBBM::load()");
@ -1005,7 +1005,7 @@ void VBBM::loadVersion2(IDBDataFile* in)
progress += err; progress += err;
} }
VBBMEntry* loadedEntries = (VBBMEntry*)readBuf; VBBMEntry* loadedEntries = reinterpret_cast<VBBMEntry*>(readBuf.get());
for (i = 0; i < vbbmEntries; i++) for (i = 0; i < vbbmEntries; i++)
insert(loadedEntries[i].lbid, loadedEntries[i].verID, loadedEntries[i].vbOID, loadedEntries[i].vbFBO, insert(loadedEntries[i].lbid, loadedEntries[i].verID, loadedEntries[i].vbOID, loadedEntries[i].vbFBO,
true); true);

View File

@ -1402,12 +1402,12 @@ void VSS::load(string filename)
*/ */
size_t readSize = header.entries * sizeof(entry); size_t readSize = header.entries * sizeof(entry);
char* readBuf = new char[readSize]; std::unique_ptr<char[]> readBuf(new char[readSize]);
size_t progress = 0; size_t progress = 0;
int err; int err;
while (progress < readSize) while (progress < readSize)
{ {
err = in->read(readBuf + progress, readSize - progress); err = in->read(readBuf.get() + progress, readSize - progress);
if (err < 0) if (err < 0)
{ {
log_errno("VBBM::load()"); log_errno("VBBM::load()");
@ -1421,7 +1421,7 @@ void VSS::load(string filename)
progress += err; progress += err;
} }
VSSEntry* loadedEntries = (VSSEntry*)readBuf; VSSEntry* loadedEntries = reinterpret_cast<VSSEntry*>(readBuf.get());
for (i = 0; i < header.entries; i++) for (i = 0; i < header.entries; i++)
insert(loadedEntries[i].lbid, loadedEntries[i].verID, loadedEntries[i].vbFlag, loadedEntries[i].locked, insert(loadedEntries[i].lbid, loadedEntries[i].verID, loadedEntries[i].vbFlag, loadedEntries[i].locked,
true); true);