1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fix: MCOL-5755: incorrect handling of BLOB (and TEXT) in GROUP BY

BLOB fields did not work as grouping keys at all, they were assigned
value NULL for any value, be it NULL or not. The fix is in the
rowaggregation.cpp in the initMapping(), a switch/case branch was added
to handle BLOB field copying there.

Also, TEXT columns did not distinguish between NULL and empty string in
the grouping algorithm, now they do. The fix is in the equals()
function, now we specifically check for isNull() equality between
values.
This commit is contained in:
Serguey Zefirov
2024-07-09 10:29:08 +03:00
committed by Leonid Fedorov
parent 6d1c6d8242
commit 3bb2496ca1
8 changed files with 79 additions and 10 deletions

View File

@ -955,6 +955,10 @@ void RowAggregation::initMapData(const Row& rowIn)
break;
}
case execplan::CalpontSystemCatalog::VARBINARY:
case execplan::CalpontSystemCatalog::BLOB:
fRow.setStringField(rowIn.getConstString(colIn), colOut);
break;
case execplan::CalpontSystemCatalog::DOUBLE:
case execplan::CalpontSystemCatalog::UDOUBLE:
@ -1306,6 +1310,8 @@ void RowAggregation::doSelectSome(const Row& rowIn, int64_t colIn, int64_t colOu
case execplan::CalpontSystemCatalog::CHAR:
case execplan::CalpontSystemCatalog::VARCHAR:
case execplan::CalpontSystemCatalog::TEXT:
case execplan::CalpontSystemCatalog::CLOB:
case execplan::CalpontSystemCatalog::BLOB:
{
auto valIn = rowIn.getStringField(colIn);
fRow.setStringField(valIn, colOut);
@ -1345,12 +1351,6 @@ void RowAggregation::doSelectSome(const Row& rowIn, int64_t colIn, int64_t colOu
break;
}
case execplan::CalpontSystemCatalog::CLOB:
case execplan::CalpontSystemCatalog::BLOB:
{
fRow.setVarBinaryField(rowIn.getVarBinaryField(colIn), rowIn.getVarBinaryLength(colIn), colOut);
break;
}
default:
{
idbassert_s(0, "unknown data type in doSelectSome()");