Skip to content

Commit bcf7975

Browse files
SammyVimesGazizonoki
authored andcommitted
Moved commit "YDB-2822 Fix UUID column usage in CDC" from ydb repo
1 parent 6a91cca commit bcf7975

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/library/uuid/uuid.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ void UuidBytesToString(const std::string& in, IOutputStream& out) {
5757
NUuid::UuidToString(dw, out);
5858
}
5959

60+
void UuidHalfsToString(ui64 low, ui64 hi, IOutputStream& out) {
61+
union {
62+
ui16 dw[8];
63+
ui64 half[2];
64+
} buf;
65+
buf.half[0] = low;
66+
buf.half[1] = hi;
67+
NUuid::UuidToString(buf.dw, out);
68+
}
69+
6070
void UuidHalfsToByteString(ui64 low, ui64 hi, IOutputStream& out) {
6171
union {
6272
char bytes[16];

src/library/uuid/uuid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ static constexpr ui32 UUID_LEN = 16;
1515

1616
std::string UuidBytesToString(const std::string& in);
1717
void UuidBytesToString(const std::string& in, IOutputStream& out);
18+
void UuidHalfsToString(ui64 low, ui64 hi, IOutputStream& out);
1819
void UuidToString(ui16 dw[8], IOutputStream& out);
1920
void UuidHalfsToByteString(ui64 low, ui64 hi, IOutputStream& out);
2021

0 commit comments

Comments
 (0)