The patch below fixed the coredump in CHANGE MASTER TO executed on a server
that was not originally started as a slave. Note that in this case, you will
need to also execute SLAVE START because the CHANGE MASTER does not alter the
slave thread running status.
P.S - if you by any chance run into problems with 3.23.24 on Linux, it now has a
really cool option - write-core, so if you just do gdb /path/to/data/dir/core
/path/to/mysqld, and bt in the debugger, this will give us at least a place to
start looking. We of course really hope that mysqld will never coredump on you
regardless of how weird your queries are, how corrupt your tables are, or how
high of a load it is under , and our goal is to make sure that this never
happens.
===== slave.cc 1.35 vs edited =====
--- 1.35/sql/slave.cc Wed Aug 30 13:42:21 2000
+++ edited/slave.cc Sat Sep 9 13:18:54 2000
@@ -40,7 +40,7 @@
static inline bool slave_killed(THD* thd);
static int init_slave_thread(THD* thd);
-static int init_master_info(MASTER_INFO* mi);
+int init_master_info(MASTER_INFO* mi);
static void safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi);
static void safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi);
static int safe_sleep(THD* thd, int sec);
@@ -249,7 +249,7 @@
return error;
}
-static int init_master_info(MASTER_INFO* mi)
+int init_master_info(MASTER_INFO* mi)
{
FILE* file;
MY_STAT stat_area;
===== sql_parse.cc 1.66 vs edited =====
--- 1.66/sql/sql_parse.cc Fri Sep 1 22:58:41 2000
+++ edited/sql_parse.cc Sat Sep 9 20:42:52 2000
@@ -52,6 +52,7 @@
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 @@
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 @@
}
}
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 @@
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)
{
--
Sasha Pachev
+------------------------------------------------------------------+
| ____ __ _____ _____ ___ http://www.mysql.com |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sasha Pachev |
| /*/ /*/ /*/ \*\_ |*| |*||*| sasha@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Provo, Utah, USA |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+------------------------------------------------------------------+