diff --git a/src/Core/MySQL/MySQLGtid.cpp b/src/Core/MySQL/MySQLGtid.cpp index 86cb368760d..a10f8ceed0c 100644 --- a/src/Core/MySQL/MySQLGtid.cpp +++ b/src/Core/MySQL/MySQLGtid.cpp @@ -36,7 +36,7 @@ void GTIDSets::parse(const String gtid_format) boost::split(server_ids, gset, [](char c) { return c == ':'; }); GTIDSet set; - set.uuid = stringToUUID(server_ids[0].data()); + set.uuid = stringToUUID(server_ids[0]); for (size_t k = 1; k < server_ids.size(); k++) { diff --git a/src/Core/MySQL/PacketsReplication.cpp b/src/Core/MySQL/PacketsReplication.cpp index 69ba45066b7..ec5e8868cc5 100644 --- a/src/Core/MySQL/PacketsReplication.cpp +++ b/src/Core/MySQL/PacketsReplication.cpp @@ -37,11 +37,11 @@ void RegisterSlave::writePayloadImpl(WriteBuffer & buffer) const } BinlogDumpGTID::BinlogDumpGTID(UInt32 server_id_, String gtid_datas_) - : flags(0x04), server_id(server_id_), binlog_file_name(""), gtid_datas(std::move(gtid_datas_)) + : flags(0x04), server_id(server_id_), gtid_datas(std::move(gtid_datas_)) { } -size_t BinlogDumpGTID::getPayloadSize() const { return 1 + 2 + 4 + 4 + binlog_file_name.size() + 8 + 4 + gtid_datas.size(); } +size_t BinlogDumpGTID::getPayloadSize() const { return 1 + 2 + 4 + 4 + 0 + 8 + 4 + gtid_datas.size(); } void BinlogDumpGTID::writePayloadImpl(WriteBuffer & buffer) const { @@ -49,10 +49,10 @@ void BinlogDumpGTID::writePayloadImpl(WriteBuffer & buffer) const buffer.write(reinterpret_cast(&flags), 2); buffer.write(reinterpret_cast(&server_id), 4); - UInt32 file_size = binlog_file_name.size(); + // Binlog file. + UInt32 file_size = 0; buffer.write(reinterpret_cast(&file_size), 4); - - buffer.write(binlog_file_name.data(), binlog_file_name.size()); + buffer.write("", 0); const UInt64 position = 4; buffer.write(reinterpret_cast(&position), 8); diff --git a/src/Core/MySQL/PacketsReplication.h b/src/Core/MySQL/PacketsReplication.h index a9393c69d45..ca89217f3f1 100644 --- a/src/Core/MySQL/PacketsReplication.h +++ b/src/Core/MySQL/PacketsReplication.h @@ -43,7 +43,6 @@ class BinlogDumpGTID : public IMySQLWritePacket public: UInt16 flags; UInt32 server_id; - String binlog_file_name; String gtid_datas; protected: