You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-641 Fixed group_concat for narrow-DECIMALs.
This commit is contained in:
@ -457,17 +457,32 @@ void GroupConcator::outputRow(std::ostringstream& oss, const rowgroup::Row& row)
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
{
|
||||
int scale = (int) row.getScale(*i);
|
||||
//{
|
||||
// long double dblVal = intVal / pow(10.0, (double)scale);
|
||||
// oss << fixed << setprecision(scale) << dblVal;
|
||||
//}
|
||||
char buf[utils::MAXLENGTH16BYTES];
|
||||
|
||||
int128_t* dec = row.getBinaryField<int128_t>(*i);
|
||||
dataconvert::DataConvert::decimalToString(dec,
|
||||
static_cast<uint32_t>(scale), buf,
|
||||
sizeof(buf), types[*i]);
|
||||
oss << fixed << buf;
|
||||
|
||||
if (LIKELY(row.getColumnWidth(*i) == datatypes::MAXDECIMALWIDTH))
|
||||
{
|
||||
char buf[utils::MAXLENGTH16BYTES];
|
||||
|
||||
int128_t* dec = row.getBinaryField<int128_t>(*i);
|
||||
dataconvert::DataConvert::decimalToString(dec,
|
||||
static_cast<uint32_t>(scale), buf,
|
||||
sizeof(buf), types[*i]);
|
||||
oss << fixed << buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
int64_t intVal = row.getIntField(*i);
|
||||
if (scale == 0)
|
||||
{
|
||||
oss << intVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[utils::MAXLENGTH8BYTES];
|
||||
dataconvert::DataConvert::decimalToString(intVal,
|
||||
scale, buf, sizeof(buf), types[*i]);
|
||||
oss << fixed << buf;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user