List:Commits« Previous MessageNext Message »
From:holyfoot Date:November 13 2007 10:10am
Subject:bk commit into 5.1 tree (holyfoot:1.2625) BUG#31868
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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@stripped, 2007-11-13 13:09:59+04:00, holyfoot@stripped +4 -0
  Bug #31868 mysql_server_init crash when language path is not correctly set.
  
  When mysql_server_init() interrupts on some error (wrong errmsg file
  for example) in the middle of it's execution, it doesn't call
  execute_ddl_log_recovery() so LOCK_gdl mutex isn't init-ed.
  In this case we shouldn't execute release_ddl_log during cleanup
  as it uses that mutex inside.

  BitKeeper/etc/ignore@stripped, 2007-11-13 13:09:56+04:00, holyfoot@stripped +4 -0
    Added libmysqld/scheduler.cc libmysqld/sql_connect.cc libmysqld/sql_tablespace.cc
libmysql_r/client_settings.h to the ignore list

  libmysqld/lib_sql.cc@stripped, 2007-11-13 13:09:56+04:00, holyfoot@stripped +0 -1
    Bug #31868 mysql_server_init crash when language path is not correctly set.
    
    line moved to clean_up()

  sql/mysqld.cc@stripped, 2007-11-13 13:09:56+04:00, holyfoot@stripped +2 -1
    Bug #31868 mysql_server_init crash when language path is not correctly set.
    
    release_ddl_log() now can be called from common 'clean_up()'

  sql/sql_table.cc@stripped, 2007-11-13 13:09:56+04:00, holyfoot@stripped +10 -3
    Bug #31868 mysql_server_init crash when language path is not correctly set.
    
    do_release flag added to the global_ddl_log and the construcntor to
    set it's initial value.
    Also now release_ddl_log() checks for that flag.

diff -Nrup a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore
--- a/BitKeeper/etc/ignore	2007-09-06 18:51:38 +05:00
+++ b/BitKeeper/etc/ignore	2007-11-13 13:09:56 +04:00
@@ -3004,3 +3004,7 @@ win/vs71cache.txt
 win/vs8cache.txt
 zlib/*.ds?
 zlib/*.vcproj
+libmysqld/scheduler.cc
+libmysqld/sql_connect.cc
+libmysqld/sql_tablespace.cc
+libmysql_r/client_settings.h
diff -Nrup a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
--- a/libmysqld/lib_sql.cc	2007-10-10 05:12:09 +05:00
+++ b/libmysqld/lib_sql.cc	2007-11-13 13:09:56 +04:00
@@ -551,7 +551,6 @@ void end_embedded_server()
 {
   my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR));
   copy_arguments_ptr=0;
-  release_ddl_log();
   clean_up(0);
 }
 
diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc	2007-10-29 12:56:32 +04:00
+++ b/sql/mysqld.cc	2007-11-13 13:09:56 +04:00
@@ -1164,6 +1164,8 @@ void clean_up(bool print_message)
   if (cleanup_done++)
     return; /* purecov: inspected */
 
+  release_ddl_log();
+
   /*
     make sure that handlers finish up
     what they have that is dependent on the binlog
@@ -3995,7 +3997,6 @@ we force server id to 2, but this MySQL 
     pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
   (void) pthread_mutex_unlock(&LOCK_thread_count);
 
-  release_ddl_log();
 #if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
   if (Service.IsNT() && start_mode)
     Service.Stop();
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc
--- a/sql/sql_table.cc	2007-10-23 13:33:18 +05:00
+++ b/sql/sql_table.cc	2007-11-13 13:09:56 +04:00
@@ -279,7 +279,7 @@ uint build_tmptable_filename(THD* thd, c
 */
 
 
-typedef struct st_global_ddl_log
+struct st_global_ddl_log
 {
   /*
     We need to adjust buffer size to be able to handle downgrades/upgrades
@@ -297,10 +297,12 @@ typedef struct st_global_ddl_log
   uint name_len;
   uint io_size;
   bool inited;
+  bool do_release;
   bool recovery_phase;
-} GLOBAL_DDL_LOG;
+  st_global_ddl_log() : inited(false), do_release(false) {}
+};
 
-GLOBAL_DDL_LOG global_ddl_log;
+st_global_ddl_log global_ddl_log;
 
 pthread_mutex_t LOCK_gdl;
 
@@ -460,6 +462,7 @@ static uint read_ddl_log_header()
   global_ddl_log.first_used= NULL;
   global_ddl_log.num_entries= 0;
   VOID(pthread_mutex_init(&LOCK_gdl, MY_MUTEX_INIT_FAST));
+  global_ddl_log.do_release= true;
   DBUG_RETURN(entry_no);
 }
 
@@ -1150,6 +1153,9 @@ void release_ddl_log()
   DDL_LOG_MEMORY_ENTRY *used_list= global_ddl_log.first_used;
   DBUG_ENTER("release_ddl_log");
 
+  if (!global_ddl_log.do_release)
+    DBUG_VOID_RETURN;
+
   pthread_mutex_lock(&LOCK_gdl);
   while (used_list)
   {
@@ -1167,6 +1173,7 @@ void release_ddl_log()
   global_ddl_log.inited= 0;
   pthread_mutex_unlock(&LOCK_gdl);
   VOID(pthread_mutex_destroy(&LOCK_gdl));
+  global_ddl_log.do_release= false;
   DBUG_VOID_RETURN;
 }
 
Thread
bk commit into 5.1 tree (holyfoot:1.2625) BUG#31868holyfoot13 Nov
  • Re: bk commit into 5.1 tree (holyfoot:1.2625) BUG#31868Sergei Golubchik19 Nov