1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-641 PoC version for DECIMAL(38) using BINARY as a basis.

This commit is contained in:
Roman Nozdrin
2019-10-29 01:21:17 -05:00
parent 32f6167067
commit c9f42fb5cc
16 changed files with 70 additions and 40 deletions

View File

@@ -1224,8 +1224,12 @@ DataConvert::convertColumnData(const CalpontSystemCatalog::ColType& colType,
value = (long long) number_int_value(data, colType, pushWarning, noRoundup);
break;
// MCOL-641 WIP
// use string2BCD conversion here + set sign
case CalpontSystemCatalog::DECIMAL:
if (colType.colWidth == 1)
if (colType.colWidth == 16)
value = data;
else if (colType.colWidth == 1)
value = (char) number_int_value(data, colType, pushWarning, noRoundup);
else if (colType.colWidth == 2)
value = (short) number_int_value(data, colType, pushWarning, noRoundup);
@@ -1233,9 +1237,11 @@ DataConvert::convertColumnData(const CalpontSystemCatalog::ColType& colType,
value = (int) number_int_value(data, colType, pushWarning, noRoundup);
else if (colType.colWidth == 8)
value = (long long) number_int_value(data, colType, pushWarning, noRoundup);
else if (colType.colWidth == 32)
value = data;
break;
// MCOL-641 Implement UDECIMAL
case CalpontSystemCatalog::UDECIMAL:
// UDECIMAL numbers may not be negative