From: Date: April 25 2006 11:34pm Subject: bk commit into 5.1 tree (mikael:1.2369) BUG#19313 List-Archive: http://lists.mysql.com/commits/5520 X-Bug: 19313 Message-Id: <200604252134.k3PLY12i004318@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.1 repository of mikael. When mikael 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.2369 06/04/25 14:33:54 mikael@zim.(none) +1 -0 BUG#19313: Crash after mysqld starts and stops immediately afterwards. sql/sql_table.cc 1.325 06/04/25 14:33:48 mikael@zim.(none) +11 -5 Making sure all initialisations are properly done even when memory allocations fail. # 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: mikael # Host: zim.(none) # Root: /home/mikael/bug19313 --- 1.324/sql/sql_table.cc 2006-04-22 04:28:54 -07:00 +++ 1.325/sql/sql_table.cc 2006-04-25 14:33:48 -07:00 @@ -428,10 +428,6 @@ bool successful_open= FALSE; DBUG_ENTER("read_ddl_log_header"); - bzero(file_entry_buf, sizeof(global_ddl_log.file_entry_buf)); - global_ddl_log.inited= FALSE; - global_ddl_log.recovery_phase= TRUE; - global_ddl_log.io_size= IO_SIZE; create_ddl_log_file_name(file_name); if ((global_ddl_log.file_id= my_open(file_name, O_RDWR | O_BINARY, MYF(MY_WME))) >= 0) @@ -1068,6 +1064,15 @@ DBUG_ENTER("execute_ddl_log_recovery"); /* + Initialise global_ddl_log struct + */ + bzero(global_ddl_log.file_entry_buf, sizeof(global_ddl_log.file_entry_buf)); + global_ddl_log.inited= FALSE; + global_ddl_log.recovery_phase= TRUE; + global_ddl_log.io_size= IO_SIZE; + global_ddl_log.file_id=(File)-1; + + /* To be able to run this from boot, we allocate a temporary THD */ if (!(thd=new THD)) @@ -1130,7 +1135,8 @@ my_free((char*)free_list, MYF(0)); free_list= tmp; } - VOID(my_close(global_ddl_log.file_id, MYF(0))); + if (global_ddl_log.file_id != (File)-1) + VOID(my_close(global_ddl_log.file_id, MYF(0))); pthread_mutex_unlock(&LOCK_gdl); VOID(pthread_mutex_destroy(&LOCK_gdl)); DBUG_VOID_RETURN;