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

MCOL-4791 Fix ColumnCommand fudged data type format to clearly identify CHAR vs VARCHAR

This commit is contained in:
Alexander Barkov
2021-07-02 12:42:03 +04:00
parent ceb73cddcd
commit e8126bede5
22 changed files with 228 additions and 318 deletions

View File

@ -102,14 +102,14 @@ struct pColStepAggregator
pColStep::pColStep(
CalpontSystemCatalog::OID o,
CalpontSystemCatalog::OID t,
const CalpontSystemCatalog::ColType& ct,
const CalpontSystemCatalog::DataType& ct,
const JobInfo& jobInfo) :
JobStep(jobInfo),
fRm(jobInfo.rm),
sysCat(jobInfo.csc),
fOid(o),
fTableOid(t),
fColType(ct),
fColType(ct, t != 0 /* For cross-engine we preserve the exact data type */),
fFilterCount(0),
fBOP(BOP_NONE),
ridList(0),
@ -117,7 +117,6 @@ pColStep::pColStep(
msgsRecvd(0),
finishedSending(false),
recvWaiting(false),
fIsDict(false),
isEM(jobInfo.isExeMgr),
ridCount(0),
fFlushInterval(jobInfo.flushInterval),
@ -159,40 +158,7 @@ pColStep::pColStep(
throw runtime_error(oss.str());
}
realWidth = fColType.colWidth;
if ( fColType.colDataType == CalpontSystemCatalog::VARCHAR )
{
if (8 > fColType.colWidth && 4 <= fColType.colWidth )
fColType.colDataType = CalpontSystemCatalog::CHAR;
fColType.colWidth++;
}
//If this is a dictionary column, fudge the numbers...
if ((fColType.colDataType == CalpontSystemCatalog::VARBINARY)
|| (fColType.colDataType == CalpontSystemCatalog::BLOB)
|| (fColType.colDataType == CalpontSystemCatalog::TEXT))
{
fColType.colWidth = 8;
fIsDict = true;
}
// WIP MCOL-641
else if (fColType.colWidth > 8
&& fColType.colDataType != CalpontSystemCatalog::DECIMAL
&& fColType.colDataType != CalpontSystemCatalog::UDECIMAL)
{
fColType.colWidth = 8;
fIsDict = true;
//TODO: is this right?
fColType.colDataType = CalpontSystemCatalog::VARCHAR;
}
//Round colWidth up
if (fColType.colWidth == 3)
fColType.colWidth = 4;
else if (fColType.colWidth == 5 || fColType.colWidth == 6 || fColType.colWidth == 7)
fColType.colWidth = 8;
realWidth = ct.colWidth;
idbassert(fColType.colWidth > 0);
ridsPerBlock = BLOCK_SIZE / fColType.colWidth;
@ -283,7 +249,6 @@ pColStep::pColStep(const pColScanStep& rhs) :
msgsRecvd(0),
finishedSending(false),
recvWaiting(false),
fIsDict(rhs.isDictCol()),
ridCount(0),
// Per Cindy, it's save to put fFlushInterval to be 0
fFlushInterval(0),
@ -393,7 +358,6 @@ pColStep::pColStep(const PassThruStep& rhs) :
msgsRecvd(0),
finishedSending(false),
recvWaiting(false),
fIsDict(rhs.isDictCol()),
ridCount(0),
// Per Cindy, it's save to put fFlushInterval to be 0
fFlushInterval(0),