mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server
do_start_slave_sql() is called from maybe_exit(). We should not recurse when maybe_exit() is called for an error during do_start_slave_sql(). Also remove a meaningless (but safe) "goto err".
This commit is contained in:
@@ -1496,12 +1496,13 @@ static void free_resources()
|
||||
|
||||
static void maybe_exit(int error)
|
||||
{
|
||||
if (opt_slave_data)
|
||||
do_start_slave_sql(mysql);
|
||||
if (!first_error)
|
||||
first_error= error;
|
||||
if (ignore_errors)
|
||||
return;
|
||||
ignore_errors= 1; /* don't want to recurse, if something fails below */
|
||||
if (opt_slave_data)
|
||||
do_start_slave_sql(mysql);
|
||||
if (mysql)
|
||||
mysql_close(mysql);
|
||||
free_resources();
|
||||
@@ -5682,8 +5683,8 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
err:
|
||||
/* if --dump-slave , start the slave sql thread */
|
||||
if (opt_slave_data && do_start_slave_sql(mysql))
|
||||
goto err;
|
||||
if (opt_slave_data)
|
||||
do_start_slave_sql(mysql);
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
my_free(shared_memory_base_name);
|
||||
|
||||
@@ -2455,3 +2455,10 @@ drop table t1, t2;
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
||||
|
||||
#
|
||||
# MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server
|
||||
#
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP -hunknownhost --dump-slave nulldb
|
||||
|
||||
|
||||
Reference in New Issue
Block a user