Commit a267fd22 authored by unknown's avatar unknown

Reorder server startup so that network startup is done after storage

engine startup. (Bug #11707)


sql/mysqld.cc:
  Reorder network startup to come after all other initialization,
  particularly storage engine startup which can take a long time.
parent 0096e197
...@@ -1257,7 +1257,7 @@ static void set_root(const char *path) ...@@ -1257,7 +1257,7 @@ static void set_root(const char *path)
#endif #endif
} }
static void server_init(void) static void network_init(void)
{ {
struct sockaddr_in IPaddr; struct sockaddr_in IPaddr;
#ifdef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H
...@@ -1319,16 +1319,6 @@ static void server_init(void) ...@@ -1319,16 +1319,6 @@ static void server_init(void)
} }
} }
if ((user_info= check_user(mysqld_user)))
{
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
if (locked_in_memory) // getuid() == 0 here
set_effective_user(user_info);
else
#endif
set_user(mysqld_user, user_info);
}
#ifdef __NT__ #ifdef __NT__
/* create named pipe */ /* create named pipe */
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap && if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
...@@ -3039,7 +3029,17 @@ int main(int argc, char **argv) ...@@ -3039,7 +3029,17 @@ int main(int argc, char **argv)
mysql_data_home= mysql_data_home_buff; mysql_data_home= mysql_data_home_buff;
mysql_data_home[0]=FN_CURLIB; // all paths are relative from here mysql_data_home[0]=FN_CURLIB; // all paths are relative from here
mysql_data_home[1]=0; mysql_data_home[1]=0;
server_init();
if ((user_info= check_user(mysqld_user)))
{
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
if (locked_in_memory) // getuid() == 0 here
set_effective_user(user_info);
else
#endif
set_user(mysqld_user, user_info);
}
if (opt_bin_log && !server_id) if (opt_bin_log && !server_id)
{ {
...@@ -3064,6 +3064,8 @@ we force server id to 2, but this MySQL server will not act as a slave."); ...@@ -3064,6 +3064,8 @@ we force server id to 2, but this MySQL server will not act as a slave.");
if (init_server_components()) if (init_server_components())
exit(1); exit(1);
network_init();
#ifdef __WIN__ #ifdef __WIN__
if (!opt_console) if (!opt_console)
{ {
......
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