diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-05-01 15:43:51 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-05-01 15:43:51 +0200 |
commit | ddc960db4bbbcb38ad1413c4aaedb742c12cc5d3 (patch) | |
tree | 286eb103bf0051a53611748e4d48492f467ca27b /client | |
parent | 2797f0c5347d87c6c1c3053e1f857381be6631c3 (diff) | |
download | mariadb-git-ddc960db4bbbcb38ad1413c4aaedb742c12cc5d3.tar.gz |
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".
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index a8c201082d9..fa02c74615c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -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); |