1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2026-10-23 21:49:05 +03:00

chore(datatypes): this refactors the placement of the main SQL data types enum to enable templates that are parametrized with this enum(see mcs_datatype_basic.h changes for more details).

This commit is contained in:
Roman Nozdrin
2023-10-22 21:21:10 +00:00
committed by Leonid Fedorov
parent 244e0adc8e
commit eb744eafed
12 changed files with 935 additions and 917 deletions

View File

@@ -47,7 +47,6 @@ using namespace std;
using namespace boost;
using namespace execplan;
namespace
{
const std::string INPUT_ERROR_WRONG_NO_COLUMNS = "Data contains wrong number of columns";
@@ -79,13 +78,13 @@ inline void resizeRowDataArray(char** pRowData, unsigned int dataLength, unsigne
{
char* tmpRaw = new char[newArrayCapacity];
memcpy(tmpRaw, *pRowData, dataLength);
delete[] * pRowData;
delete[] *pRowData;
*pRowData = tmpRaw;
}
} // namespace
//#define DEBUG_TOKEN_PARSING 1
// #define DEBUG_TOKEN_PARSING 1
namespace WriteEngine
{
@@ -516,7 +515,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign
if (column.cs->mbmaxlen > 1)
{
const CHARSET_INFO* cs = column.cs;
const char* start = (const char*) field;
const char* start = (const char*)field;
const char* end = (const char*)(field + fieldLength);
size_t numChars = cs->numchars(start, end);
size_t maxCharLength = column.definedWidth / cs->mbmaxlen;
@@ -529,7 +528,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign
bufStats.satCount++;
}
}
else // cs->mbmaxlen == 1
else // cs->mbmaxlen == 1
{
if (fieldLength > column.definedWidth)
{
@@ -1193,8 +1192,8 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign
// number_int_value(), and the bSatVal flag is set to true
dataconvert::number_int_value(
string(field), column.dataType,
datatypes::SystemCatalog::TypeAttributesStd(column.width, column.scale, column.precision),
dummy, false, bigllVal, &bSatVal);
datatypes::TypeAttributesStd(column.width, column.scale, column.precision), dummy, false,
bigllVal, &bSatVal);
}
}

View File

@@ -86,7 +86,7 @@ bool BlockOp::calculateRowId(RID rowId, const int epb, const int width, int& fbo
const uint8_t* BlockOp::getEmptyRowValue(const CalpontSystemCatalog::ColDataType colDataType,
const int width) const
{
auto attrs = datatypes::SystemCatalog::TypeAttributesStd(width, 0, -1);
auto attrs = datatypes::TypeAttributesStd(width, 0, -1);
// Bulk operation runtime should have m_typeHandler nullptr calling this
// Non-bulk operations runtime branch
if (m_typeHandler)
@@ -224,7 +224,7 @@ void BlockOp::findTypeHandler(const int colWidth,
const execplan::CalpontSystemCatalog::ColDataType colDataType)
{
auto attrs = datatypes::SystemCatalog::TypeAttributesStd(colWidth, 0, -1);
auto attrs = datatypes::TypeAttributesStd(colWidth, 0, -1);
m_typeHandler = datatypes::TypeHandler::find(colDataType, attrs);
}

View File

@@ -36,7 +36,7 @@ using namespace std;
#include <boost/lexical_cast.hpp>
using namespace boost;
//#include "we_simplesyslog.h"
// #include "we_simplesyslog.h"
#include "we_sdhandler.h"
#include "brm.h"
@@ -331,8 +331,7 @@ bool WEBrmUpdater::prepareCasualPartitionInfo()
if (datatypes::isWideDecimalType(cpInfoMerge.type, cpInfoMerge.colWidth))
{
datatypes::SystemCatalog::TypeAttributesStd tyAttr(cpInfoMerge.colWidth, 0,
datatypes::INT128MAXPRECISION);
datatypes::TypeAttributesStd tyAttr(cpInfoMerge.colWidth, 0, datatypes::INT128MAXPRECISION);
pTok = strtok(NULL, " ");
@@ -479,7 +478,7 @@ bool WEBrmUpdater::prepareHighWaterMarkInfo()
}
//------------------------------------------------------------------------------
//#ROWS: numRowsRead numRowsInserted
// #ROWS: numRowsRead numRowsInserted
bool WEBrmUpdater::prepareRowsInsertedInfo(std::string Entry, int64_t& TotRows, int64_t& InsRows)
{
@@ -527,7 +526,7 @@ bool WEBrmUpdater::prepareRowsInsertedInfo(std::string Entry, int64_t& TotRows,
}
//------------------------------------------------------------------------------
//#DATA: columnNumber columnType columnName numOutOfRangeValues
// #DATA: columnNumber columnType columnName numOutOfRangeValues
bool WEBrmUpdater::prepareColumnOutOfRangeInfo(std::string Entry, int& ColNum,
execplan::CalpontSystemCatalog::ColDataType& ColType,
@@ -609,7 +608,7 @@ bool WEBrmUpdater::prepareColumnOutOfRangeInfo(std::string Entry, int& ColNum,
}
//------------------------------------------------------------------------------
//#ERR: error message file
// #ERR: error message file
bool WEBrmUpdater::prepareErrorFileInfo(std::string Entry, std::string& ErrFileName)
{
@@ -650,7 +649,7 @@ bool WEBrmUpdater::prepareErrorFileInfo(std::string Entry, std::string& ErrFileN
}
//------------------------------------------------------------------------------
//#BAD: bad data file, with rejected rows
// #BAD: bad data file, with rejected rows
bool WEBrmUpdater::prepareBadDataFileInfo(std::string Entry, std::string& BadFileName)
{