MCPcopy Create free account
hub / github.com/ByConity/ByConity / toString

Method toString

src/Core/MySQL/MySQLGtid.cpp:132–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132String GTIDSets::toString() const
133{
134 WriteBufferFromOwnString buffer;
135
136 for (size_t i = 0; i < sets.size(); ++i)
137 {
138 GTIDSet set = sets[i];
139 writeUUIDText(set.uuid, buffer);
140
141 for (const auto & interval : set.intervals)
142 {
143 buffer.write(':');
144 auto start = interval.start;
145 auto end = interval.end;
146
147 if (end == (start + 1))
148 {
149 writeString(std::to_string(start), buffer);
150 }
151 else
152 {
153 writeString(std::to_string(start), buffer);
154 buffer.write('-');
155 writeString(std::to_string(end - 1), buffer);
156 }
157 }
158
159 if (i < (sets.size() - 1))
160 {
161 buffer.write(',');
162 }
163 }
164 return buffer.str();
165}
166
167String GTIDSets::toPayload() const
168{

Callers 2

GTEST_TESTFunction · 0.45
mainFunction · 0.45

Calls 6

writeUUIDTextFunction · 0.85
writeStringFunction · 0.85
to_stringFunction · 0.70
sizeMethod · 0.45
writeMethod · 0.45
strMethod · 0.45

Tested by 1

GTEST_TESTFunction · 0.36