bug #25890 (mysqltest_embedded crashes on start)

binlog_filter and rpl_filter are initialized in server's 'main' function
which doesn't work in the embedded server. So this code moved to
function working in both cases.
parent 30d927da
...@@ -2613,6 +2613,14 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -2613,6 +2613,14 @@ static int init_common_variables(const char *conf_file_name, int argc,
max_system_variables.pseudo_thread_id= (ulong)~0; max_system_variables.pseudo_thread_id= (ulong)~0;
start_time=time((time_t*) 0); start_time=time((time_t*) 0);
rpl_filter= new Rpl_filter;
binlog_filter= new Rpl_filter;
if (!rpl_filter || !binlog_filter)
{
sql_perror("Could not allocate replication and binlog filters");
exit(1);
}
if (init_thread_environment()) if (init_thread_environment())
return 1; return 1;
mysql_init_variables(); mysql_init_variables();
...@@ -3473,14 +3481,6 @@ int main(int argc, char **argv) ...@@ -3473,14 +3481,6 @@ int main(int argc, char **argv)
MY_INIT(argv[0]); // init my_sys library & pthreads MY_INIT(argv[0]); // init my_sys library & pthreads
/* nothing should come before this line ^^^ */ /* nothing should come before this line ^^^ */
rpl_filter= new Rpl_filter;
binlog_filter= new Rpl_filter;
if (!rpl_filter || !binlog_filter)
{
sql_perror("Could not allocate replication and binlog filters");
exit(1);
}
/* /*
Perform basic logger initialization logger. Should be called after Perform basic logger initialization logger. Should be called after
MY_INIT, as it initializes mutexes. Log tables are inited later. MY_INIT, as it initializes mutexes. Log tables are inited later.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment