You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MDEV-27519 CRC32() upon Columnstore table returns a wrong value
This commit is contained in:
@@ -50,23 +50,23 @@ int64_t Func_crc32::getIntVal(rowgroup::Row& row,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& ct)
|
||||
{
|
||||
unsigned crc;
|
||||
switch (parm.size) {
|
||||
unsigned crc = 0;
|
||||
switch (parm.size())
|
||||
{
|
||||
default:
|
||||
isNull = true;
|
||||
return 0;
|
||||
case 1:
|
||||
crc = 0;
|
||||
break;
|
||||
case 2:
|
||||
crc = static_cast<unsigned>(parm[0]->data()->getIntVal(row, isNull));
|
||||
if (isNull)
|
||||
return 0;
|
||||
}
|
||||
const string& b = parm[parm.size - 1]->data()->getStrVal(row, isNull);
|
||||
const string& b = parm[parm.size() - 1]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
return 0;
|
||||
return crc32(crc, reinterpret_cast<unsigned char*>(b.data()), b.size());
|
||||
return crc32(crc, reinterpret_cast<const uint8_t*>(b.data()), b.size());
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user