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

MCOL-4171 Window functions with decimal(38)

This commit is contained in:
David Hall
2020-08-10 13:59:49 -05:00
committed by Roman Nozdrin
parent 62c1c1e0e2
commit c4d8516a47
4 changed files with 97 additions and 62 deletions

View File

@ -361,7 +361,9 @@ bool WindowFunctionColumn::hasWindowFunc()
void WindowFunctionColumn::adjustResultType()
{
if (fResultType.colDataType == CalpontSystemCatalog::DECIMAL &&
if ((fResultType.colDataType == CalpontSystemCatalog::DECIMAL ||
fResultType.colDataType == CalpontSystemCatalog::UDECIMAL)
&&
!boost::iequals(fFunctionName, "COUNT") &&
!boost::iequals(fFunctionName, "COUNT(*)") &&
!boost::iequals(fFunctionName, "ROW_NUMBER") &&
@ -389,7 +391,8 @@ void WindowFunctionColumn::adjustResultType()
boost::iequals(fFunctionName, "AVG") ||
boost::iequals(fFunctionName, "AVG_DISTINCT"))
{
if (fFunctionParms[0]->resultType().colDataType == CalpontSystemCatalog::DECIMAL)
if (fFunctionParms[0]->resultType().colDataType == CalpontSystemCatalog::DECIMAL ||
fFunctionParms[0]->resultType().colDataType == CalpontSystemCatalog::UDECIMAL)
{
fResultType.colWidth = sizeof(int128_t);
}