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

@ -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;