1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Merge pull request #3202 from denis0x0D/MCOL-5708

MCOL-5708 Calculate precision and scale for constant decimal.
This commit is contained in:
Denis Khalikov
2024-06-24 11:16:58 +03:00
committed by GitHub
5 changed files with 90 additions and 2 deletions

View File

@ -3821,10 +3821,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;