You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1347 ALTER TABLE ADD COLUMN now creates a column with correct width for a varchar columns.
This commit is contained in:
@ -562,6 +562,7 @@ int WriteEngineWrapper::fillColumn(const TxnID& txnid, const OID& dataOid,
|
|||||||
// refColOp.reset(colOpRefCol);
|
// refColOp.reset(colOpRefCol);
|
||||||
// dctnry.reset(dctOp);
|
// dctnry.reset(dctOp);
|
||||||
uint16_t dbRoot = 1; //not to be used
|
uint16_t dbRoot = 1; //not to be used
|
||||||
|
int newDataWidth = dataWidth;
|
||||||
//Convert HWM of the reference column for the new column
|
//Convert HWM of the reference column for the new column
|
||||||
//Bug 1703,1705
|
//Bug 1703,1705
|
||||||
bool isToken = false;
|
bool isToken = false;
|
||||||
@ -584,10 +585,17 @@ int WriteEngineWrapper::fillColumn(const TxnID& txnid, const OID& dataOid,
|
|||||||
isToken = true;
|
isToken = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newDataWidth = colOpNewCol->getCorrectRowWidth(dataType, dataWidth);
|
||||||
|
// MCOL-1347 CS doubles the width for ALTER TABLE..ADD COLUMN
|
||||||
|
if ( dataWidth < 4 && dataType == CalpontSystemCatalog::VARCHAR )
|
||||||
|
{
|
||||||
|
newDataWidth >>= 1;
|
||||||
|
}
|
||||||
|
|
||||||
Convertor::convertColType(refColDataType, refColType, isToken);
|
Convertor::convertColType(refColDataType, refColType, isToken);
|
||||||
refColOp->setColParam(refCol, 0, refColOp->getCorrectRowWidth(refColDataType, refColWidth),
|
refColOp->setColParam(refCol, 0, refColOp->getCorrectRowWidth(refColDataType, refColWidth),
|
||||||
refColDataType, refColType, (FID)refColOID, refCompressionType, dbRoot);
|
refColDataType, refColType, (FID)refColOID, refCompressionType, dbRoot);
|
||||||
colOpNewCol->setColParam(newCol, 0, colOpNewCol->getCorrectRowWidth(dataType, dataWidth),
|
colOpNewCol->setColParam(newCol, 0, newDataWidth,
|
||||||
dataType, newColType, (FID)dataOid, compressionType, dbRoot);
|
dataType, newColType, (FID)dataOid, compressionType, dbRoot);
|
||||||
|
|
||||||
int size = sizeof(Token);
|
int size = sizeof(Token);
|
||||||
|
Reference in New Issue
Block a user