You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-5708 Calculate precision and scale for constant decimal.
This patch calculates precision and scale for constant decimal value for SUM aggregation function.
This commit is contained in:
@ -3702,10 +3702,13 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData
|
||||
auto width = fRow.getColumnWidth(colOut);
|
||||
if (width == datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
int precision, scale;
|
||||
// MCOL-5708 Calculate precision and scale based on the given value.
|
||||
datatypes::decimalPrecisionAndScale(aggData.fConstValue, precision, scale);
|
||||
datatypes::TypeHolderStd colType;
|
||||
colType.colWidth = width;
|
||||
colType.precision = fRow.getPrecision(i);
|
||||
colType.scale = fRow.getScale(i);
|
||||
colType.precision = precision;
|
||||
colType.scale = scale;
|
||||
colType.colDataType = colDataType;
|
||||
int128_t constValue = colType.decimal128FromString(aggData.fConstValue);
|
||||
int128_t sum;
|
||||
|
Reference in New Issue
Block a user