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
MCOL-641 PoC version for DECIMAL(38) using BINARY as a basis.
This commit is contained in:
@@ -458,9 +458,11 @@ uint8_t WE_DDLCommandProc::writeCreateSyscolumn(ByteStream& bs, std::string& err
|
||||
{
|
||||
if (colDefPtr->fType->fPrecision > 18) //@Bug 5717 precision cannot be over 18.
|
||||
{
|
||||
ostringstream os;
|
||||
os << "Syntax error: The maximum precision (total number of digits) that can be specified is 18";
|
||||
throw std::runtime_error(os.str());
|
||||
// WIP MCOL-641
|
||||
//ostringstream os;
|
||||
//os << "Syntax error: The maximum precision (total number of digits) that can be specified is 18";
|
||||
//throw std::runtime_error(os.str());
|
||||
colDefPtr->convertDecimal();
|
||||
}
|
||||
else if (colDefPtr->fType->fPrecision < colDefPtr->fType->fScale)
|
||||
{
|
||||
@@ -507,7 +509,7 @@ uint8_t WE_DDLCommandProc::writeCreateSyscolumn(ByteStream& bs, std::string& err
|
||||
}
|
||||
|
||||
else if (dataType == CalpontSystemCatalog::BINARY
|
||||
&& ! (colDefPtr->fType->fLength == 16
|
||||
&& ! (colDefPtr->fType->fLength == 16
|
||||
|| colDefPtr->fType->fLength == 32))
|
||||
{
|
||||
ostringstream os;
|
||||
|
||||
@@ -412,8 +412,8 @@ uint8_t WE_DMLCommandProc::processSingleInsert(messageqcpp::ByteStream& bs, std:
|
||||
|
||||
// call the write engine to write the rows
|
||||
int error = NO_ERROR;
|
||||
//fWriteEngine.setDebugLevel(WriteEngine::DEBUG_3);
|
||||
//cout << "inserting a row with transaction id " << txnid.id << endl;
|
||||
fWEWrapper.setDebugLevel(WriteEngine::DEBUG_3);
|
||||
cout << "inserting a row with transaction id " << txnid.id << endl;
|
||||
fWEWrapper.setIsInsert(true);
|
||||
fWEWrapper.setBulkFlag(true);
|
||||
fWEWrapper.setTransId(txnid.id);
|
||||
|
||||
@@ -106,12 +106,12 @@ private:
|
||||
WriteEngineWrapper fWEWrapper;
|
||||
boost::scoped_ptr<RBMetaWriter> fRBMetaWriter;
|
||||
std::vector<boost::shared_ptr<DBRootExtentTracker> > dbRootExtTrackerVec;
|
||||
inline bool isDictCol ( execplan::CalpontSystemCatalog::ColType colType )
|
||||
inline bool isDictCol ( execplan::CalpontSystemCatalog::ColType &colType )
|
||||
{
|
||||
if (((colType.colDataType == execplan::CalpontSystemCatalog::CHAR) && (colType.colWidth > 8))
|
||||
|| ((colType.colDataType == execplan::CalpontSystemCatalog::VARCHAR) && (colType.colWidth > 7))
|
||||
|| ((colType.colDataType == execplan::CalpontSystemCatalog::DECIMAL) && (colType.precision > 18))
|
||||
|| ((colType.colDataType == execplan::CalpontSystemCatalog::UDECIMAL) && (colType.precision > 18))
|
||||
|| ((colType.colDataType == execplan::CalpontSystemCatalog::DECIMAL) && (colType.precision > 65))
|
||||
|| ((colType.colDataType == execplan::CalpontSystemCatalog::UDECIMAL) && (colType.precision > 65))
|
||||
|| (colType.colDataType == execplan::CalpontSystemCatalog::VARBINARY)
|
||||
|| (colType.colDataType == execplan::CalpontSystemCatalog::BLOB)
|
||||
|| (colType.colDataType == execplan::CalpontSystemCatalog::TEXT))
|
||||
|
||||
@@ -633,9 +633,13 @@ void Convertor::convertColType(ColStruct* curStruct)
|
||||
*internalType = WriteEngine::WR_INT;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 8:
|
||||
*internalType = WriteEngine::WR_LONGLONG;
|
||||
break;
|
||||
|
||||
default:
|
||||
*internalType = WriteEngine::WR_BCDECIMAL;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -111,7 +111,8 @@ enum ColType /** @brief Column type enumeration*/
|
||||
WR_TEXT = 17, /** @brief TEXT */
|
||||
WR_MEDINT = 18, /** @brief Medium Int */
|
||||
WR_UMEDINT = 19, /** @brief Unsigned Medium Int */
|
||||
WR_BINARY = 20 /** @brief BINARY */
|
||||
WR_BINARY = 20, /** @brief BINARY */
|
||||
WR_BCDECIMAL = 21 /** @brief BINARY CODED DECIMAL */
|
||||
};
|
||||
|
||||
// Describes relation of field to column for a bulk load
|
||||
|
||||
@@ -1687,9 +1687,9 @@ int ColumnOp::writeRow(Column& curCol, uint64_t totalRow, const RID* rowIdArray,
|
||||
break;
|
||||
|
||||
case WriteEngine::WR_BINARY:
|
||||
case WriteEngine::WR_BCDECIMAL:
|
||||
if (!bDelete) pVal = (uint8_t*) valArray + i * curCol.colWidth;
|
||||
|
||||
//pOldVal = (uint8_t*) oldValArray + i * curCol.colWidth;
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
@@ -503,6 +503,7 @@ void WriteEngineWrapper::convertValue(const ColType colType, void* valArray, con
|
||||
break;
|
||||
|
||||
case WriteEngine::WR_BINARY:
|
||||
case WriteEngine::WR_BCDECIMAL:
|
||||
curStr = boost::any_cast<string>(data);
|
||||
memcpy((char*)valArray + pos * curStr.length(), curStr.c_str(), curStr.length());
|
||||
break;
|
||||
@@ -5157,6 +5158,7 @@ int WriteEngineWrapper::writeColumnRec(const TxnID& txnid,
|
||||
break;
|
||||
|
||||
case WriteEngine::WR_BINARY:
|
||||
case WriteEngine::WR_BCDECIMAL:
|
||||
valArray = calloc(colStructList[i].colWidth, totalRow1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -621,7 +621,17 @@ public:
|
||||
*/
|
||||
// todo: add implementation when we work on version control
|
||||
// int endTran(const TransID transOid) { return NO_ERROR; }
|
||||
// WIP
|
||||
void setDebugLevel(const DebugLevel level)
|
||||
{
|
||||
WEObj::setDebugLevel(level);
|
||||
|
||||
for (int i = 0; i < TOTAL_COMPRESS_OP; i++)
|
||||
{
|
||||
m_colOp[i]->setDebugLevel(level);
|
||||
m_dctnry[i]->setDebugLevel(level);
|
||||
}
|
||||
} // todo: cleanup
|
||||
|
||||
/************************************************************************
|
||||
* Internal use definitions
|
||||
@@ -676,17 +686,7 @@ private:
|
||||
std::vector<BRM::VBRange>& freeList, std::vector<std::vector<uint32_t> >& fboLists,
|
||||
std::vector<std::vector<BRM::LBIDRange> >& rangeLists, std::vector<BRM::LBIDRange>& rangeListTot);
|
||||
|
||||
void setDebugLevel(const DebugLevel level)
|
||||
{
|
||||
WEObj::setDebugLevel(level);
|
||||
|
||||
for (int i = 0; i < TOTAL_COMPRESS_OP; i++)
|
||||
{
|
||||
m_colOp[i]->setDebugLevel(level);
|
||||
m_dctnry[i]->setDebugLevel(level);
|
||||
}
|
||||
} // todo: cleanup
|
||||
|
||||
|
||||
/**
|
||||
* @brief Common methods to write values to a column
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user