Skip to content

Commit 9c7492a

Browse files
committed
Sanitizer fix
1 parent 3db358b commit 9c7492a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ydb/core/engine/mkql_proto.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ bool CellsFromTuple(const NKikimrMiniKQL::TType* tupleType,
226226
case NScheme::NTypeIds::Decimal:
227227
{
228228
if (v.HasLow128() && v.HasHi128()) {
229-
c = TCell::Make<std::pair<ui64, ui64>>({v.GetLow128(), v.GetHi128()});
229+
NYql::NDecimal::TInt128 int128 = NYql::NDecimal::FromProto(v);
230+
auto &data = memoryOwner.emplace_back();
231+
data.resize(sizeof(NYql::NDecimal::TInt128));
232+
std::memcpy(data.Detach(), &int128, sizeof(NYql::NDecimal::TInt128));
233+
c = TCell(data);
230234
} else {
231235
CHECK_OR_RETURN_ERROR(false, Sprintf("Cannot parse value of type Decimal in tuple at position %" PRIu32, i));
232236
}

ydb/core/grpc_services/rpc_object_storage.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ bool CellFromTuple(NScheme::TTypeInfo type,
147147
case NScheme::NTypeIds::Decimal:
148148
{
149149
if (tupleValue.Haslow_128()) {
150-
c = TCell::Make<std::pair<ui64, ui64>>({tupleValue.Getlow_128(), tupleValue.Gethigh_128()});
150+
NYql::NDecimal::TInt128 int128 = NYql::NDecimal::FromHalfs(tupleValue.Getlow_128(), tupleValue.Gethigh_128());
151+
auto &data = memoryOwner.emplace_back();
152+
data.resize(sizeof(NYql::NDecimal::TInt128));
153+
std::memcpy(data.Detach(), &int128, sizeof(NYql::NDecimal::TInt128));
154+
c = TCell(data);
151155
} else {
152156
CHECK_OR_RETURN_ERROR(false, Sprintf("Cannot parse value of type Decimal in tuple at position %" PRIu32, position));
153157
}

0 commit comments

Comments
 (0)