From acb73df26cfa81f1911d81197e4d68c3c3266349 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 22 Feb 2023 15:08:24 +0100 Subject: [PATCH] Check result of COM_REGISTER_SLAVE and set error message if it fails. --- libmariadb/mariadb_rpl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libmariadb/mariadb_rpl.c b/libmariadb/mariadb_rpl.c index 65a26547..e274b3eb 100644 --- a/libmariadb/mariadb_rpl.c +++ b/libmariadb/mariadb_rpl.c @@ -783,8 +783,11 @@ int STDCALL mariadb_rpl_open(MARIADB_RPL *rpl) int4store(p, 0); p+= 4; - if (ma_simple_command(rpl->mysql, COM_REGISTER_SLAVE, (const char *)buffer, p - buffer, 1, 0)) + if (ma_simple_command(rpl->mysql, COM_REGISTER_SLAVE, (const char *)buffer, p - buffer, 0, 0)) + { + rpl_set_error(rpl, mysql_errno(rpl->mysql), 0, NULL, 0); return 1; + } } if (rpl->mysql)