Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using uninitialized value error. #7131

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ydb/core/kqp/opt/kqp_query_plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,7 @@ class TxPlanSerializer {
}

if (auto literal = key.Maybe<TCoUuid>()) {
TStringStream out;
NUuid::UuidBytesToString(literal.Cast().Literal().Value().Data(), out);
return out.Str();
return NUuid::UuidBytesToString(literal.Cast().Literal().StringValue());
}

if (auto literal = key.Maybe<TCoDataCtor>()) {
Expand Down
8 changes: 8 additions & 0 deletions ydb/library/uuid/uuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ static void WriteHex(ui16 bytes, IOutputStream& out, bool reverseBytes = false)
}
}

TString UuidBytesToString(const TString& in) {
TStringStream ss;

UuidBytesToString(in, ss);

return ss.Str();
}

void UuidBytesToString(TString in, IOutputStream& out) {
ui16 dw[8];
std::memcpy(dw, in.Data(), sizeof(dw));
Expand Down
1 change: 1 addition & 0 deletions ydb/library/uuid/uuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace NUuid {

static constexpr ui32 UUID_LEN = 16;

TString UuidBytesToString(const TString& in);
void UuidBytesToString(TString in, IOutputStream& out);
void UuidToString(ui16 dw[8], IOutputStream& out);
void UuidHalfsToByteString(ui64 low, ui64 hi, IOutputStream& out);
Expand Down
Loading