1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-270 Add support for MEDIUMINT data type

This commit is contained in:
Gagan Goel
2018-12-30 19:07:20 -05:00
parent 90b43f9fc7
commit d1ada75395
22 changed files with 206 additions and 23 deletions

View File

@ -187,6 +187,7 @@ MEDIUMTEXT {return MEDIUMTEXT;}
LONGTEXT {return LONGTEXT;}
BOOL {return BOOL;}
BOOLEAN {return BOOLEAN;}
MEDIUMINT {return MEDIUMINT;}
\n { lineno++;}

View File

@ -112,7 +112,7 @@ MIN_ROWS MODIFY NO NOT NULL_TOK NUMBER NUMERIC ON PARTIAL PRECISION PRIMARY
REFERENCES RENAME RESTRICT SET SMALLINT TABLE TEXT TINYBLOB TINYTEXT
TINYINT TO UNIQUE UNSIGNED UPDATE USER SESSION_USER SYSTEM_USER VARCHAR VARBINARY
VARYING WITH ZONE DOUBLE IDB_FLOAT REAL CHARSET IDB_IF EXISTS CHANGE TRUNCATE
BOOL BOOLEAN
BOOL BOOLEAN MEDIUMINT
%token <str> DQ_IDENT IDENT FCONST SCONST CP_SEARCH_CONDITION_TEXT ICONST DATE TIME
@ -1054,6 +1054,16 @@ exact_numeric_type:
$$->fLength = DDLDatatypeLength[DDL_TINYINT];
$$->fPrecision = 1;
}
| MEDIUMINT opt_display_width
{
$$ = new ColumnType(DDL_MEDINT);
$$->fLength = DDLDatatypeLength[DDL_MEDINT];
}
| MEDIUMINT opt_display_width UNSIGNED
{
$$ = new ColumnType(DDL_UNSIGNED_MEDINT);
$$->fLength = DDLDatatypeLength[DDL_UNSIGNED_MEDINT];
}
;
/* Bug 1570, change default scale to 0 from -1 */
opt_precision_scale:

View File

@ -115,9 +115,16 @@ ColumnType::ColumnType(int type) :
fPrecision = 5;
break;
case DDL_MEDINT:
fPrecision = 7;
break;
case DDL_UNSIGNED_MEDINT:
fPrecision = 8;
break;
case DDL_INT:
case DDL_UNSIGNED_INT:
case DDL_MEDINT:
fPrecision = 10;
break;
@ -202,7 +209,12 @@ void ColumnDef::convertDecimal()
fType->fType = DDL_SMALLINT;
fType->fLength = 2;
}
else if (fType->fPrecision > 4 && fType->fPrecision < 10)
else if (fType->fPrecision > 4 && fType->fPrecision < 7)
{
fType->fType = DDL_MEDINT;
fType->fLength = 4;
}
else if (fType->fPrecision > 6 && fType->fPrecision < 10)
{
//dataType = CalpontSystemCatalog::INT;
fType->fType = DDL_INT;

View File

@ -139,7 +139,6 @@ bool typesAreSame(const CalpontSystemCatalog::ColType& colType, const ColumnType
break;
// Don't think there can be such a type in syscat right now...
case (CalpontSystemCatalog::MEDINT):
if (newType.fType == DDL_MEDINT && colType.precision == newType.fPrecision &&
colType.scale == newType.fScale) return true;
@ -149,6 +148,12 @@ bool typesAreSame(const CalpontSystemCatalog::ColType& colType, const ColumnType
// colType.scale == newType.fScale) return true;
break;
case (CalpontSystemCatalog::UMEDINT):
if (newType.fType == DDL_UNSIGNED_MEDINT && colType.precision == newType.fPrecision &&
colType.scale == newType.fScale) return true;
break;
case (CalpontSystemCatalog::INT):
if (newType.fType == DDL_INT && colType.precision == newType.fPrecision &&
colType.scale == newType.fScale) return true;
@ -2103,7 +2108,6 @@ void AlterTableProcessor::tableComment(uint32_t sessionID, execplan::CalpontSyst
break;
case CalpontSystemCatalog::INT:
case CalpontSystemCatalog::MEDINT:
if (static_cast<int64_t>(nextVal) > MAX_INT)
validated = false;
@ -2113,12 +2117,26 @@ void AlterTableProcessor::tableComment(uint32_t sessionID, execplan::CalpontSyst
break;
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::UMEDINT:
if (nextVal > MAX_UINT)
validated = false;
break;
case CalpontSystemCatalog::MEDINT:
if (static_cast<int64_t>(nextVal) > MAX_MEDINT)
validated = false;
if (static_cast<int64_t>(nextVal) < 1)
negative = true;
break;
case CalpontSystemCatalog::UMEDINT:
if (nextVal > MAX_UMEDINT)
validated = false;
break;
case CalpontSystemCatalog::SMALLINT:
if (static_cast<int64_t>(nextVal) > MAX_SMALLINT)
validated = false;

View File

@ -58,6 +58,8 @@ const int64_t MIN_TINYINT __attribute__ ((unused)) = std::numeric_limits<int8_t>
const int64_t MAX_TINYINT __attribute__ ((unused)) = std::numeric_limits<int8_t>::max(); //127;
const int64_t MIN_SMALLINT __attribute__ ((unused)) = std::numeric_limits<int16_t>::min() + 2; //-32766;
const int64_t MAX_SMALLINT __attribute__ ((unused)) = std::numeric_limits<int16_t>::max(); //32767;
const int64_t MIN_MEDINT __attribute__ ((unused)) = -(1ULL << 23); //-8388608;
const int64_t MAX_MEDINT __attribute__ ((unused)) = (1ULL << 23) - 1; //8388607;
const int64_t MIN_INT __attribute__ ((unused)) = std::numeric_limits<int32_t>::min() + 2; //-2147483646;
const int64_t MAX_INT __attribute__ ((unused)) = std::numeric_limits<int32_t>::max(); //2147483647;
const int64_t MIN_BIGINT __attribute__ ((unused)) = std::numeric_limits<int64_t>::min() + 2; //-9223372036854775806LL;
@ -66,10 +68,12 @@ const int64_t MAX_BIGINT __attribute__ ((unused)) = std::numeric_limits<int64_t
const uint64_t MIN_UINT __attribute__ ((unused)) = 0;
const uint64_t MIN_UTINYINT __attribute__ ((unused)) = 0;
const uint64_t MIN_USMALLINT __attribute__ ((unused)) = 0;
const uint64_t MIN_UMEDINT __attribute__ ((unused)) = 0;
const uint64_t MIN_UBIGINT __attribute__ ((unused)) = 0;
const uint64_t MAX_UINT __attribute__ ((unused)) = std::numeric_limits<uint32_t>::max() - 2; //4294967293
const uint64_t MAX_UTINYINT __attribute__ ((unused)) = std::numeric_limits<uint8_t>::max() - 2; //253;
const uint64_t MAX_USMALLINT __attribute__ ((unused)) = std::numeric_limits<uint16_t>::max() - 2; //65533;
const uint64_t MAX_UMEDINT __attribute__ ((unused)) = (1ULL << 24) - 1; //16777215
const uint64_t MAX_UBIGINT __attribute__ ((unused)) = std::numeric_limits<uint64_t>::max() - 2; //18446744073709551613
const float MAX_FLOAT __attribute__ ((unused)) = std::numeric_limits<float>::max(); //3.402823466385289e+38
@ -969,8 +973,8 @@ inline bool isCharType(const execplan::CalpontSystemCatalog::ColDataType type)
execplan::CalpontSystemCatalog::TEXT == type);
}
/** convenience function to determine if column type is an
* unsigned type
/** convenience function to determine if column type is a
* numeric type
*/
inline bool isNumeric(const execplan::CalpontSystemCatalog::ColDataType type)
{
@ -999,6 +1003,9 @@ inline bool isNumeric(const execplan::CalpontSystemCatalog::ColDataType type)
}
}
/** convenience function to determine if column type is an
* unsigned type
*/
inline bool isUnsigned(const execplan::CalpontSystemCatalog::ColDataType type)
{
switch (type)

View File

@ -1068,6 +1068,7 @@ void TupleUnion::writeNull(Row* out, uint32_t col)
out->setUintField<4>(joblist::INTNULL, col);
break;
case CalpontSystemCatalog::UMEDINT:
case CalpontSystemCatalog::UINT:
out->setUintField<4>(joblist::UINTNULL, col);
break;

View File

@ -198,6 +198,10 @@ uint32_t convertDataType(int dataType)
calpontDataType = CalpontSystemCatalog::USMALLINT;
break;
case ddlpackage::DDL_UNSIGNED_MEDINT:
calpontDataType = CalpontSystemCatalog::UMEDINT;
break;
case ddlpackage::DDL_UNSIGNED_INT:
calpontDataType = CalpontSystemCatalog::UINT;
break;
@ -323,21 +327,33 @@ bool validateNextValue( int type, int64_t value )
case ddlpackage::DDL_INT:
case ddlpackage::DDL_INTEGER:
case ddlpackage::DDL_MEDINT:
{
if (value > MAX_INT)
validValue = false;
}
break;
case ddlpackage::DDL_MEDINT:
{
if (value > MAX_MEDINT)
validValue = false;
}
break;
case ddlpackage::DDL_UNSIGNED_INT:
case ddlpackage::DDL_UNSIGNED_MEDINT:
{
if (static_cast<uint64_t>(value) > MAX_UINT)
validValue = false;
}
break;
case ddlpackage::DDL_UNSIGNED_MEDINT:
{
if (static_cast<uint64_t>(value) > MAX_UMEDINT)
validValue = false;
}
break;
case ddlpackage::DDL_SMALLINT:
{
if (value > MAX_SMALLINT)

View File

@ -1062,6 +1062,7 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
}
case CalpontSystemCatalog::INT:
case CalpontSystemCatalog::MEDINT:
{
if (nullVal && (ci.columnTypes[colpos].constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT))
fprintf(ci.filePtr, "%c", ci.delimiter);
@ -1073,6 +1074,7 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
}
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::UMEDINT:
{
if (nullVal && (ci.columnTypes[colpos].constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT))
fprintf(ci.filePtr, "%c", ci.delimiter);

View File

@ -220,6 +220,14 @@ void storeNumericField(Field** f, int64_t value, CalpontSystemCatalog::ColType&
break;
}
case MYSQL_TYPE_INT24: //MEDINT type
{
Field_medium* f2 = (Field_medium*)*f;
longlong int_val = (longlong)value;
f2->store(int_val, f2->unsigned_flag);
break;
}
case MYSQL_TYPE_LONG: //INT type
{
Field_long* f2 = (Field_long*)*f;
@ -592,6 +600,7 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
}
case CalpontSystemCatalog::INT:
case CalpontSystemCatalog::MEDINT:
{
intColVal = row.getIntField<4>(s);
storeNumericField(f, intColVal, colType);
@ -599,6 +608,7 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
}
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::UMEDINT:
{
uintColVal = row.getUintField<4>(s);
storeNumericField(f, uintColVal, colType);

View File

@ -325,6 +325,7 @@ inline bool isEmptyVal<4>(uint8_t type, const uint8_t* ival)
return (joblist::CHAR4EMPTYROW == *val);
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::UMEDINT:
return (joblist::UINTEMPTYROW == *val);
default:
@ -445,6 +446,7 @@ inline bool isNullVal<4>(uint8_t type, const uint8_t* ival)
return (joblist::DATENULL == *val);
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::UMEDINT:
return (joblist::UINTNULL == *val);
default:
@ -550,6 +552,7 @@ inline bool isMinMaxValid(const NewColRequestHeader* in)
case CalpontSystemCatalog::TINYINT:
case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::MEDINT:
case CalpontSystemCatalog::INT:
case CalpontSystemCatalog::DATE:
case CalpontSystemCatalog::BIGINT:
@ -557,6 +560,7 @@ inline bool isMinMaxValid(const NewColRequestHeader* in)
case CalpontSystemCatalog::TIME:
case CalpontSystemCatalog::UTINYINT:
case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::UMEDINT:
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::UBIGINT:
return true;

View File

@ -330,6 +330,19 @@ int64_t number_int_value(const string& data,
break;
case CalpontSystemCatalog::MEDINT:
if (intVal < MIN_MEDINT)
{
intVal = MIN_MEDINT;
pushwarning = true;
}
else if (intVal > MAX_MEDINT)
{
intVal = MAX_MEDINT;
pushwarning = true;
}
break;
case CalpontSystemCatalog::INT:
if (intVal < MIN_INT)
{
@ -559,6 +572,14 @@ uint64_t number_uint_value(const string& data,
break;
case CalpontSystemCatalog::UMEDINT:
if (uintVal > MAX_UMEDINT)
{
uintVal = MAX_UMEDINT;
pushwarning = true;
}
break;
case CalpontSystemCatalog::UINT:
if (uintVal > MAX_UINT)
{

View File

@ -2757,7 +2757,6 @@ void RowAggregationUM::SetUDAFValue(static_any::any& valOut, int64_t colOut)
break;
case execplan::CalpontSystemCatalog::SMALLINT:
case execplan::CalpontSystemCatalog::MEDINT:
if (valOut.compatible(shortTypeId))
{
intOut = valOut.cast<short>();
@ -2767,6 +2766,7 @@ void RowAggregationUM::SetUDAFValue(static_any::any& valOut, int64_t colOut)
break;
case execplan::CalpontSystemCatalog::MEDINT:
case execplan::CalpontSystemCatalog::INT:
if (valOut.compatible(uintTypeId))
{
@ -2809,7 +2809,6 @@ void RowAggregationUM::SetUDAFValue(static_any::any& valOut, int64_t colOut)
break;
case execplan::CalpontSystemCatalog::USMALLINT:
case execplan::CalpontSystemCatalog::UMEDINT:
if (valOut.compatible(ushortTypeId))
{
uintOut = valOut.cast<unsigned short>();
@ -2819,6 +2818,7 @@ void RowAggregationUM::SetUDAFValue(static_any::any& valOut, int64_t colOut)
break;
case execplan::CalpontSystemCatalog::UMEDINT:
case execplan::CalpontSystemCatalog::UINT:
if (valOut.compatible(uintTypeId))
{
@ -3030,10 +3030,10 @@ void RowAggregationUM::SetUDAFAnyValue(static_any::any& valOut, int64_t colOut)
break;
case execplan::CalpontSystemCatalog::SMALLINT:
case execplan::CalpontSystemCatalog::MEDINT:
fRow.setIntField<2>(intOut, colOut);
break;
case execplan::CalpontSystemCatalog::MEDINT:
case execplan::CalpontSystemCatalog::INT:
fRow.setIntField<4>(intOut, colOut);
break;
@ -3049,10 +3049,10 @@ void RowAggregationUM::SetUDAFAnyValue(static_any::any& valOut, int64_t colOut)
break;
case execplan::CalpontSystemCatalog::USMALLINT:
case execplan::CalpontSystemCatalog::UMEDINT:
fRow.setUintField<2>(uintOut, colOut);
break;
case execplan::CalpontSystemCatalog::UMEDINT:
case execplan::CalpontSystemCatalog::UINT:
fRow.setUintField<4>(uintOut, colOut);
break;

View File

@ -1224,8 +1224,9 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
}
//----------------------------------------------------------------------
// UNSIGNED INTEGER
// UNSIGNED MEDIUM INTEGER AND UNSIGNED INTEGER
//----------------------------------------------------------------------
case WriteEngine::WR_UMEDINT :
case WriteEngine::WR_UINT :
{
int64_t origVal;
@ -1306,8 +1307,9 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
}
//----------------------------------------------------------------------
// INTEGER
// MEDIUM INTEGER AND INTEGER
//----------------------------------------------------------------------
case WriteEngine::WR_MEDINT :
case WriteEngine::WR_INT :
default :
{

View File

@ -197,10 +197,12 @@ ColumnInfo::ColumnInfo(Log* logger,
case WriteEngine::WR_SHORT:
case WriteEngine::WR_BYTE:
case WriteEngine::WR_LONGLONG:
case WriteEngine::WR_MEDINT:
case WriteEngine::WR_INT:
case WriteEngine::WR_USHORT:
case WriteEngine::WR_UBYTE:
case WriteEngine::WR_ULONGLONG:
case WriteEngine::WR_UMEDINT:
case WriteEngine::WR_UINT:
default:
{

View File

@ -1182,6 +1182,7 @@ const int IndexTree::setBitsetColumn( void* val, const int pos, const int width,
break;
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
default :
memcpy( m_multiColKey.keyBuf + m_multiColKey.totalBit / 8, (int*) val, copyLen );
m_multiColKey.curBitset = *((int*) val);

View File

@ -464,6 +464,10 @@ inline int convertDataType(int dataType)
calpontDataType = CalpontSystemCatalog::USMALLINT;
break;
case ddlpackage::DDL_UNSIGNED_MEDINT:
calpontDataType = CalpontSystemCatalog::UMEDINT;
break;
case ddlpackage::DDL_UNSIGNED_INT:
calpontDataType = CalpontSystemCatalog::UINT;
break;

View File

@ -3027,6 +3027,8 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs,
case CalpontSystemCatalog::UBIGINT:
case CalpontSystemCatalog::INT:
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::MEDINT:
case CalpontSystemCatalog::UMEDINT:
case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::TINYINT:
@ -3362,6 +3364,8 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs,
case CalpontSystemCatalog::UBIGINT:
case CalpontSystemCatalog::INT:
case CalpontSystemCatalog::UINT:
case CalpontSystemCatalog::MEDINT:
case CalpontSystemCatalog::UMEDINT:
case CalpontSystemCatalog::SMALLINT:
case CalpontSystemCatalog::USMALLINT:
case CalpontSystemCatalog::TINYINT:

View File

@ -404,8 +404,12 @@ void Convertor::convertColType(CalpontSystemCatalog::ColDataType dataType,
internalType = WriteEngine::WR_SHORT;
break;
// Map MEDINT, INT, and DATE to WR_INT
// Map MEDINT to WR_MEDINT
case CalpontSystemCatalog::MEDINT :
internalType = WriteEngine::WR_MEDINT;
break;
// Map INT, and DATE to WR_INT
case CalpontSystemCatalog::INT :
case CalpontSystemCatalog::DATE :
internalType = WriteEngine::WR_INT;
@ -469,8 +473,12 @@ void Convertor::convertColType(CalpontSystemCatalog::ColDataType dataType,
internalType = WriteEngine::WR_USHORT;
break;
// Map UMEDINT and UINT to WR_UINT
// Map UMEDINT to WR_UMEDINT
case CalpontSystemCatalog::UMEDINT:
internalType = WriteEngine::WR_UMEDINT;
break;
// Map UINT to WR_UINT
case CalpontSystemCatalog::UINT:
internalType = WriteEngine::WR_UINT;
break;
@ -512,7 +520,12 @@ void Convertor::convertWEColType(ColType internalType,
dataType = CalpontSystemCatalog::SMALLINT;
break;
// Map MEDINT, INT, and DATE to WR_INT
// Map MEDINT to WR_MEDINT
case WriteEngine::WR_MEDINT :
dataType = CalpontSystemCatalog::MEDINT;
break;
// Map INT, and DATE to WR_INT
case WriteEngine::WR_INT :
dataType = CalpontSystemCatalog::INT;
break;
@ -562,7 +575,12 @@ void Convertor::convertWEColType(ColType internalType,
dataType = CalpontSystemCatalog::USMALLINT;
break;
// Map UMEDINT and UINT to WR_UINT
// Map UMEDINT to WR_UMEDINT
case WriteEngine::WR_UMEDINT:
dataType = CalpontSystemCatalog::UMEDINT;
break;
// Map UINT to WR_UINT
case WriteEngine::WR_UINT:
dataType = CalpontSystemCatalog::UINT;
break;
@ -614,8 +632,12 @@ void Convertor::convertColType(ColStruct* curStruct)
*internalType = WriteEngine::WR_SHORT;
break;
// Map MEDINT, INT, and DATE to WR_INT
// Map MEDINT to WR_MEDINT
case CalpontSystemCatalog::MEDINT :
*internalType = WriteEngine::WR_MEDINT;
break;
// Map INT, and DATE to WR_INT
case CalpontSystemCatalog::INT :
case CalpontSystemCatalog::DATE :
*internalType = WriteEngine::WR_INT;
@ -698,8 +720,12 @@ void Convertor::convertColType(ColStruct* curStruct)
*internalType = WriteEngine::WR_USHORT;
break;
// Map UMEDINT and UINT to WR_UINT
// Map UMEDINT to WR_UMEDINT
case CalpontSystemCatalog::UMEDINT:
*internalType = WriteEngine::WR_UMEDINT;
break;
// Map UINT to WR_UINT
case CalpontSystemCatalog::UINT:
*internalType = WriteEngine::WR_UINT;
break;

View File

@ -108,7 +108,9 @@ enum ColType /** @brief Column type enumeration*/
WR_USHORT = 14, /** @brief Unsigned Short */
WR_UINT = 15, /** @brief Unsigned Int */
WR_ULONGLONG = 16, /** @brief Unsigned Long long*/
WR_TEXT = 17 /** @brief TEXT */
WR_TEXT = 17, /** @brief TEXT */
WR_MEDINT = 18, /** @brief Medium Int */
WR_UMEDINT = 19 /** @brief Unsigned Medium Int */
};
// Describes relation of field to column for a bulk load

View File

@ -1618,6 +1618,7 @@ int ColumnOp::writeRow(Column& curCol, uint64_t totalRow, const RID* rowIdArray,
break;
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
if (!bDelete) pVal = &((int*) valArray)[i];
//pOldVal = &((int *) oldValArray)[i];
@ -1636,6 +1637,7 @@ int ColumnOp::writeRow(Column& curCol, uint64_t totalRow, const RID* rowIdArray,
break;
case WriteEngine::WR_UINT :
case WriteEngine::WR_UMEDINT :
if (!bDelete) pVal = &((uint32_t*) valArray)[i];
//pOldVal = &((uint8_t *) oldValArray)[i];
@ -1789,6 +1791,7 @@ int ColumnOp::writeRows(Column& curCol, uint64_t totalRow, const RIDList& ridLis
break;
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
if (!bDelete) pVal = &((int*) valArray)[0];
//pOldVal = &((int *) oldValArray)[i];
@ -1813,6 +1816,7 @@ int ColumnOp::writeRows(Column& curCol, uint64_t totalRow, const RIDList& ridLis
break;
case WriteEngine::WR_UINT :
case WriteEngine::WR_UMEDINT :
if (!bDelete) pVal = &((uint32_t*) valArray)[0];
//pOldVal = &((uint32_t *) oldValArray)[i];
@ -1944,6 +1948,7 @@ int ColumnOp::writeRowsValues(Column& curCol, uint64_t totalRow, const RIDList&
break;
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
pVal = &((int*) valArray)[i];
break;
@ -1960,6 +1965,7 @@ int ColumnOp::writeRowsValues(Column& curCol, uint64_t totalRow, const RIDList&
break;
case WriteEngine::WR_UINT :
case WriteEngine::WR_UMEDINT :
pVal = &((uint32_t*) valArray)[i];
break;

View File

@ -261,6 +261,7 @@ void WriteEngineWrapper::convertValue(const ColType colType, void* value, boost:
switch (colType)
{
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
if (data.type() == typeid(int))
{
int val = boost::any_cast<int>(data);
@ -277,6 +278,7 @@ void WriteEngineWrapper::convertValue(const ColType colType, void* value, boost:
break;
case WriteEngine::WR_UINT :
case WriteEngine::WR_UMEDINT :
{
uint32_t val = boost::any_cast<uint32_t>(data);
size = sizeof(uint32_t);
@ -410,6 +412,7 @@ void WriteEngineWrapper::convertValue(const ColType colType, void* valArray, con
switch (colType)
{
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
if (data.type() == typeid(long))
((int*)valArray)[pos] = static_cast<int>(boost::any_cast<long>(data));
else if (data.type() == typeid(int))
@ -420,6 +423,7 @@ void WriteEngineWrapper::convertValue(const ColType colType, void* valArray, con
break;
case WriteEngine::WR_UINT :
case WriteEngine::WR_UMEDINT :
((uint32_t*)valArray)[pos] = boost::any_cast<uint32_t>(data);
break;
@ -495,10 +499,12 @@ void WriteEngineWrapper::convertValue(const ColType colType, void* valArray, con
switch (colType)
{
case WriteEngine::WR_INT :
case WriteEngine::WR_MEDINT :
data = ((int*)valArray)[pos];
break;
case WriteEngine::WR_UINT :
case WriteEngine::WR_UMEDINT :
data = ((uint64_t*)valArray)[pos];
break;
@ -814,10 +820,12 @@ int WriteEngineWrapper::deleteBadRows(const TxnID& txnid, ColStructList& colStru
switch (colStructs[i].colType)
{
case WriteEngine::WR_INT:
case WriteEngine::WR_MEDINT:
valArray = (int*) calloc(sizeof(int), 1);
break;
case WriteEngine::WR_UINT:
case WriteEngine::WR_UMEDINT:
valArray = (uint32_t*) calloc(sizeof(uint32_t), 1);
break;
@ -4484,10 +4492,12 @@ int WriteEngineWrapper::writeColumnRecords(const TxnID& txnid,
switch (curColStruct.colType)
{
case WriteEngine::WR_INT:
case WriteEngine::WR_MEDINT:
valArray = (int*) calloc(sizeof(int), totalRow);
break;
case WriteEngine::WR_UINT:
case WriteEngine::WR_UMEDINT:
valArray = (uint32_t*) calloc(sizeof(uint32_t), totalRow);
break;
@ -4721,10 +4731,12 @@ int WriteEngineWrapper::writeColumnRec(const TxnID& txnid,
switch (colStructList[i].colType)
{
case WriteEngine::WR_INT:
case WriteEngine::WR_MEDINT:
valArray = (int*) calloc(sizeof(int), totalRow1);
break;
case WriteEngine::WR_UINT:
case WriteEngine::WR_UMEDINT:
valArray = (uint32_t*) calloc(sizeof(uint32_t), totalRow1);
break;
@ -4894,10 +4906,12 @@ int WriteEngineWrapper::writeColumnRec(const TxnID& txnid,
switch (newColStructList[i].colType)
{
case WriteEngine::WR_INT:
case WriteEngine::WR_MEDINT:
valArray = (int*) calloc(sizeof(int), totalRow2);
break;
case WriteEngine::WR_UINT:
case WriteEngine::WR_UMEDINT:
valArray = (uint32_t*) calloc(sizeof(uint32_t), totalRow2);
break;
@ -5065,10 +5079,12 @@ int WriteEngineWrapper::writeColumnRec(const TxnID& txnid,
switch (colStructList[i].colType)
{
case WriteEngine::WR_INT:
case WriteEngine::WR_MEDINT:
valArray = (int*) calloc(sizeof(int), totalRow1);
break;
case WriteEngine::WR_UINT:
case WriteEngine::WR_UMEDINT:
valArray = (uint32_t*) calloc(sizeof(uint32_t), totalRow1);
break;
@ -5308,6 +5324,8 @@ int WriteEngineWrapper::writeColumnRecBinary(const TxnID& txnid,
case WriteEngine::WR_INT:
case WriteEngine::WR_UINT:
case WriteEngine::WR_MEDINT:
case WriteEngine::WR_UMEDINT:
case WriteEngine::WR_FLOAT:
tmp32 = curValue;
((uint32_t*)valArray)[j] = tmp32;
@ -5449,6 +5467,8 @@ int WriteEngineWrapper::writeColumnRecBinary(const TxnID& txnid,
case WriteEngine::WR_INT:
case WriteEngine::WR_UINT:
case WriteEngine::WR_MEDINT:
case WriteEngine::WR_UMEDINT:
case WriteEngine::WR_FLOAT:
tmp32 = curValue;
((uint32_t*)valArray)[j] = tmp32;
@ -5704,10 +5724,12 @@ int WriteEngineWrapper::writeColumnRec(const TxnID& txnid,
switch (curColStruct.colType)
{
case WriteEngine::WR_INT:
case WriteEngine::WR_MEDINT:
valArray = (int*) calloc(sizeof(int), 1);
break;
case WriteEngine::WR_UINT:
case WriteEngine::WR_UMEDINT:
valArray = (uint32_t*) calloc(sizeof(uint32_t), 1);
break;

View File

@ -719,6 +719,18 @@ void XMLJob::initSatLimits( JobColumn& curColumn ) const
curColumn.fMinIntSat = MIN_UBIGINT;
curColumn.fMaxIntSat = MAX_UBIGINT;
}
else if ( curColumn.typeName ==
ColDataTypeStr[CalpontSystemCatalog::MEDINT] )
{
curColumn.fMinIntSat = MIN_MEDINT;
curColumn.fMaxIntSat = MAX_MEDINT;
}
else if ( curColumn.typeName ==
ColDataTypeStr[CalpontSystemCatalog::UMEDINT] )
{
curColumn.fMinIntSat = MIN_UMEDINT;
curColumn.fMaxIntSat = MAX_UMEDINT;
}
else if ( curColumn.typeName ==
ColDataTypeStr[CalpontSystemCatalog::SMALLINT] )
{