1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +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

@ -53,7 +53,6 @@
#include "vlarray.h"
#include "collation.h"
#include "widedecimalutils.h"
//..comment out NDEBUG to enable assertions, uncomment NDEBUG to disable
//#define NDEBUG
@ -2752,7 +2751,7 @@ void RowAggregationUM::calculateAvgColumns()
uint32_t precision = fRow.getPrecision(colOut);
bool isWideDecimal =
datatypes::Decimal::isWideDecimalType(precision);
datatypes::Decimal::isWideDecimalTypeByPrecision(precision);
if (LIKELY(!isWideDecimal))
{
@ -3687,12 +3686,12 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData
auto width = fRow.getColumnWidth(colOut);
if (width == datatypes::MAXDECIMALWIDTH)
{
ColTypeAlias colType;
execplan::CalpontSystemCatalog::TypeHolderStd colType;
colType.colWidth = width;
colType.precision = fRow.getPrecision(i);
colType.scale = fRow.getScale(i);
colType.colDataType = colDataType;
fRow.setInt128Field(Dec::int128FromString(aggData.fConstValue, colType), colOut);
fRow.setInt128Field(colType.decimal128FromString(aggData.fConstValue), colOut);
}
else if (width <= datatypes::MAXLEGACYWIDTH)
{
@ -3812,13 +3811,12 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData
auto width = fRow.getColumnWidth(colOut);
if (width == datatypes::MAXDECIMALWIDTH)
{
ColTypeAlias colType;
execplan::CalpontSystemCatalog::TypeHolderStd colType;
colType.colWidth = width;
colType.precision = fRow.getPrecision(i);
colType.scale = fRow.getScale(i);
colType.colDataType = colDataType;
int128_t constValue = Dec::int128FromString(aggData.fConstValue,
colType);
int128_t constValue = colType.decimal128FromString(aggData.fConstValue);
int128_t sum;
datatypes::MultiplicationOverflowCheck multOp;