1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-641 sum() now works with DECIMAL(38) columns.

TupleAggregateStep class method and buildAggregateColumn() now properly set result data type.

doSum() now handles DECIMAL(38) in approprate manner.

Low-level null related methods for new binary-based datatypes now handles magic values for
binary-based DT.
This commit is contained in:
drrtuy
2020-01-30 17:27:36 +03:00
committed by Roman Nozdrin
parent 98213c0094
commit 0ff0472842
6 changed files with 164 additions and 38 deletions

View File

@ -3129,13 +3129,30 @@ void TupleAggregateStep::prep2PhasesAggregate(
throw IDBExcept(emsg, ERR_AGGREGATE_TYPE_NOT_SUPPORT);
}
oidsAggPm.push_back(oidsProj[colProj]);
keysAggPm.push_back(aggKey);
typeAggPm.push_back(CalpontSystemCatalog::LONGDOUBLE);
csNumAggPm.push_back(8);
scaleAggPm.push_back(0);
precisionAggPm.push_back(-1);
widthAggPm.push_back(sizeof(long double));
// WIP MCOL-641 Replace condition with a
// dynamic one
if (typeProj[colProj] == CalpontSystemCatalog::DECIMAL
&& width[colProj] == 16)
{
oidsAggPm.push_back(oidsProj[colProj]);
keysAggPm.push_back(aggKey);
typeAggPm.push_back(CalpontSystemCatalog::DECIMAL);
scaleAggPm.push_back(0);
// WIP makes this dynamic
precisionAggPm.push_back(38);
widthAggPm.push_back(width[colProj]);
csNumAggPm.push_back(8);
}
else
{
oidsAggPm.push_back(oidsProj[colProj]);
keysAggPm.push_back(aggKey);
typeAggPm.push_back(CalpontSystemCatalog::LONGDOUBLE);
scaleAggPm.push_back(0);
csNumAggPm.push_back(8);
precisionAggPm.push_back(-1);
widthAggPm.push_back(sizeof(long double));
}
colAggPm++;
}