Commit ddc960db authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified...

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".
parent 2797f0c5
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment