List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:August 9 2005 4:08am
Subject:bk commit into 4.1 tree (jimw:1.2354) BUG#11707
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2354 05/08/08 19:08:07 jimw@stripped +1 -0
  Reorder server startup so that network startup is done after storage
  engine startup. (Bug #11707)

  sql/mysqld.cc
    1.584 05/08/08 19:08:04 jimw@stripped +37 -35
    Reorder network startup to come after all other initialization, particularly
    storage engine startup which can take a long time. Also, move the handling
    of --memlock to be before we change users, so it actually gets handled
    again.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.1-11707

--- 1.583/sql/mysqld.cc	2005-07-26 08:58:57 -07:00
+++ 1.584/sql/mysqld.cc	2005-08-08 19:08:04 -07:00
@@ -271,8 +271,8 @@
 bool opt_error_log= IF_WIN(1,0);
 bool opt_disable_networking=0, opt_skip_show_db=0;
 bool lower_case_table_names_used= 0;
-bool server_id_supplied = 0;
-bool opt_endinfo,using_udf_functions, locked_in_memory;
+bool server_id_supplied= 0;
+bool opt_endinfo, using_udf_functions, locked_in_memory= 0;
 bool opt_using_transactions, using_update_log;
 bool volatile abort_loop, select_thread_in_use, signal_thread_in_use;
 bool volatile ready_to_exit, shutdown_in_progress, grant_option;
@@ -1251,7 +1251,7 @@
 #endif
 }
 
-static void server_init(void)
+static void network_init(void)
 {
   struct sockaddr_in	IPaddr;
 #ifdef HAVE_SYS_UN_H
@@ -1313,16 +1313,6 @@
     }
   }
 
-  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__
   /* create named pipe */
   if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
@@ -2829,27 +2819,6 @@
   /* call ha_init_key_cache() on all key caches to init them */
   process_key_caches(&ha_init_key_cache);
 
-#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) &&
!defined(EMBEDDED_LIBRARY)
-  if (locked_in_memory && !getuid())
-  {
-    if (setreuid((uid_t)-1, 0) == -1)
-    {                        // this should never happen
-      sql_perror("setreuid");
-      unireg_abort(1);
-    }
-    if (mlockall(MCL_CURRENT))
-    {
-      if (global_system_variables.log_warnings)
-	sql_print_warning("Failed to lock memory. Errno: %d\n",errno);
-      locked_in_memory= 0;
-    }
-    if (user_info)
-      set_user(mysqld_user, user_info);
-  }
-  else
-#endif
-    locked_in_memory=0;
-
   ft_init_stopwords();
 
   init_max_user_conn();
@@ -3033,7 +3002,38 @@
   mysql_data_home= mysql_data_home_buff;
   mysql_data_home[0]=FN_CURLIB;		// all paths are relative from here
   mysql_data_home[1]=0;
-  server_init();
+
+#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) &&
!defined(EMBEDDED_LIBRARY)
+  if (locked_in_memory && !getuid())
+  {
+    if (setreuid((uid_t)-1, 0) == -1)
+    {                        // this should never happen
+      sql_perror("setreuid");
+      unireg_abort(1);
+    }
+    if (mlockall(MCL_CURRENT))
+    {
+      if (global_system_variables.log_warnings)
+	sql_print_warning("Failed to lock memory. Errno: %d\n",errno);
+      locked_in_memory= 0;
+    }
+    if (user_info)
+      set_user(mysqld_user, user_info);
+  }
+  else
+#endif
+    locked_in_memory= 0;
+
+  /* Switch to our new userid, if we one was requested. */
+  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)
   {
@@ -3057,6 +3057,8 @@
 
   if (init_server_components())
     exit(1);
+
+  network_init();
 
 #ifdef __WIN__
   if (!opt_console)
Thread
bk commit into 4.1 tree (jimw:1.2354) BUG#11707Jim Winstead9 Aug