Skip to content

Commit 43079bb

Browse files
authored
Fix using uninitialized value error. (#7131)
1 parent b1c552b commit 43079bb

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

ydb/core/kqp/opt/kqp_query_plan.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,7 @@ class TxPlanSerializer {
561561
}
562562

563563
if (auto literal = key.Maybe<TCoUuid>()) {
564-
TStringStream out;
565-
NUuid::UuidBytesToString(literal.Cast().Literal().Value().Data(), out);
566-
return out.Str();
564+
return NUuid::UuidBytesToString(literal.Cast().Literal().StringValue());
567565
}
568566

569567
if (auto literal = key.Maybe<TCoDataCtor>()) {

ydb/library/uuid/uuid.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ static void WriteHex(ui16 bytes, IOutputStream& out, bool reverseBytes = false)
2828
}
2929
}
3030

31+
TString UuidBytesToString(const TString& in) {
32+
TStringStream ss;
33+
34+
UuidBytesToString(in, ss);
35+
36+
return ss.Str();
37+
}
38+
3139
void UuidBytesToString(TString in, IOutputStream& out) {
3240
ui16 dw[8];
3341
std::memcpy(dw, in.Data(), sizeof(dw));

ydb/library/uuid/uuid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace NUuid {
1313

1414
static constexpr ui32 UUID_LEN = 16;
1515

16+
TString UuidBytesToString(const TString& in);
1617
void UuidBytesToString(TString in, IOutputStream& out);
1718
void UuidToString(ui16 dw[8], IOutputStream& out);
1819
void UuidHalfsToByteString(ui64 low, ui64 hi, IOutputStream& out);

0 commit comments

Comments
 (0)