1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-29499 Improving the 'Can't execute init_slave query' error message with the actual failure

Currently, there are multiple error codes reported for the issue
'Can't execute init_slave query'. Those error codes are the underlying
reason the init_slave query cannot be executed, but this makes it
difficult to detect the issue in an automated way.

This patch introduces a new error code, ER_INIT_SLAVE_ERROR, to unify
all the errors related to the init_slave query. The ER_INIT_SLAVE_ERROR
error is raised for any issue related to the init_slave query, and the
underlying error code and message are included in the Last_SQL_Error
field.

Reviewed by:
Jimmy Hu <jimmy.hu@mariadb.com>
Brandon Nesterenko <brandon.nesterenko@mariadb.com>
This commit is contained in:
Apostolis Stamatis
2025-04-29 19:24:11 +03:00
committed by Brandon Nesterenko
parent 28dbfcb397
commit 247e2f8d4d
5 changed files with 18 additions and 8 deletions

View File

@ -15,8 +15,8 @@ connection slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
include/wait_for_slave_sql_error.inc [errno=1064]
Last_SQL_Error = 'Slave SQL thread aborted. Can't execute init_slave query'
include/wait_for_slave_sql_error.inc [errno=4226]
Last_SQL_Error = 'Slave SQL thread aborted. Can't execute init_slave query due to error code 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1'
SET GLOBAL init_slave= "";
include/stop_slave_io.inc
RESET SLAVE;