From ecc6aa474cffe8b890a1174d8eac0d9044087f00 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 22 Jul 2021 22:21:49 +0100 Subject: Do connection level setup in constructor --- lib/input/replStream.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/input/replStream.cpp b/lib/input/replStream.cpp index eb6c030..7a995d3 100644 --- a/lib/input/replStream.cpp +++ b/lib/input/replStream.cpp @@ -14,6 +14,8 @@ namespace MyGrate::Input { MySQLConn {host.c_str(), user.c_str(), pass.c_str(), port}, serverid {sid}, filename {std::move(fn)}, position {pos} { + query("SET @mariadb_slave_capability = 4"); + query("SET @master_binlog_checksum = @@global.binlog_checksum"); } void @@ -22,9 +24,6 @@ namespace MyGrate::Input { using MariaDB_Rpl_Ptr = std::unique_ptr; auto rpl = MariaDB_Rpl_Ptr {mariadb_rpl_init(this), &mariadb_rpl_close}; - query("SET @mariadb_slave_capability = 4"); - query("SET @master_binlog_checksum = @@global.binlog_checksum"); - mariadb_rpl_optionsv(rpl.get(), MARIADB_RPL_SERVER_ID, serverid); mariadb_rpl_optionsv(rpl.get(), MARIADB_RPL_FILENAME, filename.c_str(), filename.length()); mariadb_rpl_optionsv(rpl.get(), MARIADB_RPL_START, position); -- cgit v1.2.3