1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-5021 Some minor fixes.

This commit is contained in:
Gagan Goel
2022-07-14 17:53:17 -04:00
parent 94e9f55940
commit 1355237ca3
8 changed files with 46 additions and 15 deletions

View File

@ -113,7 +113,7 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.9') = {
local config_path_prefix = if (pkg_format == 'rpm') then '/etc/my.cnf.d/' else '/etc/mysql/mariadb.conf.d/50-',
local img = if (platform == 'centos:7' || std.split(platform, ':')[0] == 'rockylinux') then platform else 'romcheck/' + std.strReplace(platform, '/', '-'),
local regression_ref = if (std.split(branch, '-')[0] == 'develop') then branch else 'develop-6',
local regression_tests = if (std.startsWith(platform, 'debian') || std.startsWith(platform, 'ubuntu:20')) then 'test000.sh,test001.sh' else 'test000.sh,test001.sh',
local regression_tests = if (std.startsWith(platform, 'debian') || std.startsWith(platform, 'ubuntu:20')) then 'test000.sh' else 'test000.sh,test001.sh',
local branchp = if (branch == '**') then '' else branch,
local result = std.strReplace(std.strReplace(platform, ':', ''), '/', '-'),

View File

@ -607,7 +607,6 @@ keepGoing:
++iter;
}
// TODO MCOL-5021 compressionType is hardcoded to 2 (SNAPPY)
bytestream << (fStartingColOID + size);
bytestream << (uint8_t)execplan::AUX_COL_DATATYPE;
bytestream << (uint8_t) false;

View File

@ -146,8 +146,16 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage(
try
{
roPair = systemCatalogPtr->tableRID(tableName);
if (tableName.schema.compare(execplan::CALPONT_SCHEMA) == 0)
{
tableAUXColOid = 0;
}
else
{
tableAUXColOid = systemCatalogPtr->tableAUXColumnOID(tableName);
}
}
catch (IDBExcept& ie)
{
if (ie.errorCode() == ERR_TABLE_NOT_IN_CATALOG)

View File

@ -3755,6 +3755,16 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid)
checkSysCatVer();
boost::mutex::scoped_lock lk1(fAUXColumnOIDToTableOIDMapLock);
AUXColumnOIDTableOIDmap::const_iterator iter = fAUXColumnOIDToTableOIDMap.find(oid);
if (iter != fAUXColumnOIDToTableOIDMap.end())
{
return iter->second;
}
lk1.unlock();
// select objectid from systable where auxcolumnoid = oid;
CalpontSelectExecutionPlan csep;
CalpontSelectExecutionPlan::ReturnedColumnList returnedColumnList;
@ -3818,7 +3828,10 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid)
{
if ((*it)->dataCount() == 1)
{
return (OID)((*it)->GetData(0));
// populate cache
lk1.lock();
fAUXColumnOIDToTableOIDMap[oid] = (OID)((*it)->GetData(0));
return fAUXColumnOIDToTableOIDMap[oid];
}
else
{
@ -3827,7 +3840,10 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid)
}
}
return (OID)(0);
// populate cache
lk1.lock();
fAUXColumnOIDToTableOIDMap[oid] = 0;
return fAUXColumnOIDToTableOIDMap[oid];
}
#if 0
@ -5871,6 +5887,10 @@ void CalpontSystemCatalog::flushCache()
fTableAUXColumnOIDMap.clear();
auxlk.unlock();
boost::mutex::scoped_lock auxtotableoidlk(fAUXColumnOIDToTableOIDMapLock);
fAUXColumnOIDToTableOIDMap.clear();
auxtotableoidlk.unlock();
boost::recursive_mutex::scoped_lock lk4(fDctTokenMapLock);
fDctTokenMap.clear();
buildSysDctmap();

View File

@ -647,7 +647,6 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
*/
const ROPair columnRID(const TableColName& tableColName, int lower_case_table_names = 0);
// TODO MCOL-5021
/** return the RID's of the columns for a table
*
* returns a list of the RID's of the columns for a table
@ -879,6 +878,10 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
TableOIDmap fTableAUXColumnOIDMap;
boost::mutex fTableAUXColumnOIDMapLock;
typedef std::map<OID, OID> AUXColumnOIDTableOIDmap;
AUXColumnOIDTableOIDmap fAUXColumnOIDToTableOIDMap;
boost::mutex fAUXColumnOIDToTableOIDMapLock;
typedef std::map<OID, ColType> Colinfomap;
Colinfomap fColinfomap;
boost::mutex fColinfomapLock;
@ -927,6 +930,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
// MCOL-5021
const datatypes::SystemCatalog::ColDataType AUX_COL_DATATYPE = datatypes::SystemCatalog::UTINYINT;
const int32_t AUX_COL_WIDTH = 1;
// TODO MCOL-5021 compressionType is hardcoded to 2 (SNAPPY)
const CalpontSystemCatalog::CompressionType AUX_COL_COMPRESSION_TYPE = CalpontSystemCatalog::COMPRESSION2;
const std::string AUX_COL_DATATYPE_STRING = "unsigned-tinyint";
const uint64_t AUX_COL_MINVALUE = MIN_UTINYINT;

View File

@ -849,7 +849,7 @@ void ColumnCommand::nextLBID()
lbid += colType.colWidth;
if (_hasAuxCol)
lbidAux += 1;
lbidAux += execplan::AUX_COL_WIDTH;
}
void ColumnCommand::duplicate(ColumnCommand* cc)
@ -961,7 +961,7 @@ void ColumnCommand::getLBIDList(uint32_t loopCount, vector<int64_t>* lbids)
if (_hasAuxCol)
{
firstLBID = lbidAux;
lastLBID = firstLBID + (loopCount * 1) - 1;
lastLBID = firstLBID + (loopCount * execplan::AUX_COL_WIDTH) - 1;
for (i = firstLBID; i <= lastLBID; i++)
lbids->push_back(i);

View File

@ -4730,7 +4730,7 @@ int WE_DMLCommandProc::validateColumnHWMs(CalpontSystemCatalog::RIDList& ridList
// Find out column width
if (hasAuxCol && (k == segFileInfo.size() - 1))
{
colWidth = 1;
colWidth = execplan::AUX_COL_WIDTH;
}
else
{
@ -4805,7 +4805,7 @@ int WE_DMLCommandProc::validateColumnHWMs(CalpontSystemCatalog::RIDList& ridList
if (hasAuxCol && (k1 == segFileInfo.size() - 1))
{
colWidth2 = 1;
colWidth2 = execplan::AUX_COL_WIDTH;
}
else
{
@ -4963,7 +4963,7 @@ errorCheck:
if (hasAuxCol && (refCol == ridList.size() - 1))
{
colWidth1 = 1;
colWidth1 = execplan::AUX_COL_WIDTH;
}
else
{
@ -4973,7 +4973,7 @@ errorCheck:
if (hasAuxCol && (colIdx == ridList.size() - 1))
{
colWidth2 = 1;
colWidth2 = execplan::AUX_COL_WIDTH;
}
else
{

View File

@ -188,13 +188,13 @@ void Config::checkReload()
const std::string fastDeleteTemp = cf->getConfig("WriteEngine", "FastDelete");
if (fastDeleteTemp.length() == 0 || boost::iequals(fastDeleteTemp, "false"))
if (fastDeleteTemp.length() != 0 && boost::iequals(fastDeleteTemp, "true"))
{
m_FastDelete = false;
m_FastDelete = true;
}
else
{
m_FastDelete = true;
m_FastDelete = false;
}
//--------------------------------------------------------------------------