diff --git a/mtr/binlog_streaming/r/data_directory_8_0_to_8_4_upgrade.result b/mtr/binlog_streaming/r/data_directory_8_0_to_8_4_upgrade.result new file mode 100644 index 0000000..3ca7641 --- /dev/null +++ b/mtr/binlog_streaming/r/data_directory_8_0_to_8_4_upgrade.result @@ -0,0 +1,55 @@ + +*** Stopping current instance of 8.4 MySQL Server +include/stop_mysqld.inc [server 1] + +*** Setting up the 8.0 data directory + +*** Running 8.4 binaries on a 8.0 data directory +# restart + +*** Checking if we can access data after upgrade +SELECT * FROM t1 ORDER BY id; +id +101 +102 +103 +CHECKSUM TABLE t1; +Table Checksum +test.t1 1719212378 + +*** Adding more changed from the 8.4 server +INSERT INTO t1 VALUES(201); +START TRANSACTION; +INSERT INTO t1 VALUES(202); +INSERT INTO t1 VALUES(203); +COMMIT; +UPDATE t1 SET id = id + 100 WHERE id > 200; +DELETE FROM t1 WHERE id < 200; +DROP TABLE t1; + +*** Setting up BINSRV environment + +*** Generating a configuration file in JSON format for the Binlog +*** Server utility. + +*** Determining binlog file directory from the server. + +*** Creating a temporary directory for storing +*** binlog files downloaded via the Binlog Server utility. + +*** Executing the Binlog Server utility to download all binlog data +*** from both 8.0 and 8.4 binlog files + +*** Stopping current instance of 8.4 MySQL Server +include/stop_mysqld.inc [server 1] + +*** Cleaning up upgrade data directory +# restart + +*** Cleaning up BINSRV environment + +*** Removing the Binlog Server utility storage directory. + +*** Removing the Binlog Server utility log file. + +*** Removing the Binlog Server utility configuration file. diff --git a/mtr/binlog_streaming/std_data/data_80045_gtid.zip b/mtr/binlog_streaming/std_data/data_80045_gtid.zip new file mode 100644 index 0000000..22fd110 Binary files /dev/null and b/mtr/binlog_streaming/std_data/data_80045_gtid.zip differ diff --git a/mtr/binlog_streaming/std_data/data_80045_position.zip b/mtr/binlog_streaming/std_data/data_80045_position.zip new file mode 100644 index 0000000..7b024d5 Binary files /dev/null and b/mtr/binlog_streaming/std_data/data_80045_position.zip differ diff --git a/mtr/binlog_streaming/t/binsrv.test b/mtr/binlog_streaming/t/binsrv.test index a1c30e5..5fa6e0c 100644 --- a/mtr/binlog_streaming/t/binsrv.test +++ b/mtr/binlog_streaming/t/binsrv.test @@ -33,7 +33,7 @@ INSERT INTO t1 VALUES(DEFAULT); # identifying backend storage type ('file' or 's3') --source ../include/identify_storage_backend.inc -# identifying utility checksum mode from the conbination +# identifying utility checksum mode from the combination --let $extracted_init_connect_variable_name = binsrv_checksum --source ../include/extract_init_connect_variable_value.inc diff --git a/mtr/binlog_streaming/t/checkpointing.test b/mtr/binlog_streaming/t/checkpointing.test index e20bf54..1fa6a81 100644 --- a/mtr/binlog_streaming/t/checkpointing.test +++ b/mtr/binlog_streaming/t/checkpointing.test @@ -48,7 +48,7 @@ DROP TABLE t1; # identifying backend storage type ('file' or 's3') --source ../include/identify_storage_backend.inc -# identifying interval checkpointing mode from the conbination +# identifying interval checkpointing mode from the combination --let $extracted_init_connect_variable_name = binsrv_checkpointing --source ../include/extract_init_connect_variable_value.inc diff --git a/mtr/binlog_streaming/t/data_directory_8_0_to_8_4_upgrade.combinations b/mtr/binlog_streaming/t/data_directory_8_0_to_8_4_upgrade.combinations new file mode 100644 index 0000000..411ce97 --- /dev/null +++ b/mtr/binlog_streaming/t/data_directory_8_0_to_8_4_upgrade.combinations @@ -0,0 +1,5 @@ +[position] + +[gtid] +gtid-mode=on +enforce-gtid-consistency diff --git a/mtr/binlog_streaming/t/data_directory_8_0_to_8_4_upgrade.test b/mtr/binlog_streaming/t/data_directory_8_0_to_8_4_upgrade.test new file mode 100644 index 0000000..71280da --- /dev/null +++ b/mtr/binlog_streaming/t/data_directory_8_0_to_8_4_upgrade.test @@ -0,0 +1,102 @@ +--source ../include/have_binsrv.inc + +--source ../include/v80_v84_compatibility_defines.inc +if ($lts_series != v84) +{ + --skip This test must be run on a MySQL Server 8.4 +} + +--source include/mysql_upgrade_preparation.inc + +--let $binsrv_replication_mode = `SELECT IF(@@global.gtid_mode = 'ON', 'gtid', 'position')` + +--let $CUSTOM_MYSQLD_DATADIR = $MYSQL_TMP_DIR/data_80045_$binsrv_replication_mode +--let $ZIP_FILE = $MYSQL_TEST_DIR/suite/binlog_streaming/std_data/data_80045_$binsrv_replication_mode.zip + +--echo +--echo *** Stopping current instance of 8.4 MySQL Server +--source include/stop_mysqld.inc + +--echo +--echo *** Setting up the 8.0 data directory +# Data directory was created with the following script +# CREATE TABLE t1(id SERIAL, PRIMARY KEY(id)); +# INSERT INTO t1 VALUES(); +# INSERT INTO t1 VALUES(); +# +# START TRANSACTION; +# INSERT INTO t1 VALUES(); +# INSERT INTO t1 VALUES(); +# INSERT INTO t1 VALUES(); +# INSERT INTO t1 VALUES(); +# COMMIT; +# +# FLUSH BINARY LOGS; +# +# UPDATE t1 SET id = id + 100 WHERE id <= 3; +# DELETE FROM t1 WHERE id < 100; + +--exec unzip -qo $ZIP_FILE -d $MYSQL_TMP_DIR + +--echo +--echo *** Running 8.4 binaries on a 8.0 data directory +--let $MYSQLD_LOG = $MYSQLTEST_VARDIR/log/upgrade.log +--let $do_not_echo_parameters = 1 +--let $restart_parameters = restart: --datadir=$CUSTOM_MYSQLD_DATADIR --log-error=$MYSQLD_LOG +--source include/start_mysqld.inc + +--echo +--echo *** Checking if we can access data after upgrade +SELECT * FROM t1 ORDER BY id; +CHECKSUM TABLE t1; + + +--echo +--echo *** Adding more changed from the 8.4 server +INSERT INTO t1 VALUES(201); + +START TRANSACTION; +INSERT INTO t1 VALUES(202); +INSERT INTO t1 VALUES(203); +COMMIT; + +UPDATE t1 SET id = id + 100 WHERE id > 200; +DELETE FROM t1 WHERE id < 200; + +DROP TABLE t1; + +--echo +--echo *** Setting up BINSRV environment +# identifying backend storage type ('file' or 's3') +--source ../include/identify_storage_backend.inc + +# creating data directory, configuration file, etc. +--let $binsrv_connect_timeout = 20 +--let $binsrv_read_timeout = 60 +--let $binsrv_idle_time = 10 +--let $binsrv_verify_checksum = TRUE +# $binsrv_replication_mode already defined earlier +--let $binsrv_checkpoint_size = 1 +--source ../include/set_up_binsrv_environment.inc + +--echo +--echo *** Executing the Binlog Server utility to download all binlog data +--echo *** from both 8.0 and 8.4 binlog files +--exec $BINSRV fetch $binsrv_config_file_path > /dev/null + +--echo +--echo *** Stopping current instance of 8.4 MySQL Server +--source include/stop_mysqld.inc + +--echo +--echo *** Cleaning up upgrade data directory +--force-rmdir $CUSTOM_MYSQLD_DATADIR +--remove_file $MYSQLD_LOG + +--let $restart_parameters = +--source include/start_mysqld.inc +--source include/mysql_upgrade_cleanup.inc + +--echo +--echo *** Cleaning up BINSRV environment +--source ../include/tear_down_binsrv_environment.inc diff --git a/src/app.cpp b/src/app.cpp index 95c8b35..7a611c4 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -513,7 +513,7 @@ void process_binlog_event(const binsrv::events::event_view ¤t_event_v, // here we additionally check for log level because event materialization // is not a trivial operation if (binsrv::log_severity::debug >= logger.get_min_level()) { - const binsrv::events::event current_event{context, current_event_v}; + const binsrv::events::event current_event{current_event_v}; logger.log(binsrv::log_severity::debug, "event : [parsed] " + boost::lexical_cast(current_event)); diff --git a/src/binsrv/events/event.cpp b/src/binsrv/events/event.cpp index 30953ad..f59f5cd 100644 --- a/src/binsrv/events/event.cpp +++ b/src/binsrv/events/event.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -39,14 +38,12 @@ namespace binsrv::events { -event::event(const reader_context &context, const event_view &view) +event::event(const event_view &view) : common_header_{view.get_common_header_raw()} { - const auto encoded_server_version{ - context.get_current_encoded_server_version()}; const auto code{common_header_.get_type_code()}; - emplace_post_header(encoded_server_version, code, view.get_post_header_raw()); - emplace_body(encoded_server_version, code, view.get_body_raw()); + emplace_post_header(code, view.get_post_header_raw()); + emplace_body(code, view.get_body_raw()); if (view.has_footer()) { footer_.emplace(view.get_footer_view()); @@ -54,7 +51,7 @@ event::event(const reader_context &context, const event_view &view) } event::event(const reader_context &context, util::const_byte_span portion) - : event{context, event_view{context, portion}} {} + : event{event_view{context, portion}} {} template concept encodable = requires(const T &obj, util::byte_span &destination) { @@ -99,8 +96,7 @@ void event::encode_to(util::byte_span &destination) const { } } -void event::emplace_post_header(std::uint32_t encoded_server_version, - code_type code, util::const_byte_span portion) { +void event::emplace_post_header(code_type code, util::const_byte_span portion) { // our goal here is to initialize (emplace) a specific class inside // 'post_header_' variant (determined via runtime argument 'code') with the // 'portion' byte range @@ -108,8 +104,7 @@ void event::emplace_post_header(std::uint32_t encoded_server_version, // we start with defining an alias for a member function pointer that // accepts a byte range and performs some modification on an object of this // class (on 'post_header_' member to be precise) - using emplace_function = - void (event::*)(std::uint32_t, util::const_byte_span); + using emplace_function = void (event::*)(util::const_byte_span); // then, we define an alias for a container that can store // '' such member function pointers using emplace_function_container = @@ -148,14 +143,12 @@ void event::emplace_post_header(std::uint32_t encoded_server_version, // this will initialize the 'post_header_' member with expected variant // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-constant-array-index) - (this->*emplace_functions[function_index])(encoded_server_version, portion); + (this->*emplace_functions[function_index])(portion); } -void event::emplace_body(std::uint32_t encoded_server_version, code_type code, - util::const_byte_span portion) { +void event::emplace_body(code_type code, util::const_byte_span portion) { // here we use the same technique as in 'emplace_post_header()' - using emplace_function = - void (event::*)(std::uint32_t, util::const_byte_span); + using emplace_function = void (event::*)(util::const_byte_span); using emplace_function_container = std::array; static constexpr emplace_function_container emplace_functions{ @@ -168,7 +161,7 @@ void event::emplace_body(std::uint32_t encoded_server_version, code_type code, const auto function_index = util::enum_to_index(code); assert(function_index < util::enum_to_index(code_type::delimiter)); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-constant-array-index) - (this->*emplace_functions[function_index])(encoded_server_version, portion); + (this->*emplace_functions[function_index])(portion); } void event::encode_and_checksum(event_storage &buffer, bool include_checksum) { diff --git a/src/binsrv/events/event.hpp b/src/binsrv/events/event.hpp index 0e6382c..d9aed11 100644 --- a/src/binsrv/events/event.hpp +++ b/src/binsrv/events/event.hpp @@ -128,7 +128,7 @@ class [[nodiscard]] event { post_header, body, include_checksum, nullptr}; } - event(const reader_context &context, const event_view &view); + explicit event(const event_view &view); event(const reader_context &context, util::const_byte_span portion); [[nodiscard]] const common_header &get_common_header() const noexcept { @@ -192,27 +192,15 @@ class [[nodiscard]] event { } template - void generic_emplace_post_header(std::uint32_t encoded_server_version, - util::const_byte_span portion) { - if constexpr (std::is_constructible_v) { - post_header_.emplace(portion); - } else { - post_header_.emplace(encoded_server_version, portion); - } + void generic_emplace_post_header(util::const_byte_span portion) { + post_header_.emplace(portion); } - void emplace_post_header(std::uint32_t encoded_server_version, code_type code, - util::const_byte_span portion); + void emplace_post_header(code_type code, util::const_byte_span portion); template - void generic_emplace_body(std::uint32_t encoded_server_version, - util::const_byte_span portion) { - if constexpr (std::is_constructible_v) { - body_.emplace(portion); - } else { - body_.emplace(encoded_server_version, portion); - } + void generic_emplace_body(util::const_byte_span portion) { + body_.emplace(portion); } - void emplace_body(std::uint32_t encoded_server_version, code_type code, - util::const_byte_span portion); + void emplace_body(code_type code, util::const_byte_span portion); void encode_and_checksum(event_storage &buffer, bool include_checksum); }; diff --git a/src/binsrv/events/event_view.cpp b/src/binsrv/events/event_view.cpp index f2483a4..ea3002d 100644 --- a/src/binsrv/events/event_view.cpp +++ b/src/binsrv/events/event_view.cpp @@ -70,21 +70,50 @@ event_view_base::event_view_base(const reader_context &context, "header"); } - post_header_size_ = context.get_current_post_header_length(code); - if (post_header_size_ == unspecified_post_header_length) { - util::exception_location().raise( - "received event of type " + std::to_string(util::enum_to_index(code)) + - " \"" + std::string{to_string_view(code)} + - "\" " - "is not known in server version " + - std::to_string(context.get_current_encoded_server_version())); - } + if (code == code_type::format_description) { + // special case for FORMAT_DESCRIPTION event + + // in a scenario when 8.0 MySQL Server was upgraded to 8.4, it is possible + // for us to receive both 8.0 FDEs (coming from binlog files created before + // the upgrade) and 8.4 FDEs (coming from binlog files created after the + // upgrade) + + // as 8.0 and 8.4 FDEs have different sizes of their post header section, + // the standard mechanism of extracting expected post header length from + // the context does not work here + + // instead, we rely on the fact that FDE have body of a fixed size (1 byte + // for 'checksum_algorithm') and we can calculate the size of the + // post header based on that + const std::size_t group_size = + get_common_header_size() + + generic_body::size_in_bytes + + get_footer_size(); + if (get_total_size() < group_size) { + util::exception_location().raise( + "not enough data for format description event common header + body + " + "footer"); + } + post_header_size_ = get_total_size() - group_size; + } else { + // for every other event, we proceed the standard way + post_header_size_ = context.get_current_post_header_length(code); + if (post_header_size_ == unspecified_post_header_length) { + util::exception_location().raise( + "received event of type " + + std::to_string(util::enum_to_index(code)) + " \"" + + std::string{to_string_view(code)} + + "\" " + "is not known in server version " + + std::to_string(context.get_current_encoded_server_version())); + } - const std::size_t group_size = - get_common_header_size() + get_post_header_size() + get_footer_size(); - if (get_total_size() < group_size) { - util::exception_location().raise( - "not enough data for event post header + body + footer"); + const std::size_t group_size = + get_common_header_size() + get_post_header_size() + get_footer_size(); + if (get_total_size() < group_size) { + util::exception_location().raise( + "not enough data for event common header + post header + footer"); + } } // optional checksum verification diff --git a/src/binsrv/events/format_description_post_header_impl.cpp b/src/binsrv/events/format_description_post_header_impl.cpp index 0b1754b..12f1901 100644 --- a/src/binsrv/events/format_description_post_header_impl.cpp +++ b/src/binsrv/events/format_description_post_header_impl.cpp @@ -66,8 +66,7 @@ generic_post_header_impl:: } generic_post_header_impl:: - generic_post_header_impl(std::uint32_t encoded_server_version, - util::const_byte_span portion) { + generic_post_header_impl(util::const_byte_span portion) { // TODO: rework with direct member initialization /* @@ -86,7 +85,6 @@ generic_post_header_impl:: | | lengths for all | per event type that the | | event types | server knows about +=====================================+ - */ static_assert(server_version_length == @@ -115,9 +113,12 @@ generic_post_header_impl:: "inefficient data member reordering in " "generic_post_header_impl"); - if (std::size(portion) != get_size_in_bytes(encoded_server_version)) { + if (std::size(portion) < + get_size_in_bytes(earliest_supported_protocol_server_version) || + std::size(portion) > + get_size_in_bytes(latest_known_protocol_server_version)) { util::exception_location().raise( - "invalid format_description event post header length"); + "format_description event post header length is not in allowed range"); } auto remainder = portion; @@ -126,6 +127,14 @@ generic_post_header_impl:: util::extract_byte_span_from_byte_span(remainder, util::byte_span{server_version_}); util::normalize_for_c_str(server_version_); + + const auto encoded_server_version{get_encoded_server_version()}; + if (std::size(portion) != get_size_in_bytes(encoded_server_version)) { + util::exception_location().raise( + "format_description event post header length does not match the value " + "expected for the server version specified in its own fields"); + } + util::extract_fixed_int_from_byte_span(remainder, create_timestamp_); util::extract_fixed_int_from_byte_span(remainder, common_header_length_); const auto expected_subrange_length{ @@ -134,6 +143,13 @@ generic_post_header_impl:: std::data(post_header_lengths_), expected_subrange_length}; util::extract_byte_span_from_byte_span(remainder, post_header_lengths_subrange); + if (std::size(portion) != get_post_header_length_for_code( + encoded_server_version, post_header_lengths_, + code_type::format_description)) { + util::exception_location().raise( + "format_description event post header length does not match the value " + "specified in the post header length array in its own fields"); + } } [[nodiscard]] std::string_view generic_post_header_impl< diff --git a/src/binsrv/events/format_description_post_header_impl.hpp b/src/binsrv/events/format_description_post_header_impl.hpp index 1f8f8ee..f14f44b 100644 --- a/src/binsrv/events/format_description_post_header_impl.hpp +++ b/src/binsrv/events/format_description_post_header_impl.hpp @@ -56,8 +56,7 @@ class [[nodiscard]] generic_post_header_impl { const util::semantic_version &server_version, const ctime_timestamp &create_timestamp, std::size_t common_header_length, const post_header_length_container &post_header_lengths); - generic_post_header_impl(std::uint32_t encoded_server_version, - util::const_byte_span portion); + explicit generic_post_header_impl(util::const_byte_span portion); [[nodiscard]] std::uint16_t get_binlog_version_raw() const noexcept { return binlog_version_; diff --git a/src/binsrv/events/protocol_traits_fwd.hpp b/src/binsrv/events/protocol_traits_fwd.hpp index c56356b..02b7e54 100644 --- a/src/binsrv/events/protocol_traits_fwd.hpp +++ b/src/binsrv/events/protocol_traits_fwd.hpp @@ -42,9 +42,9 @@ inline constexpr std::uint32_t innovation83_with_tagged_gtids_number_of_events{ constexpr std::size_t get_number_of_events(std::uint32_t encoded_server_version) noexcept { - // Tagged GTIDs alomng with new new tagged GTID event were introduced in + // Tagged GTIDs along with new new tagged GTID event were introduced in // MySQL Server 8.3.0 Innovation. - // This new event incresed the size of post header length table in FDE. + // This new event increased the size of post header length table in FDE. return encoded_server_version < latest_known_protocol_server_version ? lts80_number_of_events : innovation83_with_tagged_gtids_number_of_events; diff --git a/src/binsrv/events/reader_context.cpp b/src/binsrv/events/reader_context.cpp index ce9438f..6c537a2 100644 --- a/src/binsrv/events/reader_context.cpp +++ b/src/binsrv/events/reader_context.cpp @@ -36,23 +36,24 @@ namespace binsrv::events { -reader_context::reader_context(std::uint32_t encoded_server_version, +reader_context::reader_context(std::uint32_t connection_encoded_server_version, bool checksum_verification_enabled, replication_mode_type replication_mode, std::string_view binlog_name, std::uint32_t position) - : encoded_server_version_{encoded_server_version}, + : connection_encoded_server_version_{connection_encoded_server_version}, + current_encoded_server_version_{connection_encoded_server_version}, checksum_verification_enabled_{checksum_verification_enabled}, footer_expected_{checksum_verification_enabled}, replication_mode_{replication_mode}, binlog_name_{binlog_name}, position_{position == 0U ? static_cast(magic_binlog_offset) : position}, - post_header_lengths_{ - get_known_post_header_lengths(encoded_server_version_)} {} + post_header_lengths_{get_known_post_header_lengths( + get_connection_encoded_server_version())} {} [[nodiscard]] std::size_t reader_context::get_current_post_header_length(code_type code) const noexcept { - return get_post_header_length_for_code(encoded_server_version_, + return get_post_header_length_for_code(get_current_encoded_server_version(), post_header_lengths_, code); } @@ -372,10 +373,10 @@ reader_context::get_hardcoded_post_header_lengths( // to sum up, 8.4 in comparison to 8.0 has: // - one more event GTID_TAGGED_LOG_EVENT (code 42) - // - because of this the length of the FORMAT_DESCRIPTION_EVENT post-header + // - because of this the length of the FORMAT_DESCRIPTION_EVENT post header // (code 15) also increased by 1 byte // - also WRITE_ROWS_V1 (code 23), UPDATE_ROWS_V1 (code 24), and - // DELETE_ROWS_V1 (code 25) are lo longer supported and their post-header + // DELETE_ROWS_V1 (code 25) are lo longer supported and their post header // lengths changed from 8 bytes to 0 // the remainder of the 'earliest' container (the gtid_tagged_log element) @@ -626,7 +627,6 @@ reader_context::process_event_in_format_description_expected_state( } const auto post_header{generic_post_header{ - get_current_encoded_server_version(), current_event_v.get_post_header_raw()}}; // check if FDE has expected binlog version number @@ -641,17 +641,20 @@ reader_context::process_event_in_format_description_expected_state( "unexpected common header length in format description event"); } - // check if server version in FDE is the same as the one extracted from - // the connection object ('mysql_get_server_version()') - if (post_header.get_encoded_server_version() != encoded_server_version_) { + // check if server version in FDE is not greater than as the one extracted + // from the connection object ('mysql_get_server_version()') + current_encoded_server_version_ = post_header.get_encoded_server_version(); + if (get_current_encoded_server_version() > + get_connection_encoded_server_version()) { util::exception_location().raise( "unexpected server version in format description event"); } // check if the values from the post_header_lengths array are the same as // generic_post_header_impl::size_in_bytes for known events validate_post_header_lengths( - encoded_server_version_, post_header.get_post_header_lengths_raw(), - get_known_post_header_lengths(encoded_server_version_)); + get_current_encoded_server_version(), + post_header.get_post_header_lengths_raw(), + get_known_post_header_lengths(get_current_encoded_server_version())); post_header_lengths_ = post_header.get_post_header_lengths_raw(); diff --git a/src/binsrv/events/reader_context.hpp b/src/binsrv/events/reader_context.hpp index 966580a..b4c1149 100644 --- a/src/binsrv/events/reader_context.hpp +++ b/src/binsrv/events/reader_context.hpp @@ -33,15 +33,19 @@ namespace binsrv::events { class [[nodiscard]] reader_context { public: - reader_context(std::uint32_t encoded_server_version, + reader_context(std::uint32_t connection_encoded_server_version, bool checksum_verification_enabled, replication_mode_type replication_mode, std::string_view binlog_name, std::uint32_t position); [[nodiscard]] bool is_fresh() const noexcept { return cycle_number_ == 0U; } [[nodiscard]] std::uint32_t + get_connection_encoded_server_version() const noexcept { + return connection_encoded_server_version_; + } + [[nodiscard]] std::uint32_t get_current_encoded_server_version() const noexcept { - return encoded_server_version_; + return current_encoded_server_version_; } [[nodiscard]] bool is_checksum_verification_enabled() const noexcept { return checksum_verification_enabled_; @@ -92,7 +96,8 @@ class [[nodiscard]] reader_context { rotate_or_stop_expected }; state_type state_{state_type::rotate_artificial_expected}; - std::uint32_t encoded_server_version_; + std::uint32_t connection_encoded_server_version_; + std::uint32_t current_encoded_server_version_; // indicates whether user requested checksum verification // (in the configuration file) diff --git a/tests/event_test.cpp b/tests/event_test.cpp index 0f19a4b..01928b4 100644 --- a/tests/event_test.cpp +++ b/tests/event_test.cpp @@ -74,8 +74,7 @@ BOOST_AUTO_TEST_CASE(EventRoundTrip) { const binsrv::events::event_view generated_rotate_event_v{ context, util::const_byte_span{event_buffer}}; - const binsrv::events::event parsed_rotate_event{context, - generated_rotate_event_v}; + const binsrv::events::event parsed_rotate_event{generated_rotate_event_v}; bool info_only{false}; info_only = context.process_event_view(generated_rotate_event_v); BOOST_CHECK(info_only); @@ -107,7 +106,7 @@ BOOST_AUTO_TEST_CASE(EventRoundTrip) { const binsrv::events::event_view generated_format_description_event_v{ context, util::const_byte_span{event_buffer}}; const binsrv::events::event parsed_format_description_event{ - context, generated_format_description_event_v}; + generated_format_description_event_v}; info_only = context.process_event_view(generated_format_description_event_v); BOOST_CHECK(!info_only); @@ -135,7 +134,7 @@ BOOST_AUTO_TEST_CASE(EventRoundTrip) { const binsrv::events::event_view generated_previous_gtids_log_event_v{ context, util::const_byte_span{event_buffer}}; const binsrv::events::event parsed_previous_gtids_log_event{ - context, generated_previous_gtids_log_event_v}; + generated_previous_gtids_log_event_v}; info_only = context.process_event_view(generated_previous_gtids_log_event_v); BOOST_CHECK(!info_only);