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

MCOL-4174 Review/refactor frontend/connector code

This commit is contained in:
Alexander Barkov
2020-10-20 15:35:36 +04:00
committed by Roman Nozdrin
parent 68244ab957
commit 129d5b5a0f
70 changed files with 6982 additions and 4927 deletions

View File

@ -116,7 +116,7 @@ int64_t Func_round::getIntVal(Row& row,
{
IDB_Decimal x = getDecimalVal(row, parm, isNull, op_ct);
if (!datatypes::Decimal::isWideDecimalType(op_ct))
if (!op_ct.isWideDecimalType())
{
if (x.scale > 0)
{
@ -207,7 +207,7 @@ double Func_round::getDoubleVal(Row& row,
double d;
if (!datatypes::Decimal::isWideDecimalType(op_ct))
if (!op_ct.isWideDecimalType())
d = x.value;
else
d = datatypes::Decimal::getDoubleFromWideDecimal(x.s128Value);
@ -274,7 +274,7 @@ long double Func_round::getLongDoubleVal(Row& row,
double d;
if (!datatypes::Decimal::isWideDecimalType(op_ct))
if (!op_ct.isWideDecimalType())
d = x.value;
else
d = datatypes::Decimal::getDoubleFromWideDecimal(x.s128Value);
@ -313,7 +313,7 @@ IDB_Decimal Func_round::getDecimalVal(Row& row,
int64_t d = 0;
decimal = parm[0]->data()->getDecimalVal(row, isNull);
if (!datatypes::Decimal::isWideDecimalType(op_ct))
if (!op_ct.isWideDecimalType())
{
//@Bug 3101 - GCC 4.5.1 optimizes too aggressively here. Mark as volatile.
volatile int64_t p = 1;
@ -720,12 +720,12 @@ string Func_round::getStrVal(Row& row,
break;
}
if (!datatypes::Decimal::isWideDecimalType(op_ct))
if (!op_ct.isWideDecimalType())
return dataconvert::DataConvert::decimalToString(x.value, x.scale, op_ct.colDataType);
else
{
char buf[utils::MAXLENGTH16BYTES];
dataconvert::DataConvert::decimalToString( &x.s128Value, x.scale, buf, utils::MAXLENGTH16BYTES, op_ct.colDataType);
char buf[datatypes::Decimal::MAXLENGTH16BYTES];
dataconvert::DataConvert::decimalToString( &x.s128Value, x.scale, buf, (uint8_t) sizeof(buf), op_ct.colDataType);
return string(buf);
}
}