diff options
author | sasha@mysql.sashanet.com <> | 2000-09-09 21:31:23 -0600 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2000-09-09 21:31:23 -0600 |
commit | 8c1fa4e3e35ab67b9a4cb522dd13889531e1f200 (patch) | |
tree | ac859d644b0cb3e6781e52923e2b1de54ffe8441 /sql/sql_parse.cc | |
parent | 9fcc7174dafb2625f7b84fda0fbe6c202b9761cf (diff) | |
download | mariadb-git-8c1fa4e3e35ab67b9a4cb522dd13889531e1f200.tar.gz |
CHANGE MASTER TO coredumped when the slave was initially started
masterless
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 007e90e7ec0..c3aa5c1512f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -52,6 +52,7 @@ static int change_master(THD* thd); static void reset_slave(); static void reset_master(); +extern int init_master_info(MASTER_INFO* mi); static const char *any_db="*any*"; // Special symbol for check_access @@ -2462,7 +2463,7 @@ static int start_slave(THD* thd , bool net_report) return 1; pthread_mutex_lock(&LOCK_slave); if(!slave_running) - if(master_host) + if(glob_mi.inited && glob_mi.host) { pthread_t hThread; if(pthread_create(&hThread, &connection_attrib, handle_slave, 0)) @@ -2471,7 +2472,7 @@ static int start_slave(THD* thd , bool net_report) } } else - err = "Master host not set"; + err = "Master host not set or master info not initialized"; else err = "Slave already running"; @@ -2557,6 +2558,9 @@ static int change_master(THD* thd) thd->proc_info = "changing master"; LEX_MASTER_INFO* lex_mi = &thd->lex.mi; + if(!glob_mi.inited) + init_master_info(&glob_mi); + pthread_mutex_lock(&glob_mi.lock); if((lex_mi->host || lex_mi->port) && !lex_mi->log_file_name && !lex_mi->pos) { |