You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-24 14:20:59 +03:00
Merge pull request #655 from mariadb-corporation/MCOL-1347_2
ALTER TABLE ADD COLUMN now creates a column with correct width for a varchar columns.
This commit is contained in:
@@ -1647,10 +1647,10 @@ int DBRM::deletePartition(const std::vector<OID_t>& oids,
|
||||
{
|
||||
TRACER_WRITENOW("deletePartition");
|
||||
std::ostringstream oss;
|
||||
oss << "partitionNum: "
|
||||
oss << "partitionNum: ";
|
||||
std::set<LogicalPartition>::const_iterator partIt;
|
||||
for (partIt = partitionNums.begin(); partIt != partitionNums.end(); ++partIt)
|
||||
oss << (*it) << " "
|
||||
oss << (*partIt) << " ";
|
||||
oss << "; OIDS: ";
|
||||
std::vector<OID_t>::const_iterator it;
|
||||
for (it=oids.begin(); it!=oids.end(); ++it)
|
||||
@@ -1696,10 +1696,10 @@ int DBRM::markPartitionForDeletion(const std::vector<OID_t>& oids,
|
||||
{
|
||||
TRACER_WRITENOW("markPartitionForDeletion");
|
||||
std::ostringstream oss;
|
||||
oss << "partitionNum: "
|
||||
oss << "partitionNum: ";
|
||||
std::set<LogicalPartition>::const_iterator partIt;
|
||||
for (partIt = partitionNums.begin(); partIt != partitionNums.end(); ++partIt)
|
||||
oss << (*it) << " "
|
||||
oss << (*partIt) << " ";
|
||||
oss << "; OIDS: ";
|
||||
std::vector<OID_t>::const_iterator it;
|
||||
for (it=oids.begin(); it!=oids.end(); ++it)
|
||||
@@ -1784,10 +1784,10 @@ int DBRM::restorePartition(const std::vector<OID_t>& oids,
|
||||
{
|
||||
TRACER_WRITENOW("restorePartition");
|
||||
std::ostringstream oss;
|
||||
oss << "partitionNum: "
|
||||
oss << "partitionNum: ";
|
||||
std::set<LogicalPartition>::const_iterator partIt;
|
||||
for (partIt = partitionNums.begin(); partIt != partitionNums.end(); ++partIt)
|
||||
oss << (*it) << " "
|
||||
oss << (*partIt) << " ";
|
||||
oss << "; OIDS: ";
|
||||
std::vector<OID_t>::const_iterator it;
|
||||
for (it=oids.begin(); it!=oids.end(); ++it)
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace bi=boost::interprocess;
|
||||
#include "IDBDataFile.h"
|
||||
#include "IDBPolicy.h"
|
||||
#ifdef BRM_INFO
|
||||
#error BRM_INFO is broken right now
|
||||
#include "tracer.h"
|
||||
#include "configcpp.h"
|
||||
#endif
|
||||
@@ -4113,12 +4112,12 @@ void ExtentMap::setLocalHWM(int OID, uint32_t partitionNum,
|
||||
if ((oldHWMExtentIndex != -1) && (oldHWMExtentIndex != lastExtentIndex)) {
|
||||
makeUndoRecord(&fExtentMap[oldHWMExtentIndex], sizeof(EMEntry));
|
||||
fExtentMap[oldHWMExtentIndex].HWM = 0;
|
||||
#ifdef BRM_DEBUG
|
||||
#ifdef BRM_INFO
|
||||
addedAnExtent = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef BRM_DEBUG
|
||||
#ifdef BRM_INFO
|
||||
if (firstNode) {
|
||||
ostringstream os;
|
||||
os << "ExtentMap::setLocalHWM(): firstLBID=" << fExtentMap[lastExtentIndex].range.start <<
|
||||
@@ -4381,9 +4380,9 @@ void ExtentMap::deletePartition(const set<OID_t>& oids,
|
||||
TRACER_WRITENOW("deletePartition");
|
||||
ostringstream oss;
|
||||
set<LogicalPartition>::const_iterator partIt;
|
||||
oss << "partitionNums: "
|
||||
for (partIt=partitionNums.begin(); it!=partitionNums.end(); ++it)
|
||||
oss << (*it) << " ";
|
||||
oss << "partitionNums: ";
|
||||
for (partIt=partitionNums.begin(); partIt!=partitionNums.end(); ++partIt)
|
||||
oss << (*partIt) << " ";
|
||||
|
||||
oss << endl;
|
||||
oss << "OIDS: ";
|
||||
@@ -4474,9 +4473,9 @@ void ExtentMap::markPartitionForDeletion(const set<OID_t>& oids,
|
||||
TRACER_WRITENOW("markPartitionForDeletion");
|
||||
ostringstream oss;
|
||||
set<LogicalPartition>::const_iterator partIt;
|
||||
oss << "partitionNums: "
|
||||
for (partIt=partitionNums.begin(); it!=partitionNums.end(); ++it)
|
||||
oss << (*it) << " ";
|
||||
oss << "partitionNums: ";
|
||||
for (partIt=partitionNums.begin(); partIt!=partitionNums.end(); ++partIt)
|
||||
oss << (*partIt) << " ";
|
||||
|
||||
oss << endl;
|
||||
oss << "OIDS: ";
|
||||
@@ -4618,9 +4617,9 @@ void ExtentMap::restorePartition(const set<OID_t>& oids,
|
||||
TRACER_WRITENOW("restorePartition");
|
||||
ostringstream oss;
|
||||
set<LogicalPartition>::const_iterator partIt;
|
||||
oss << "partitionNums: "
|
||||
for (partIt=partitionNums.begin(); it!=partitionNums.end(); ++it)
|
||||
oss << (*it) << " ";
|
||||
oss << "partitionNums: ";
|
||||
for (partIt=partitionNums.begin(); partIt!=partitionNums.end(); ++partIt)
|
||||
oss << (*partIt) << " ";
|
||||
oss << endl;
|
||||
oss << "OIDS: ";
|
||||
set<OID_t>::const_iterator it;
|
||||
@@ -4768,7 +4767,7 @@ bool ExtentMap::isDBRootEmpty(uint16_t dbroot)
|
||||
if (fDebug)
|
||||
{
|
||||
TRACER_WRITELATER("isDBRootEmpty");
|
||||
TRACER_ADDINPUT(OID);
|
||||
TRACER_ADDINPUT(dbroot);
|
||||
TRACER_WRITE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <ctime>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#define TRACER_DLLEXPORT
|
||||
#include "tracer.h"
|
||||
#undef TRACER_DLLEXPORT
|
||||
|
||||
@@ -562,6 +562,7 @@ int WriteEngineWrapper::fillColumn(const TxnID& txnid, const OID& dataOid,
|
||||
// refColOp.reset(colOpRefCol);
|
||||
// dctnry.reset(dctOp);
|
||||
uint16_t dbRoot = 1; //not to be used
|
||||
int newDataWidth = dataWidth;
|
||||
//Convert HWM of the reference column for the new column
|
||||
//Bug 1703,1705
|
||||
bool isToken = false;
|
||||
@@ -584,10 +585,17 @@ int WriteEngineWrapper::fillColumn(const TxnID& txnid, const OID& dataOid,
|
||||
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);
|
||||
refColOp->setColParam(refCol, 0, refColOp->getCorrectRowWidth(refColDataType, refColWidth),
|
||||
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);
|
||||
|
||||
int size = sizeof(Token);
|
||||
|
||||
Reference in New Issue
Block a user