26#ifndef MYSQL_ROUTER_CLASSIC_PROTOCOL_CODEC_MESSAGE_H_
27#define MYSQL_ROUTER_CLASSIC_PROTOCOL_CODEC_MESSAGE_H_
32#include <system_error>
81template <
bool Borrowed>
84 Codec<borrowable::message::server::Greeting<Borrowed>>> {
85 template <
class Accumulator>
87 namespace bw = borrowable::wire;
89 if (v_.protocol_version() == 0x09) {
90 return accu.step(bw::FixedInt<1>(v_.protocol_version()))
91 .step(bw::NulTermString<Borrowed>(v_.version()))
92 .step(bw::FixedInt<4>(v_.connection_id()))
93 .step(bw::NulTermString<Borrowed>(v_.auth_method_data().substr(0, 8)))
96 uint8_t auth_method_data_size{0};
98 auth_method_data_size = v_.auth_method_data().size();
101 accu.step(bw::FixedInt<1>(v_.protocol_version()))
102 .step(bw::NulTermString<Borrowed>(v_.version()))
103 .step(bw::FixedInt<4>(v_.connection_id()))
104 .step(bw::NulTermString<Borrowed>(v_.auth_method_data().substr(0, 8)))
105 .step(bw::FixedInt<2>(v_.capabilities().to_ulong() & 0xffff));
107 if ((v_.capabilities().to_ullong() >= (1 << 16)) ||
108 v_.status_flags().any() || (v_.collation() != 0)) {
109 accu.step(bw::FixedInt<1>(v_.collation()))
110 .step(bw::FixedInt<2>(v_.status_flags().to_ulong()))
112 bw::FixedInt<2>((v_.capabilities().to_ulong() >> 16) & 0xffff))
113 .step(bw::FixedInt<1>(auth_method_data_size))
114 .step(bw::String<Borrowed>(std::string(10,
'\0')));
115 if (v_.capabilities()
117 accu.step(bw::String<Borrowed>(v_.auth_method_data().substr(8)));
118 if (v_.capabilities()
120 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_name()));
124 return accu.result();
129 using value_type = borrowable::message::server::Greeting<Borrowed>;
141 namespace bw = borrowable::wire;
144 auto protocol_version_res = accu.template step<bw::FixedInt<1>>();
147 if (protocol_version_res->value() != 0x09 &&
148 protocol_version_res->value() != 0x0a) {
152 auto version_res = accu.template step<bw::NulTermString<Borrowed>>();
153 auto connection_id_res = accu.template step<bw::FixedInt<4>>();
154 auto auth_method_data_res =
155 accu.template step<bw::NulTermString<Borrowed>>();
157 if (protocol_version_res->value() == 0x09) {
158 return std::make_pair(
160 value_type(protocol_version_res->value(), version_res->value(),
161 connection_id_res->value(), auth_method_data_res->value(),
166 auto cap_lower_res = accu.template step<bw::FixedInt<2>>();
171 return std::make_pair(
173 value_type(protocol_version_res->value(), version_res->value(),
174 connection_id_res->value(),
175 auth_method_data_res->value(), cap_lower_res->value(),
180 auto collation_res = accu.template step<bw::FixedInt<1>>();
181 auto status_flags_res = accu.template step<bw::FixedInt<2>>();
182 auto cap_hi_res = accu.template step<bw::FixedInt<2>>();
188 cap_lower_res->value() | (cap_hi_res->value() << 16));
190 size_t auth_method_data_len{13};
192 auto auth_method_data_len_res = accu.template step<bw::FixedInt<1>>();
196 if (auth_method_data_len_res->value() < 8) {
200 auth_method_data_len = auth_method_data_len_res->value() - 8;
202 accu.template step<void>(1);
205 accu.template step<void>(10);
208 auth_method_data_2_res;
214 auth_method_data_2_res =
215 accu.template step<bw::String<Borrowed>>(auth_method_data_len);
219 auth_method_res = accu.template step<bw::NulTermString<Borrowed>>();
225 return std::make_pair(
228 protocol_version_res->value(), version_res->value(),
229 connection_id_res->value(),
230 auth_method_data_res->value() + auth_method_data_2_res->
value(),
231 capabilities, collation_res->value(), status_flags_res->value(),
232 auth_method_res->
value()));
243template <
bool Borrowed>
246 Codec<borrowable::message::server::AuthMethodSwitch<Borrowed>>> {
247 template <
class Accumulator>
249 namespace bw = borrowable::wire;
251 accu.step(bw::FixedInt<1>(cmd_byte()));
254 accu.step(bw::NulTermString<Borrowed>(v_.auth_method()))
255 .step(bw::String<Borrowed>(v_.auth_method_data()));
258 return accu.result();
262 using value_type = borrowable::message::server::AuthMethodSwitch<Borrowed>;
270 static constexpr uint8_t
cmd_byte() noexcept {
return 0xfe; }
276 namespace bw = borrowable::wire;
279 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
282 if (cmd_byte_res->value() != cmd_byte()) {
290 auto auth_method_res = accu.template step<bw::NulTermString<Borrowed>>();
291 auto auth_method_data_res = accu.template step<bw::String<Borrowed>>();
295 return std::make_pair(
297 value_type(auth_method_res->value(), auth_method_data_res->value()));
307template <
bool Borrowed>
310 Codec<borrowable::message::server::AuthMethodData<Borrowed>>> {
311 template <
class Accumulator>
313 namespace bw = borrowable::wire;
315 return accu.step(bw::FixedInt<1>(cmd_byte()))
316 .step(bw::String<Borrowed>(v_.auth_method_data()))
321 using value_type = borrowable::message::server::AuthMethodData<Borrowed>;
329 static constexpr uint8_t
cmd_byte() noexcept {
return 0x01; }
335 namespace bw = borrowable::wire;
337 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
340 if (cmd_byte_res->value() != cmd_byte()) {
343 auto auth_method_data_res = accu.template step<bw::String<Borrowed>>();
358template <
bool Borrowed>
361 Codec<borrowable::message::server::Ok<Borrowed>>> {
362 template <
class Accumulator>
364 namespace bw = borrowable::wire;
366 accu.step(bw::FixedInt<1>(cmd_byte()))
372 accu.step(bw::FixedInt<2>(v_.status_flags().to_ulong()));
374 accu.step(bw::FixedInt<2>(v_.warning_count()));
379 accu.step(bw::VarString<Borrowed>(v_.message()));
381 accu.step(bw::VarString<Borrowed>(v_.session_changes()));
384 accu.step(bw::String<Borrowed>(v_.message()));
387 return accu.result();
391 using value_type = borrowable::message::server::Ok<Borrowed>;
399 static constexpr uint8_t
cmd_byte() noexcept {
return 0x00; }
420 namespace bw = borrowable::wire;
422 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
425 if (cmd_byte_res->value() != cmd_byte()) {
429 auto affected_rows_res = accu.template step<bw::VarInt>();
430 auto last_insert_id_res = accu.template step<bw::VarInt>();
436 status_flags_res = accu.template step<bw::FixedInt<2>>();
438 warning_count_res = accu.template step<bw::FixedInt<2>>();
447 const auto var_message_res =
448 accu.template try_step<bw::VarString<Borrowed>>();
449 if (var_message_res) {
451 message_res = var_message_res.
value();
454 if (status_flags_res->
value() &
456 session_changes_res = accu.template step<bw::VarString<Borrowed>>();
459 message_res = accu.template step<bw::String<Borrowed>>();
464 return std::make_pair(
466 value_type(affected_rows_res->value(), last_insert_id_res->value(),
467 status_flags_res->
value(), warning_count_res->
value(),
468 message_res->
value(), session_changes_res->
value()));
493template <
bool Borrowed>
496 Codec<borrowable::message::server::Eof<Borrowed>>> {
497 template <
class Accumulator>
499 namespace bw = borrowable::wire;
501 accu.step(bw::FixedInt<1>(cmd_byte()));
503 auto shared_caps = this->caps();
505 if (shared_caps.test(
512 accu.step(bw::FixedInt<2>(v_.status_flags().to_ulong()));
514 accu.step(bw::FixedInt<2>(v_.warning_count()));
519 if (!v_.message().empty() ||
523 accu.step(bw::VarString<Borrowed>(v_.message()));
525 accu.step(bw::VarString<Borrowed>(v_.session_changes()));
529 accu.step(bw::String<Borrowed>(v_.message()));
532 accu.step(bw::FixedInt<2>(v_.warning_count()))
533 .step(bw::FixedInt<2>(v_.status_flags().to_ulong()));
536 return accu.result();
540 using value_type = borrowable::message::server::Eof<Borrowed>;
548 static constexpr uint8_t
cmd_byte() noexcept {
return 0xfe; }
573 namespace bw = borrowable::wire;
575 const auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
578 if (cmd_byte_res->value() != cmd_byte()) {
583 const auto affected_rows_res = accu.template step<bw::VarInt>();
584 const auto last_insert_id_res = accu.template step<bw::VarInt>();
590 status_flags_res = accu.template step<bw::FixedInt<2>>();
592 warning_count_res = accu.template step<bw::FixedInt<2>>();
598 session_state_info_res;
602 const auto var_message_res =
603 accu.template try_step<bw::VarString<Borrowed>>();
604 if (var_message_res) {
606 message_res = var_message_res.
value();
609 if (status_flags_res->
value() &
611 session_state_info_res =
612 accu.template step<bw::VarString<Borrowed>>();
615 message_res = accu.template step<bw::String<Borrowed>>();
620 return std::make_pair(
622 value_type(affected_rows_res->value(), last_insert_id_res->value(),
623 status_flags_res->
value(), warning_count_res->
value(),
624 message_res->
value(), session_state_info_res->
value()));
626 const auto warning_count_res = accu.template step<bw::FixedInt<2>>();
627 const auto status_flags_res = accu.template step<bw::FixedInt<2>>();
629 return std::make_pair(
631 value_type(status_flags_res->value(), warning_count_res->value()));
665template <
bool Borrowed>
668 Codec<borrowable::message::server::Error<Borrowed>>> {
669 template <
class Accumulator>
671 namespace bw = borrowable::wire;
673 accu.step(bw::FixedInt<1>(cmd_byte()))
674 .step(bw::FixedInt<2>(v_.error_code()));
676 accu.step(bw::FixedInt<1>(
'#'))
677 .step(bw::String<Borrowed>(v_.sql_state()));
680 return accu.step(bw::String<Borrowed>(v_.message())).result();
684 using value_type = borrowable::message::server::Error<Borrowed>;
692 static constexpr uint8_t
cmd_byte() {
return 0xff; }
695 return std::numeric_limits<size_t>::max();
702 namespace bw = borrowable::wire;
704 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
707 if (cmd_byte_res->value() != cmd_byte()) {
712 auto error_code_res = accu.template step<bw::FixedInt<2>>();
715 auto sql_state_hash_res = accu.template step<bw::FixedInt<1>>();
716 sql_state_res = accu.template step<bw::String<Borrowed>>(5);
718 auto message_res = accu.template step<bw::String<Borrowed>>();
722 return std::make_pair(
724 value_type(error_code_res->value(), message_res->value(),
725 sql_state_res->value()));
737 :
public impl::EncodeBase<Codec<borrowable::message::server::ColumnCount>> {
738 template <
class Accumulator>
740 namespace bw = borrowable::wire;
742 return accu.step(
bw::VarInt(v_.count())).result();
755 return std::numeric_limits<size_t>::max();
762 namespace bw = borrowable::wire;
764 auto count_res = accu.template step<bw::VarInt>();
781template <
bool Borrowed>
784 Codec<borrowable::message::server::ColumnMeta<Borrowed>>> {
785 template <
class Accumulator>
787 namespace bw = borrowable::wire;
790 accu.step(bw::VarString<Borrowed>(v_.table()))
791 .step(bw::VarString<Borrowed>(v_.name()))
793 .step(bw::FixedInt<3>(v_.column_length()))
795 .step(bw::FixedInt<1>(v_.type()));
799 .step(bw::FixedInt<2>(v_.flags().to_ulong()))
800 .step(bw::FixedInt<1>(v_.decimals()));
803 .step(bw::FixedInt<1>(v_.flags().to_ulong()))
804 .step(bw::FixedInt<1>(v_.decimals()));
807 return accu.result();
809 return accu.step(bw::VarString<Borrowed>(v_.catalog()))
810 .step(bw::VarString<Borrowed>(v_.schema()))
811 .step(bw::VarString<Borrowed>(v_.table()))
812 .step(bw::VarString<Borrowed>(v_.orig_table()))
813 .step(bw::VarString<Borrowed>(v_.name()))
814 .step(bw::VarString<Borrowed>(v_.orig_name()))
816 .step(bw::FixedInt<2>(v_.collation()))
817 .step(bw::FixedInt<4>(v_.column_length()))
818 .step(bw::FixedInt<1>(v_.type()))
819 .step(bw::FixedInt<2>(v_.flags().to_ulong()))
820 .step(bw::FixedInt<1>(v_.decimals()))
821 .step(bw::FixedInt<2>(0))
827 using value_type = borrowable::message::server::ColumnMeta<Borrowed>;
836 return std::numeric_limits<size_t>::max();
843 namespace bw = borrowable::wire;
851 const auto table_res = accu.template step<bw::VarString<Borrowed>>();
852 const auto name_res = accu.template step<bw::VarString<Borrowed>>();
854 const auto column_length_len_res = accu.template step<bw::VarInt>();
857 if (column_length_len_res->value() != 3) {
862 const auto column_length_res = accu.template step<bw::FixedInt<3>>();
863 const auto type_len_res = accu.template step<bw::VarInt>();
866 if (type_len_res->value() != 1) {
871 const auto type_res = accu.template step<bw::FixedInt<1>>();
872 const auto flags_and_decimals_len_res = accu.template step<bw::VarInt>();
875 if (flags_and_decimals_len_res->value() != flags_size + 1) {
882 if (flags_size == 2) {
883 flags_and_decimals_res = accu.template step<bw::FixedInt<3>>();
885 const auto small_flags_and_decimals_res =
886 accu.template step<bw::FixedInt<2>>();
887 if (small_flags_and_decimals_res) {
888 flags_and_decimals_res =
889 bw::FixedInt<3>(small_flags_and_decimals_res->value());
895 const uint16_t
flags =
896 flags_and_decimals_res->
value() & ((1 << (flags_size * 8)) - 1);
897 const uint8_t decimals =
898 flags_and_decimals_res->
value() >> (flags_size * 8);
900 return std::make_pair(
902 value_type({}, {}, table_res->value(), {}, name_res->value(), {}, {},
903 column_length_res->value(), type_res->value(),
flags,
906 const auto catalog_res = accu.template step<bw::VarString<Borrowed>>();
907 const auto schema_res = accu.template step<bw::VarString<Borrowed>>();
908 const auto table_res = accu.template step<bw::VarString<Borrowed>>();
909 const auto orig_table_res = accu.template step<bw::VarString<Borrowed>>();
910 const auto name_res = accu.template step<bw::VarString<Borrowed>>();
911 const auto orig_name_res = accu.template step<bw::VarString<Borrowed>>();
915 const auto other_len_res = accu.template step<bw::VarInt>();
917 if (other_len_res->value() != 12) {
922 const auto collation_res = accu.template step<bw::FixedInt<2>>();
923 const auto column_length_res = accu.template step<bw::FixedInt<4>>();
924 const auto type_res = accu.template step<bw::FixedInt<1>>();
925 const auto flags_res = accu.template step<bw::FixedInt<2>>();
926 const auto decimals_res = accu.template step<bw::FixedInt<1>>();
928 accu.template step<void>(2);
932 return std::make_pair(
934 value_type(catalog_res->value(), schema_res->value(),
935 table_res->value(), orig_table_res->value(),
936 name_res->value(), orig_name_res->value(),
937 collation_res->value(), column_length_res->value(),
938 type_res->value(), flags_res->value(),
939 decimals_res->value()));
956template <
bool Borrowed>
959 Codec<borrowable::message::server::SendFileRequest<Borrowed>>> {
960 template <
class Accumulator>
962 namespace bw = borrowable::wire;
964 return accu.step(bw::FixedInt<1>(cmd_byte()))
965 .step(bw::String<Borrowed>(v_.filename()))
970 using value_type = borrowable::message::server::SendFileRequest<Borrowed>;
978 static constexpr uint8_t
cmd_byte() noexcept {
return 0xfb; }
984 namespace bw = borrowable::wire;
986 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
989 if (cmd_byte_res->value() != cmd_byte()) {
993 auto filename_res = accu.template step<bw::String<Borrowed>>();
1025 Codec<borrowable::message::server::StmtPrepareOk>> {
1026 template <
class Accumulator>
1028 namespace bw = borrowable::wire;
1030 accu.step(bw::FixedInt<1>(cmd_byte()))
1031 .step(bw::FixedInt<4>(v_.statement_id()))
1032 .step(bw::FixedInt<2>(v_.column_count()))
1033 .step(bw::FixedInt<2>(v_.param_count()))
1034 .step(bw::FixedInt<1>(0))
1035 .step(bw::FixedInt<2>(v_.warning_count()));
1038 accu.step(bw::FixedInt<1>(v_.with_metadata()));
1041 return accu.result();
1053 constexpr static uint8_t
cmd_byte() noexcept {
return 0x00; }
1059 namespace bw = borrowable::wire;
1061 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
1062 auto stmt_id_res = accu.template step<bw::FixedInt<4>>();
1063 auto column_count_res = accu.template step<bw::FixedInt<2>>();
1064 auto param_count_res = accu.template step<bw::FixedInt<2>>();
1065 auto filler_res = accu.template step<bw::FixedInt<1>>();
1066 auto warning_count_res = accu.template step<bw::FixedInt<2>>();
1069 int8_t with_metadata{1};
1071 auto with_metadata_res = accu.template step<bw::FixedInt<1>>();
1073 if (with_metadata_res) {
1074 with_metadata = with_metadata_res->value();
1080 return std::make_pair(
1082 value_type(stmt_id_res->value(), column_count_res->value(),
1083 param_count_res->value(), warning_count_res->value(),
1094template <
bool Borrowed>
1097 Codec<borrowable::message::server::Row<Borrowed>>> {
1098 template <
class Accumulator>
1100 namespace bw = borrowable::wire;
1102 for (
const auto &field : v_) {
1104 accu.step(bw::VarString<Borrowed>(*field));
1110 return accu.result();
1123 return std::numeric_limits<size_t>::max();
1130 namespace bw = borrowable::wire;
1132 std::vector<typename value_type::value_type> fields;
1138 auto null_res = accu.template try_step<bw::Null>();
1140 fields.emplace_back(std::nullopt);
1142 auto field_res = accu.template step<bw::VarString<Borrowed>>();
1145 fields.emplace_back(field_res->value());
1172template <
bool Borrowed>
1175 Codec<borrowable::message::server::StmtRow<Borrowed>>> {
1176 template <
class Accumulator>
1178 namespace bw = borrowable::wire;
1180 accu.step(bw::FixedInt<1>(0));
1184 uint8_t null_bit_byte{};
1186 for (
auto const &field : v_) {
1187 if (!field) null_bit_byte |= (1 << bit_pos);
1189 if (++bit_pos > 7) {
1190 accu.step(bw::FixedInt<1>(null_bit_byte));
1197 if (bit_pos != 0) accu.step(bw::FixedInt<1>(null_bit_byte));
1200 if (!field)
continue;
1202 switch (v_.types()[
n]) {
1222 accu.step(bw::FixedInt<1>(field->size()));
1238 return accu.result();
1242 using value_type = borrowable::message::server::StmtRow<Borrowed>;
1251 return std::numeric_limits<size_t>::max();
1256 std::vector<field_type::value_type> types) {
1257 namespace bw = borrowable::wire;
1261 const auto row_byte_res = accu.template step<bw::FixedInt<1>>();
1265 if (row_byte_res->value() != 0x00) {
1269 const auto nullbits_res =
1270 accu.template step<bw::String<Borrowed>>(
bytes_per_bits(types.size()));
1273 const auto nullbits = nullbits_res->value();
1275 std::vector<typename value_type::value_type> values;
1277 for (
size_t n{}, bit_pos{2}, byte_pos{};
n < types.size(); ++
n, ++bit_pos) {
1283 if (!(nullbits[byte_pos] & (1 << bit_pos))) {
1301 auto string_field_size_res = accu.template step<bw::VarInt>();
1305 field_size_res = string_field_size_res->
value();
1311 auto time_field_size_res = accu.template step<bw::FixedInt<1>>();
1315 field_size_res = time_field_size_res->
value();
1335 if (!field_size_res) {
1340 const auto value_res =
1341 accu.template step<bw::String<Borrowed>>(field_size_res.
value());
1344 values.push_back(value_res->value());
1346 values.emplace_back(std::nullopt);
1362template <
bool Borrowed>
1365 Codec<borrowable::message::server::Statistics<Borrowed>>> {
1366 template <
class Accumulator>
1368 namespace bw = borrowable::wire;
1370 return accu.step(bw::String<Borrowed>(v_.stats())).result();
1374 using value_type = borrowable::message::server::Statistics<Borrowed>;
1386 namespace bw = borrowable::wire;
1388 auto stats_res = accu.template step<bw::String<Borrowed>>();
1403template <
class Base,
class ValueType>
1406 template <
class Accumulator>
1408 namespace bw = borrowable::wire;
1410 return accu.step(bw::FixedInt<1>(Base::cmd_byte())).result();
1420 static constexpr size_t max_size() noexcept {
return 1; }
1426 namespace bw = borrowable::wire;
1428 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
1431 if (cmd_byte_res->value() != Base::cmd_byte()) {
1435 return std::make_pair(accu.
result().
value(), ValueType());
1480 borrowable::message::client::Quit> {
1498 Codec<borrowable::message::client::ResetConnection>,
1499 borrowable::message::client::ResetConnection> {
1517 borrowable::message::client::Ping> {
1535 borrowable::message::client::Statistics> {
1550template <
bool Borrowed>
1553 Codec<borrowable::message::client::InitSchema<Borrowed>>> {
1554 template <
class Accumulator>
1556 namespace bw = borrowable::wire;
1558 return accu.step(bw::FixedInt<1>(cmd_byte()))
1559 .step(bw::String<Borrowed>(v_.schema()))
1580 namespace bw = borrowable::wire;
1582 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
1585 if (cmd_byte_res->value() != cmd_byte()) {
1589 auto schema_res = accu.template step<bw::String<Borrowed>>();
1603template <
bool Borrowed>
1606 Codec<borrowable::message::client::Query<Borrowed>>> {
1607 template <
class Accumulator>
1609 namespace bw = borrowable::wire;
1611 accu.step(bw::FixedInt<1>(cmd_byte()));
1613 auto caps = this->caps();
1616 uint64_t param_count = v_.values().size();
1620 if (param_count > 0) {
1627 uint8_t null_bit_byte{};
1630 for (
auto const ¶m : v_.values()) {
1631 if (!param.value) null_bit_byte |= 1 << bit_pos;
1633 if (++bit_pos > 7) {
1634 accu.step(bw::FixedInt<1>(null_bit_byte));
1641 if (bit_pos != 0) accu.step(bw::FixedInt<1>(null_bit_byte));
1643 accu.step(bw::FixedInt<1>(1));
1645 for (
const auto ¶m : v_.values()) {
1646 accu.step(bw::FixedInt<2>(param.type_and_flags))
1647 .step(bw::VarString<Borrowed>(param.name));
1650 for (
const auto ¶m : v_.values()) {
1651 if (!param.value)
continue;
1653 auto type = param.type_and_flags & 0xff;
1669 accu.template step<bw::VarInt>(param.value->size());
1675 assert(param.value->size() <= 255);
1677 accu.template step<bw::FixedInt<1>>(param.value->size());
1682 assert(param.value->size() == 8);
1688 assert(param.value->size() == 4);
1693 assert(param.value->size() == 2);
1697 assert(param.value->size() == 1);
1701 assert(
true ||
"unknown field-type");
1704 accu.template step<bw::String<Borrowed>>(*param.value);
1709 accu.step(bw::String<Borrowed>(v_.statement()));
1710 return accu.result();
1713 template <
class Accu>
1715 Accu &accu, uint8_t
type) {
1716 namespace bw = borrowable::wire;
1733 auto string_field_size_res = accu.template step<bw::VarInt>();
1734 if (!accu.result()) {
1738 return string_field_size_res->value();
1744 auto time_field_size_res = accu.template step<bw::FixedInt<1>>();
1745 if (!accu.result()) {
1749 return time_field_size_res->value();
1785 namespace bw = borrowable::wire;
1787 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
1790 if (cmd_byte_res->value() != cmd_byte()) {
1794 std::vector<typename value_type::Param> params;
1797 auto param_count_res = accu.template step<bw::VarInt>();
1798 if (!param_count_res)
return param_count_res.get_unexpected();
1801 auto param_set_count_res = accu.template step<bw::VarInt>();
1802 if (!param_set_count_res)
return param_set_count_res.get_unexpected();
1804 if (param_set_count_res->value() != 1) {
1809 const auto param_count = param_count_res->value();
1810 if (param_count > 0) {
1812 const auto nullbits_res = accu.template step<bw::String<Borrowed>>(
1816 const auto nullbits = nullbits_res->value();
1819 auto new_params_bound_res = accu.template step<bw::FixedInt<1>>();
1822 auto new_params_bound = new_params_bound_res->value();
1823 if (new_params_bound != 1) {
1834 if (new_params_bound == 1) {
1835 for (
long n{};
n < param_count; ++
n) {
1836 auto param_type_res = accu.template step<bw::FixedInt<2>>();
1840 auto param_name_res = accu.template step<bw::VarString<Borrowed>>();
1845 params.emplace_back(param_type_res->value(),
1846 param_name_res->value(),
1847 std::optional<std::string>());
1851 for (
long n{}, nullbit_pos{}, nullbyte_pos{};
n < param_count;
1852 ++
n, ++nullbit_pos) {
1853 if (nullbit_pos > 7) {
1858 if (!(nullbits[nullbyte_pos] & (1 << nullbit_pos))) {
1859 auto ¶m = params[
n];
1861 auto field_size_res =
1862 decode_field_size(accu, param.type_and_flags & 0xff);
1863 if (!field_size_res) {
1867 auto param_value_res = accu.template step<bw::String<Borrowed>>(
1868 field_size_res.value());
1873 param.value = param_value_res->value();
1879 auto statement_res = accu.template step<bw::String<Borrowed>>();
1883 return std::make_pair(
1885 value_type(statement_res->value(), std::move(params)));
1901template <
bool Borrowed>
1904 Codec<borrowable::message::client::SendFile<Borrowed>>> {
1905 template <
class Accumulator>
1907 namespace bw = borrowable::wire;
1909 return accu.step(bw::String<Borrowed>(v_.payload())).result();
1925 namespace bw = borrowable::wire;
1927 auto payload_res = accu.template step<bw::String<Borrowed>>();
1941template <
bool Borrowed>
1944 Codec<borrowable::message::client::ListFields<Borrowed>>> {
1945 template <
class Accumulator>
1947 namespace bw = borrowable::wire;
1949 return accu.step(bw::FixedInt<1>(cmd_byte()))
1950 .step(bw::NulTermString<Borrowed>(v_.table_name()))
1951 .step(bw::String<Borrowed>(v_.wildcard()))
1972 namespace bw = borrowable::wire;
1974 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
1977 if (cmd_byte_res->value() != cmd_byte()) {
1981 auto table_name_res = accu.template step<bw::NulTermString<Borrowed>>();
1982 auto wildcard_res = accu.template step<bw::String<Borrowed>>();
1985 return std::make_pair(
1987 value_type(table_name_res->value(), wildcard_res->value()));
2000 template <
class Accumulator>
2002 namespace bw = borrowable::wire;
2004 return accu.step(bw::FixedInt<1>(cmd_byte()))
2005 .step(bw::FixedInt<1>(v_.cmds().to_ulong()))
2026 namespace bw = borrowable::wire;
2028 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2031 if (cmd_byte_res->value() != cmd_byte()) {
2035 auto cmds_res = accu.template step<bw::FixedInt<1>>();
2056 template <
class Accumulator>
2058 namespace bw = borrowable::wire;
2060 return accu.step(bw::FixedInt<1>(cmd_byte()))
2061 .step(bw::FixedInt<4>(v_.connection_id()))
2082 namespace bw = borrowable::wire;
2084 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2087 if (cmd_byte_res->value() != cmd_byte()) {
2091 auto connection_id_res = accu.template step<bw::FixedInt<4>>();
2105template <
bool Borrowed>
2108 Codec<borrowable::message::client::StmtPrepare<Borrowed>>> {
2109 template <
class Accumulator>
2111 namespace bw = borrowable::wire;
2113 return accu.step(bw::FixedInt<1>(cmd_byte()))
2114 .step(bw::String<Borrowed>(v_.statement()))
2135 namespace bw = borrowable::wire;
2137 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2140 if (cmd_byte_res->value() != cmd_byte()) {
2144 auto statement_res = accu.template step<bw::String<Borrowed>>();
2158template <
bool Borrowed>
2161 Codec<borrowable::message::client::StmtExecute<Borrowed>>> {
2162 template <
class Accumulator>
2164 namespace bw = borrowable::wire;
2166 auto caps = this->caps();
2168 accu.step(bw::FixedInt<1>(cmd_byte()))
2169 .step(bw::FixedInt<4>(v_.statement_id()))
2170 .step(bw::FixedInt<1>(v_.flags().to_ullong()))
2171 .step(bw::FixedInt<4>(v_.iteration_count()));
2174 auto num_params = v_.values().size();
2176 const bool supports_query_attributes =
2179 if (supports_query_attributes &&
2184 if (num_params == 0)
return accu.result();
2190 uint8_t null_bit_byte{};
2193 for (
auto const ¶m : v_.values()) {
2194 if (!param.has_value()) null_bit_byte |= 1 << bit_pos;
2196 if (++bit_pos > 7) {
2197 accu.step(bw::FixedInt<1>(null_bit_byte));
2204 if (bit_pos != 0) accu.step(bw::FixedInt<1>(null_bit_byte));
2206 accu.step(bw::FixedInt<1>(v_.new_params_bound()));
2208 if (v_.new_params_bound()) {
2209 for (
const auto ¶m_def : v_.types()) {
2210 accu.step(bw::FixedInt<2>(param_def.type_and_flags));
2212 if (supports_query_attributes) {
2220 if (!v.has_value())
continue;
2223 switch (v_.types()[
n].type_and_flags & 0xff) {
2243 accu.step(bw::FixedInt<1>(v->size()));
2256 assert(
false ||
"Unknown Type");
2261 return accu.result();
2320 template <
class Func>
2323 Func &&metadata_lookup) {
2326 namespace bw = borrowable::wire;
2328 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2331 if (cmd_byte_res->value() != cmd_byte()) {
2335 auto statement_id_res = accu.template step<bw::FixedInt<4>>();
2336 auto flags_res = accu.template step<bw::FixedInt<1>>();
2337 auto iteration_count_res = accu.template step<bw::FixedInt<4>>();
2343 const bool supports_query_attributes =
2347 metadata_res = metadata_lookup(statement_id_res->value());
2348 if (!metadata_res) {
2353 size_t param_count = metadata_res->size();
2355 if (supports_query_attributes &&
2357 auto param_count_res = accu.template step<bw::VarInt>();
2362 if (
static_cast<uint64_t
>(param_count_res->value()) < param_count) {
2368 param_count = param_count_res->value();
2371 if (param_count == 0) {
2372 return std::make_pair(
2374 value_type(statement_id_res->value(), flags_res->value(),
2375 iteration_count_res->value(),
false, {}, {}));
2379 accu.template step<bw::String<Borrowed>>(
bytes_per_bits(param_count));
2382 auto new_params_bound_res = accu.template step<bw::FixedInt<1>>();
2385 std::vector<typename value_type::ParamDef> types;
2387 auto new_params_bound = new_params_bound_res->value();
2388 if (new_params_bound == 0) {
2390 types = *metadata_res;
2391 }
else if (new_params_bound == 1) {
2399 types.reserve(param_count);
2401 for (
size_t n{};
n < param_count; ++
n) {
2402 auto type_res = accu.template step<bw::FixedInt<2>>();
2405 if (supports_query_attributes) {
2406 auto name_res = accu.template step<bw::VarString<Borrowed>>();
2410 types.emplace_back(type_res->value(), name_res->value());
2412 types.emplace_back(type_res->value());
2419 if (param_count != types.size()) {
2424 std::vector<std::optional<typename value_type::string_type>> values;
2425 values.reserve(param_count);
2427 const auto nullbits = nullbits_res->value();
2428 for (
size_t n{}, bit_pos{}, byte_pos{};
n < param_count; ++
n, ++bit_pos) {
2434 if (!(nullbits[byte_pos] & (1 << bit_pos))) {
2438 switch (types[
n].type_and_flags & 0xff) {
2452 auto string_field_size_res = accu.template step<bw::VarInt>();
2456 field_size_res = string_field_size_res->
value();
2462 auto time_field_size_res = accu.template step<bw::FixedInt<1>>();
2466 field_size_res = time_field_size_res->
value();
2486 if (!field_size_res) {
2492 accu.template step<bw::String<Borrowed>>(field_size_res.
value());
2497 values.push_back(value_res->value());
2500 values.emplace_back(std::nullopt);
2506 return std::make_pair(
2508 value_type(statement_id_res->value(), flags_res->value(),
2509 iteration_count_res->value(), new_params_bound_res->value(),
2520template <
bool Borrowed>
2523 Codec<borrowable::message::client::StmtParamAppendData<Borrowed>>> {
2524 template <
class Accumulator>
2526 namespace bw = borrowable::wire;
2528 return accu.step(bw::FixedInt<1>(cmd_byte()))
2529 .step(bw::FixedInt<4>(v_.statement_id()))
2530 .step(bw::FixedInt<2>(v_.param_id()))
2531 .step(bw::String<Borrowed>(v_.data()))
2552 namespace bw = borrowable::wire;
2554 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2557 if (cmd_byte_res->value() != cmd_byte()) {
2561 auto statement_id_res = accu.template step<bw::FixedInt<4>>();
2562 auto param_id_res = accu.template step<bw::FixedInt<2>>();
2563 auto data_res = accu.template step<bw::String<Borrowed>>();
2568 param_id_res->value(), data_res->value()));
2581 template <
class Accumulator>
2583 namespace bw = borrowable::wire;
2585 return accu.step(bw::FixedInt<1>(cmd_byte()))
2586 .step(bw::FixedInt<4>(v_.statement_id()))
2607 namespace bw = borrowable::wire;
2609 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2612 if (cmd_byte_res->value() != cmd_byte()) {
2616 auto statement_id_res = accu.template step<bw::FixedInt<4>>();
2633 template <
class Accumulator>
2635 namespace bw = borrowable::wire;
2637 return accu.step(bw::FixedInt<1>(cmd_byte()))
2638 .step(bw::FixedInt<4>(v_.statement_id()))
2659 namespace bw = borrowable::wire;
2661 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2664 if (cmd_byte_res->value() != cmd_byte()) {
2668 auto statement_id_res = accu.template step<bw::FixedInt<4>>();
2685 template <
class Accumulator>
2687 namespace bw = borrowable::wire;
2689 return accu.step(bw::FixedInt<1>(cmd_byte()))
2690 .step(bw::FixedInt<2>(v_.option()))
2711 namespace bw = borrowable::wire;
2713 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2716 if (cmd_byte_res->value() != cmd_byte()) {
2720 auto option_res = accu.template step<bw::FixedInt<2>>();
2737 template <
class Accumulator>
2739 namespace bw = borrowable::wire;
2741 return accu.step(bw::FixedInt<1>(cmd_byte()))
2742 .step(bw::FixedInt<4>(v_.statement_id()))
2743 .step(bw::FixedInt<4>(v_.row_count()))
2764 namespace bw = borrowable::wire;
2766 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
2769 if (cmd_byte_res->value() != cmd_byte()) {
2773 auto statement_id_res = accu.template step<bw::FixedInt<4>>();
2774 auto row_count_res = accu.template step<bw::FixedInt<4>>();
2777 return std::make_pair(
2779 value_type(statement_id_res->value(), row_count_res->value()));
2825template <
bool Borrowed>
2828 Codec<borrowable::message::client::Greeting<Borrowed>>> {
2829 template <
class Accumulator>
2831 namespace bw = borrowable::wire;
2833 const auto shared_caps = v_.capabilities() & this->caps();
2836 accu.step(bw::FixedInt<4>(v_.capabilities().to_ulong()))
2837 .step(bw::FixedInt<4>(v_.max_packet_size()))
2838 .step(bw::FixedInt<1>(v_.collation()))
2839 .step(bw::String<Borrowed>(std::string(23,
'\0')));
2841 v_.username().empty())) {
2844 accu.step(bw::NulTermString<Borrowed>(v_.username()));
2848 accu.step(bw::VarString<Borrowed>(v_.auth_method_data()));
2851 accu.step(bw::FixedInt<1>(v_.auth_method_data().size()))
2852 .step(bw::String<Borrowed>(v_.auth_method_data()));
2854 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_data()));
2859 accu.step(bw::NulTermString<Borrowed>(v_.schema()));
2871 !v_.auth_method_name().empty()) {
2872 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_name()));
2876 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_name()));
2879 accu.step(bw::VarString<Borrowed>(v_.attributes()));
2883 accu.step(bw::FixedInt<2>(v_.capabilities().to_ulong()))
2884 .step(bw::FixedInt<3>(v_.max_packet_size()))
2885 .step(bw::NulTermString<Borrowed>(v_.username()));
2888 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_data()))
2889 .step(bw::String<Borrowed>(v_.schema()));
2891 accu.step(bw::String<Borrowed>(v_.auth_method_data()));
2895 return accu.result();
2911 namespace bw = borrowable::wire;
2913 auto capabilities_lo_res = accu.template step<bw::FixedInt<2>>();
2914 if (!capabilities_lo_res)
2918 capabilities_lo_res->value());
2922 auto shared_capabilities = caps & client_capabilities;
2927 auto capabilities_hi_res = accu.template step<bw::FixedInt<2>>();
2928 if (!capabilities_hi_res)
2932 capabilities_hi_res->value() << 16);
2934 shared_capabilities = caps & client_capabilities;
2936 auto max_packet_size_res = accu.template step<bw::FixedInt<4>>();
2937 auto collation_res = accu.template step<bw::FixedInt<1>>();
2939 accu.template step<bw::String<Borrowed>>(23);
2941 auto last_accu_res = accu.
result();
2943 auto username_res = accu.template step<bw::NulTermString<Borrowed>>();
2947 if (last_accu_res &&
2949 return std::make_pair(
2950 last_accu_res.value(),
2951 value_type(client_capabilities, max_packet_size_res->value(),
2952 collation_res->value(), {}, {}, {}, {}, {}));
2964 auth_method_data_res;
2967 auto res = accu.template step<bw::VarString<Borrowed>>();
2970 auth_method_data_res = bw::String<Borrowed>(res->value());
2971 }
else if (shared_capabilities
2973 auto auth_method_data_len_res = accu.template step<bw::FixedInt<1>>();
2974 if (!auth_method_data_len_res)
2976 auto auth_method_data_len = auth_method_data_len_res->value();
2979 accu.template step<bw::String<Borrowed>>(auth_method_data_len);
2982 auth_method_data_res = bw::String<Borrowed>(res->value());
2984 auto res = accu.template step<bw::NulTermString<Borrowed>>();
2987 auth_method_data_res = bw::String<Borrowed>(res->value());
2991 if (shared_capabilities
2993 schema_res = accu.template step<bw::NulTermString<Borrowed>>();
2999 if (shared_capabilities
3004 auth_method_res = bw::NulTermString<Borrowed>{};
3006 auth_method_res = accu.template step<bw::NulTermString<Borrowed>>();
3009 if (!auth_method_res)
3013 if (shared_capabilities
3015 attributes_res = accu.template step<bw::VarString<Borrowed>>();
3020 return std::make_pair(
3022 value_type(client_capabilities, max_packet_size_res->value(),
3023 collation_res->value(), username_res->value(),
3024 auth_method_data_res->
value(), schema_res->
value(),
3025 auth_method_res->
value(), attributes_res->
value()));
3028 auto max_packet_size_res = accu.template step<bw::FixedInt<3>>();
3030 auto username_res = accu.template step<bw::NulTermString<Borrowed>>();
3033 auth_method_data_res;
3036 if (shared_capabilities
3038 auto res = accu.template step<bw::NulTermString<Borrowed>>();
3042 auth_method_data_res = bw::String<Borrowed>(res->value());
3044 schema_res = accu.template step<bw::String<Borrowed>>();
3046 auth_method_data_res = accu.template step<bw::String<Borrowed>>();
3069 return std::make_pair(
3071 value_type(client_capabilities, max_packet_size_res->value(), 0x00,
3072 username_res->value(), auth_method_data_res->value(),
3073 schema_res->
value(), {}, {}));
3090template <
bool Borrowed>
3093 Codec<borrowable::message::client::AuthMethodData<Borrowed>>> {
3094 template <
class Accumulator>
3096 namespace bw = borrowable::wire;
3098 return accu.step(bw::String<Borrowed>(v_.auth_method_data())).result();
3114 namespace bw = borrowable::wire;
3116 auto auth_method_data_res = accu.template step<bw::String<Borrowed>>();
3137template <
bool Borrowed>
3140 Codec<borrowable::message::client::ChangeUser<Borrowed>>> {
3141 template <
class Accumulator>
3143 namespace bw = borrowable::wire;
3145 accu.step(bw::FixedInt<1>(cmd_byte()))
3146 .step(bw::NulTermString<Borrowed>(v_.username()));
3149 accu.step(bw::FixedInt<1>(v_.auth_method_data().size()))
3150 .step(bw::String<Borrowed>(v_.auth_method_data()));
3152 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_data()));
3154 accu.step(bw::NulTermString<Borrowed>(v_.schema()));
3160 if (v_.collation() != 0x00 ||
3163 accu.step(bw::FixedInt<2>(v_.collation()));
3165 accu.step(bw::NulTermString<Borrowed>(v_.auth_method_name()));
3170 accu.step(bw::VarString<Borrowed>(v_.attributes()));
3174 return accu.result();
3194 namespace bw = borrowable::wire;
3196 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
3199 if (cmd_byte_res->value() != cmd_byte()) {
3202 auto username_res = accu.template step<bw::NulTermString<Borrowed>>();
3210 auto auth_method_data_len_res = accu.template step<bw::FixedInt<1>>();
3211 if (!auth_method_data_len_res)
3213 auto auth_method_data_len = auth_method_data_len_res->value();
3215 auto res = accu.template step<bw::String<Borrowed>>(auth_method_data_len);
3218 auth_method_data_res = bw::String<Borrowed>(res->value());
3220 auto res = accu.template step<bw::NulTermString<Borrowed>>();
3223 auth_method_data_res = bw::String<Borrowed>(res->value());
3226 auto schema_res = accu.template step<bw::NulTermString<Borrowed>>();
3232 return std::make_pair(
3234 value_type(username_res->value(), auth_method_data_res->value(),
3235 schema_res->value(), 0x00, {}, {}));
3239 auto collation_res = accu.template step<bw::FixedInt<2>>();
3242 auth_method_name_res;
3244 auth_method_name_res = accu.template step<bw::NulTermString<Borrowed>>();
3249 attributes_res = accu.template step<bw::VarString<Borrowed>>();
3254 return std::make_pair(
3256 value_type(username_res->value(), auth_method_data_res->value(),
3257 schema_res->value(), collation_res->value(),
3258 auth_method_name_res->value(), attributes_res->
value()));
3273 borrowable::message::client::Clone> {
3288template <
bool Borrowed>
3291 Codec<borrowable::message::client::BinlogDump<Borrowed>>> {
3296 template <
class Accumulator>
3298 namespace bw = borrowable::wire;
3300 return accu.step(bw::FixedInt<1>(cmd_byte()))
3301 .step(bw::FixedInt<4>(v_.position()))
3302 .step(bw::FixedInt<2>(v_.flags().underlying_value()))
3303 .step(bw::FixedInt<4>(v_.server_id()))
3304 .step(bw::String<Borrowed>(v_.filename()))
3324 namespace bw = borrowable::wire;
3326 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
3329 if (cmd_byte_res->value() != cmd_byte()) {
3332 auto position_res = accu.template step<bw::FixedInt<4>>();
3333 auto flags_res = accu.template step<bw::FixedInt<2>>();
3334 auto server_id_res = accu.template step<bw::FixedInt<4>>();
3336 auto filename_res = accu.template step<bw::String<Borrowed>>();
3341 flags.underlying_value(flags_res->value());
3343 return std::make_pair(
3346 position_res->value()));
3356template <
bool Borrowed>
3359 Codec<borrowable::message::client::RegisterReplica<Borrowed>>> {
3364 template <
class Accumulator>
3366 namespace bw = borrowable::wire;
3368 return accu.step(bw::FixedInt<1>(cmd_byte()))
3369 .step(bw::FixedInt<4>(v_.server_id()))
3370 .step(bw::FixedInt<1>(v_.hostname().size()))
3371 .step(bw::String<Borrowed>(v_.hostname()))
3372 .step(bw::FixedInt<1>(v_.username().size()))
3373 .step(bw::String<Borrowed>(v_.username()))
3374 .step(bw::FixedInt<1>(v_.password().size()))
3375 .step(bw::String<Borrowed>(v_.password()))
3376 .step(bw::FixedInt<2>(v_.port()))
3377 .step(bw::FixedInt<4>(v_.replication_rank()))
3378 .step(bw::FixedInt<4>(v_.master_id()))
3398 namespace bw = borrowable::wire;
3400 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
3403 if (cmd_byte_res->value() != cmd_byte()) {
3406 auto server_id_res = accu.template step<bw::FixedInt<4>>();
3407 auto hostname_len_res = accu.template step<bw::FixedInt<1>>();
3411 accu.template step<bw::String<Borrowed>>(hostname_len_res->value());
3413 auto username_len_res = accu.template step<bw::FixedInt<1>>();
3417 accu.template step<bw::String<Borrowed>>(username_len_res->value());
3419 auto password_len_res = accu.template step<bw::FixedInt<1>>();
3423 accu.template step<bw::String<Borrowed>>(password_len_res->value());
3425 auto port_res = accu.template step<bw::FixedInt<2>>();
3426 auto replication_rank_res = accu.template step<bw::FixedInt<4>>();
3427 auto master_id_res = accu.template step<bw::FixedInt<4>>();
3431 return std::make_pair(
3433 value_type(server_id_res->value(), hostname_res->value(),
3434 username_res->value(), password_res->value(),
3435 port_res->value(), replication_rank_res->value(),
3436 master_id_res->value()));
3446template <
bool Borrowed>
3449 Codec<borrowable::message::client::BinlogDumpGtid<Borrowed>>> {
3454 template <
class Accumulator>
3456 namespace bw = borrowable::wire;
3458 accu.step(bw::FixedInt<1>(cmd_byte()))
3459 .step(bw::FixedInt<2>(v_.flags().underlying_value()))
3460 .step(bw::FixedInt<4>(v_.server_id()))
3461 .step(bw::FixedInt<4>(v_.filename().size()))
3462 .step(bw::String<Borrowed>(v_.filename()))
3463 .step(bw::FixedInt<8>(v_.position()));
3465 if (v_.flags() & value_type::Flags::through_gtid) {
3466 accu.step(bw::FixedInt<4>(v_.sids().size()))
3467 .step(bw::String<Borrowed>(v_.sids()));
3470 return accu.result();
3479 :
base_(caps), v_{
std::move(val)} {}
3489 namespace bw = borrowable::wire;
3491 auto cmd_byte_res = accu.template step<bw::FixedInt<1>>();
3494 if (cmd_byte_res->value() != cmd_byte()) {
3497 auto flags_res = accu.template step<bw::FixedInt<2>>();
3498 auto server_id_res = accu.template step<bw::FixedInt<4>>();
3499 auto filename_len_res = accu.template step<bw::FixedInt<4>>();
3503 accu.template step<bw::String<Borrowed>>(filename_len_res->value());
3504 auto position_res = accu.template step<bw::FixedInt<8>>();
3507 flags.underlying_value(flags_res->value());
3509 if (!(
flags & value_type::Flags::through_gtid)) {
3512 return std::make_pair(
3515 position_res->value(), {}));
3518 auto sids_len_res = accu.template step<bw::FixedInt<4>>();
3522 accu.template step<bw::String<Borrowed>>(sids_len_res->value());
3526 return std::make_pair(
3529 position_res->value(), sids_res->value()));
CRTP base for client-side commands that are encoded as a single byte.
Definition: classic_protocol_codec_message.h:1405
constexpr CodecSimpleCommand(capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1418
friend __base
Definition: classic_protocol_codec_message.h:1416
static constexpr size_t max_size() noexcept
Definition: classic_protocol_codec_message.h:1420
static stdx::expected< std::pair< size_t, ValueType >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1422
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1407
const value_type v_
Definition: classic_protocol_codec_message.h:3125
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3110
friend __base
Definition: classic_protocol_codec_message.h:3105
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:3095
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3107
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:3481
const value_type v_
Definition: classic_protocol_codec_message.h:3533
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3485
constexpr Codec(value_type val, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3478
friend base_
Definition: classic_protocol_codec_message.h:3476
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:3455
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3313
friend __base
Definition: classic_protocol_codec_message.h:3311
const value_type v_
Definition: classic_protocol_codec_message.h:3350
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3320
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:3297
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:3316
const value_type v_
Definition: classic_protocol_codec_message.h:3262
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:3186
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3190
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3183
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:3142
friend __base
Definition: classic_protocol_codec_message.h:3181
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:3280
constexpr Codec(value_type, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3278
friend __base
Definition: classic_protocol_codec_message.h:2902
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2907
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2904
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2830
const value_type v_
Definition: classic_protocol_codec_message.h:3078
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1576
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1555
const value_type v_
Definition: classic_protocol_codec_message.h:1597
friend __base
Definition: classic_protocol_codec_message.h:1567
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1569
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1572
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2057
value_type v_
Definition: classic_protocol_codec_message.h:2099
friend __base
Definition: classic_protocol_codec_message.h:2069
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2078
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2074
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2071
const value_type v_
Definition: classic_protocol_codec_message.h:1991
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1961
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1964
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1946
friend __base
Definition: classic_protocol_codec_message.h:1959
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1968
constexpr Codec(value_type, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1522
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1524
const value_type v_
Definition: classic_protocol_codec_message.h:1889
friend __base
Definition: classic_protocol_codec_message.h:1772
auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1608
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1781
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1777
static stdx::expected< size_t, std::error_code > decode_field_size(Accu &accu, uint8_t type)
Definition: classic_protocol_codec_message.h:1714
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1774
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1487
constexpr Codec(value_type, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1485
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:3365
const value_type v_
Definition: classic_protocol_codec_message.h:3440
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:3390
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3387
friend __base
Definition: classic_protocol_codec_message.h:3385
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:3394
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2001
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2018
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2015
friend __base
Definition: classic_protocol_codec_message.h:2013
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2022
const value_type v_
Definition: classic_protocol_codec_message.h:2042
constexpr Codec(value_type, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1504
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1506
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1921
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1906
friend __base
Definition: classic_protocol_codec_message.h:1916
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1918
const value_type v_
Definition: classic_protocol_codec_message.h:1935
const value_type v_
Definition: classic_protocol_codec_message.h:2728
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2707
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2700
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2686
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2703
friend __base
Definition: classic_protocol_codec_message.h:2698
constexpr Codec(value_type, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1540
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1542
friend __base
Definition: classic_protocol_codec_message.h:2594
const value_type v_
Definition: classic_protocol_codec_message.h:2624
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2599
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2582
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2603
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2596
friend __base
Definition: classic_protocol_codec_message.h:2268
const value_type v_
Definition: classic_protocol_codec_message.h:2514
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps, Func &&metadata_lookup)
decode a buffer into a message::client::StmtExecute.
Definition: classic_protocol_codec_message.h:2321
auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2163
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2273
constexpr Codec(value_type val, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2270
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2760
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2756
const value_type v_
Definition: classic_protocol_codec_message.h:2783
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2738
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2753
friend __base
Definition: classic_protocol_codec_message.h:2751
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2541
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2544
friend __base
Definition: classic_protocol_codec_message.h:2539
const value_type v_
Definition: classic_protocol_codec_message.h:2572
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2548
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2525
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2127
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2131
const value_type v_
Definition: classic_protocol_codec_message.h:2152
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2124
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2110
friend __base
Definition: classic_protocol_codec_message.h:2122
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:2651
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2655
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:2634
friend __base
Definition: classic_protocol_codec_message.h:2646
const value_type v_
Definition: classic_protocol_codec_message.h:2676
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:2648
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:326
const value_type v_
Definition: classic_protocol_codec_message.h:352
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:312
borrowable::message::server::AuthMethodData< Borrowed > value_type
Definition: classic_protocol_codec_message.h:321
static constexpr uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:329
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:331
friend __base
Definition: classic_protocol_codec_message.h:324
friend __base
Definition: classic_protocol_codec_message.h:265
borrowable::message::server::AuthMethodSwitch< Borrowed > value_type
Definition: classic_protocol_codec_message.h:262
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:267
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:248
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:272
static constexpr uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:270
const value_type v_
Definition: classic_protocol_codec_message.h:301
borrowable::message::server::ColumnCount value_type
Definition: classic_protocol_codec_message.h:746
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:751
friend __base
Definition: classic_protocol_codec_message.h:749
const value_type v_
Definition: classic_protocol_codec_message.h:772
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:739
static constexpr size_t max_size() noexcept
Definition: classic_protocol_codec_message.h:754
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:758
borrowable::message::server::Eof< Borrowed > value_type
Definition: classic_protocol_codec_message.h:540
const value_type v_
Definition: classic_protocol_codec_message.h:638
friend __base
Definition: classic_protocol_codec_message.h:543
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:545
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:498
static constexpr uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:548
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
decode a server::Eof message from a buffer-sequence.
Definition: classic_protocol_codec_message.h:569
friend __base
Definition: classic_protocol_codec_message.h:687
static constexpr uint8_t cmd_byte()
Definition: classic_protocol_codec_message.h:692
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:689
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:698
borrowable::message::server::Error< Borrowed > value_type
Definition: classic_protocol_codec_message.h:684
const value_type v_
Definition: classic_protocol_codec_message.h:729
static constexpr size_t max_size() noexcept
Definition: classic_protocol_codec_message.h:694
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:670
const value_type v_
Definition: classic_protocol_codec_message.h:237
friend __base
Definition: classic_protocol_codec_message.h:132
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:134
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:137
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:86
borrowable::message::server::Greeting< Borrowed > value_type
Definition: classic_protocol_codec_message.h:129
const value_type v_
Definition: classic_protocol_codec_message.h:472
borrowable::message::server::Ok< Borrowed > value_type
Definition: classic_protocol_codec_message.h:391
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:363
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:396
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
decode a server::Ok message from a buffer-sequence.
Definition: classic_protocol_codec_message.h:416
friend __base
Definition: classic_protocol_codec_message.h:394
static constexpr uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:399
static size_t max_size() noexcept
Definition: classic_protocol_codec_message.h:1122
Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1119
const value_type v_
Definition: classic_protocol_codec_message.h:1155
auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1099
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1126
borrowable::message::server::Row< Borrowed > value_type
Definition: classic_protocol_codec_message.h:1114
friend __base
Definition: classic_protocol_codec_message.h:1117
const value_type v_
Definition: classic_protocol_codec_message.h:1001
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:975
friend __base
Definition: classic_protocol_codec_message.h:973
borrowable::message::server::SendFileRequest< Borrowed > value_type
Definition: classic_protocol_codec_message.h:970
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:980
static constexpr uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:978
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:961
const value_type v_
Definition: classic_protocol_codec_message.h:1397
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1379
borrowable::message::server::Statistics< Borrowed > value_type
Definition: classic_protocol_codec_message.h:1374
friend __base
Definition: classic_protocol_codec_message.h:1377
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1382
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1367
constexpr static uint8_t cmd_byte() noexcept
Definition: classic_protocol_codec_message.h:1053
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1055
friend __base
Definition: classic_protocol_codec_message.h:1048
constexpr Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1050
borrowable::message::server::StmtPrepareOk value_type
Definition: classic_protocol_codec_message.h:1045
constexpr auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1027
const value_type v_
Definition: classic_protocol_codec_message.h:1088
const value_type v_
Definition: classic_protocol_codec_message.h:1356
Codec(value_type v, capabilities::value_type caps)
Definition: classic_protocol_codec_message.h:1247
borrowable::message::server::StmtRow< Borrowed > value_type
Definition: classic_protocol_codec_message.h:1242
static stdx::expected< std::pair< size_t, value_type >, std::error_code > decode(const net::const_buffer &buffer, capabilities::value_type caps, std::vector< field_type::value_type > types)
Definition: classic_protocol_codec_message.h:1254
static size_t max_size() noexcept
Definition: classic_protocol_codec_message.h:1250
auto accumulate_fields(Accumulator &&accu) const
Definition: classic_protocol_codec_message.h:1177
friend __base
Definition: classic_protocol_codec_message.h:1245
Codec for a type.
Definition: classic_protocol_codec_base.h:72
Definition: classic_protocol_message.h:1261
Definition: classic_protocol_message.h:1323
Definition: classic_protocol_message.h:1295
Definition: classic_protocol_message.h:888
Definition: classic_protocol_message.h:1292
Definition: classic_protocol_message.h:684
Definition: classic_protocol_message.h:863
Definition: classic_protocol_message.h:976
Definition: classic_protocol_message.h:826
Definition: classic_protocol_message.h:1256
Definition: classic_protocol_message.h:786
Definition: classic_protocol_message.h:1251
Definition: classic_protocol_message.h:1355
Definition: classic_protocol_message.h:954
Definition: classic_protocol_message.h:941
Definition: classic_protocol_message.h:996
set options on the current connection.
Definition: classic_protocol_message.h:1231
Definition: classic_protocol_message.h:948
close a prepared statement.
Definition: classic_protocol_message.h:1161
execute a prepared statement.
Definition: classic_protocol_message.h:1090
fetch rows from an executed statement.
Definition: classic_protocol_message.h:1205
append data to a parameter of a prepared statement.
Definition: classic_protocol_message.h:1049
Definition: classic_protocol_message.h:1021
reset a prepared statement.
Definition: classic_protocol_message.h:1183
Definition: classic_protocol_wire.h:38
Definition: classic_protocol_wire.h:65
Generator of decoded Types of a buffer.
Definition: classic_protocol_codec_base.h:153
result_type result() const
get result of the step().
Definition: classic_protocol_codec_base.h:219
CRTP base for the Codec's encode part.
Definition: classic_protocol_codec_base.h:375
constexpr capabilities::value_type caps() const noexcept
Definition: classic_protocol_codec_base.h:390
size_t size() const noexcept
Definition: buffer.h:120
constexpr const value_type & value() const &
Definition: expected.h:688
constexpr unexpected_type get_unexpected() const
Definition: expected.h:754
constexpr const error_type & error() const &
Definition: expected.h:737
Definition: expected.h:944
a type-safe flags type.
Definition: flags.h:115
constexpr DWORD buf_size
Definition: create_def.cc:228
static int flags[50]
Definition: hp_test1.cc:40
borrowable::binary::Null Null
Definition: classic_protocol_binary.h:337
borrowable::wire::VarInt VarInt
Definition: classic_protocol_wire.h:148
Definition: classic_protocol_constants.h:36
constexpr value_type text_result_with_session_tracking
Definition: classic_protocol_constants.h:62
constexpr value_type long_flag
Definition: classic_protocol_constants.h:40
constexpr value_type transactions
Definition: classic_protocol_constants.h:51
constexpr value_type plugin_auth
Definition: classic_protocol_constants.h:57
constexpr value_type session_track
Definition: classic_protocol_constants.h:61
constexpr value_type optional_resultset_metadata
Definition: classic_protocol_constants.h:63
constexpr value_type query_attributes
Definition: classic_protocol_constants.h:65
constexpr value_type connect_attributes
Definition: classic_protocol_constants.h:58
constexpr value_type client_auth_method_data_varint
Definition: classic_protocol_constants.h:59
constexpr value_type ssl
Definition: classic_protocol_constants.h:49
constexpr value_type connect_with_schema
Definition: classic_protocol_constants.h:41
constexpr value_type secure_connection
Definition: classic_protocol_constants.h:53
constexpr value_type protocol_41
Definition: classic_protocol_constants.h:47
std::bitset< 32 > value_type
Definition: classic_protocol_constants.h:73
constexpr value_type param_count_available
Definition: classic_protocol_constants.h:216
constexpr value_type Short
Definition: classic_protocol_constants.h:233
constexpr value_type DateTime
Definition: classic_protocol_constants.h:243
constexpr value_type LongLong
Definition: classic_protocol_constants.h:239
constexpr value_type Varchar
Definition: classic_protocol_constants.h:246
constexpr value_type NewDecimal
Definition: classic_protocol_constants.h:253
constexpr value_type Time
Definition: classic_protocol_constants.h:242
constexpr value_type Decimal
Definition: classic_protocol_constants.h:231
constexpr value_type VarString
Definition: classic_protocol_constants.h:260
constexpr value_type MediumBlob
Definition: classic_protocol_constants.h:257
constexpr value_type String
Definition: classic_protocol_constants.h:261
constexpr value_type Set
Definition: classic_protocol_constants.h:255
constexpr value_type Geometry
Definition: classic_protocol_constants.h:262
constexpr value_type Bit
Definition: classic_protocol_constants.h:247
constexpr value_type Tiny
Definition: classic_protocol_constants.h:232
constexpr value_type TinyBlob
Definition: classic_protocol_constants.h:256
constexpr value_type Json
Definition: classic_protocol_constants.h:252
constexpr value_type Int24
Definition: classic_protocol_constants.h:240
constexpr value_type Enum
Definition: classic_protocol_constants.h:254
constexpr value_type Long
Definition: classic_protocol_constants.h:234
constexpr value_type Double
Definition: classic_protocol_constants.h:236
constexpr value_type Year
Definition: classic_protocol_constants.h:244
constexpr value_type Timestamp
Definition: classic_protocol_constants.h:238
constexpr value_type LongBlob
Definition: classic_protocol_constants.h:258
constexpr value_type Blob
Definition: classic_protocol_constants.h:259
constexpr value_type Date
Definition: classic_protocol_constants.h:241
constexpr value_type Float
Definition: classic_protocol_constants.h:235
borrowable::message::client::StmtFetch StmtFetch
Definition: classic_protocol_message.h:1433
borrowable::message::client::StmtReset StmtReset
Definition: classic_protocol_message.h:1428
borrowable::message::client::Reload Reload
Definition: classic_protocol_message.h:1423
borrowable::message::client::SetOption SetOption
Definition: classic_protocol_message.h:1432
borrowable::message::client::Kill Kill
Definition: classic_protocol_message.h:1421
borrowable::message::client::StmtClose StmtClose
Definition: classic_protocol_message.h:1429
borrowable::message::server::AuthMethodSwitch< false > AuthMethodSwitch
Definition: classic_protocol_message.h:1404
borrowable::message::server::Error< false > Error
Definition: classic_protocol_message.h:1399
borrowable::message::server::StmtPrepareOk StmtPrepareOk
Definition: classic_protocol_message.h:1409
borrowable::message::server::Greeting< false > Greeting
Definition: classic_protocol_message.h:1401
borrowable::message::server::Row< false > Row
Definition: classic_protocol_message.h:1407
borrowable::message::server::Eof< false > Eof
Definition: classic_protocol_message.h:1400
borrowable::message::server::ColumnCount ColumnCount
Definition: classic_protocol_message.h:1402
borrowable::message::server::Ok< false > Ok
Definition: classic_protocol_message.h:1398
borrowable::message::server::AuthMethodData< false > AuthMethodData
Definition: classic_protocol_message.h:1405
borrowable::message::server::Statistics< false > Statistics
Definition: classic_protocol_message.h:1410
borrowable::message::server::StmtRow< false > StmtRow
Definition: classic_protocol_message.h:1408
borrowable::message::server::SendFileRequest< false > SendFileRequest
Definition: classic_protocol_message.h:1406
borrowable::message::server::ColumnMeta< false > ColumnMeta
Definition: classic_protocol_message.h:1403
constexpr value_type session_state_changed
Definition: classic_protocol_constants.h:165
constexpr value_type session_state_changed
Definition: classic_protocol_constants.h:207
Definition: classic_protocol_binary.h:39
std::error_code make_error_code(codec_errc e) noexcept
Definition: classic_protocol_codec_error.h:86
CommandByte
Definition: classic_protocol_codec_message.h:1439
constexpr size_t bytes_per_bits(size_t bits)
Definition: classic_protocol_codec_base.h:55
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
size_t buffer_size(const ConstBufferSequence &buffers) noexcept
Definition: buffer.h:315
Definition: gcs_xcom_synode.h:64
constexpr auto enumerate(T &&iterable)
Definition: ranges.h:142
constexpr auto make_unexpected(E &&e) -> unexpected< std::decay_t< E > >
Definition: expected.h:125
required string type
Definition: replication_group_member_actions.proto:34
int n
Definition: xcom_base.cc:509