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

MCOL-641 This commit changes NULL and EMPTY values.

It also contains the refactored DataConvert::decimalToString().

Row::toString UT is finished.
This commit is contained in:
Roman Nozdrin
2020-02-21 17:47:04 +00:00
parent de85e21c38
commit c23ead2703
7 changed files with 194 additions and 47 deletions

View File

@ -642,8 +642,8 @@ string Row::toString() const
{
char *buf = (char*)alloca(precision[i] + 3);
// empty the buffer
dataconvert::DataConvert::toString<int128_t>(getBinaryField<int128_t>(i),
buf, precision[i]+3);
dataconvert::DataConvert::toString(getBinaryField<int128_t>(i),
buf, precision[i]+3); //WIP scale[i]
os << buf << " ";
break;
}
@ -851,8 +851,8 @@ void Row::initToNull()
case 16 :
{
uint64_t *dec = reinterpret_cast<uint64_t*>(&data[offsets[i]]);
dec[0] = joblist::BINARYEMPTYROW;
dec[1] = joblist::BINARYNULL;
dec[0] = joblist::BINARYNULL;
dec[1] = joblist::BINARYEMPTYROW;
break;
}
default:
@ -882,8 +882,8 @@ void Row::initToNull()
case CalpontSystemCatalog::BINARY:
{
uint64_t *dec = reinterpret_cast<uint64_t*>(&data[offsets[i]]);
dec[0] = joblist::BINARYEMPTYROW;
dec[1] = joblist::BINARYNULL;
dec[0] = joblist::BINARYNULL;
dec[1] = joblist::BINARYEMPTYROW;
}
break;
@ -916,10 +916,10 @@ Row::isNullValue_offset<execplan::CalpontSystemCatalog::BINARY,32>(
uint32_t offset) const
{
const int64_t *intPtr = reinterpret_cast<const int64_t*>(&data[offset]);
return ((intPtr[0] == static_cast<int64_t>(joblist::BINARYEMPTYROW)) &&
return ((intPtr[0] == static_cast<int64_t>(joblist::BINARYNULL)) &&
(intPtr[1] == static_cast<int64_t>(joblist::BINARYEMPTYROW)) &&
(intPtr[2] == static_cast<int64_t>(joblist::BINARYEMPTYROW)) &&
(intPtr[3] == static_cast<int64_t>(joblist::BINARYNULL)));
(intPtr[3] == static_cast<int64_t>(joblist::BINARYEMPTYROW)));
}
template<>
@ -928,8 +928,8 @@ Row::isNullValue_offset<execplan::CalpontSystemCatalog::BINARY,16>(
uint32_t offset) const
{
const int64_t *intPtr = reinterpret_cast<const int64_t*>(&data[offset]);
return ((intPtr[0] == static_cast<int64_t>(joblist::BINARYEMPTYROW))
&& (intPtr[1] == static_cast<int64_t>(joblist::BINARYNULL)));
return ((intPtr[0] == static_cast<int64_t>(joblist::BINARYNULL))
&& (intPtr[1] == static_cast<int64_t>(joblist::BINARYEMPTYROW)));
}
template<>
@ -938,8 +938,8 @@ Row::isNullValue_offset<execplan::CalpontSystemCatalog::DECIMAL,16>(
uint32_t offset) const
{
const int64_t *intPtr = reinterpret_cast<const int64_t*>(&data[offset]);
return ((intPtr[0] == static_cast<int64_t>(joblist::BINARYEMPTYROW))
&& (intPtr[1] == static_cast<int64_t>(joblist::BINARYNULL)));
return ((intPtr[0] == static_cast<int64_t>(joblist::BINARYNULL))
&& (intPtr[1] == static_cast<int64_t>(joblist::BINARYEMPTYROW)));
}
template<>