1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +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);
}
}