mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 02:30:06 +01:00
fixed 'load table from master' hang when host is empty
added respective test case
This commit is contained in:
parent
429aa7459f
commit
fc52e079d0
3 changed files with 16 additions and 0 deletions
2
mysql-test/r/rpl_empty_master_crash.result
Normal file
2
mysql-test/r/rpl_empty_master_crash.result
Normal file
|
@ -0,0 +1,2 @@
|
|||
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
|
||||
0 0 0 No 0 0
|
8
mysql-test/t/rpl_empty_master_crash.test
Normal file
8
mysql-test/t/rpl_empty_master_crash.test
Normal file
|
@ -0,0 +1,8 @@
|
|||
source include/master-slave.inc;
|
||||
connection master;
|
||||
use test;
|
||||
drop table if exists t1;
|
||||
show slave status;
|
||||
#--error 1218 # for mysql-4.0
|
||||
--error 1042
|
||||
load table t1 from master;
|
|
@ -451,6 +451,12 @@ int fetch_nx_table(THD* thd, MASTER_INFO* mi)
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (!mi->host || !*mi->host)
|
||||
{
|
||||
nx_errno = ER_BAD_HOST_ERROR;
|
||||
goto err;
|
||||
}
|
||||
|
||||
safe_connect(thd, mysql, mi);
|
||||
if (slave_killed(thd))
|
||||
goto err;
|
||||
|
|
Loading…
Add table
Reference in a new issue