mirror of
https://github.com/MariaDB/server.git
synced 2026-04-21 07:45:32 +02: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:
parent
2797f0c534
commit
ddc960db4b
2 changed files with 12 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue