From b7b95ecf2d6bfde1ffda21809f356773f8630cdc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Apr 2006 12:26:35 -0400 Subject: [PATCH] Fixes --- sql/mysql_priv.h | 2 +- sql/sql_partition.cc | 3 ++- sql/sql_table.cc | 11 +++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index df7a88ccfbb..dbc1093c01a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1299,7 +1299,7 @@ void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry); bool sync_ddl_log(); void release_ddl_log(); void execute_ddl_log_recovery(); -bool execute_ddl_log_entry(uint first_entry); +bool execute_ddl_log_entry(THD *thd, uint first_entry); void lock_global_ddl_log(); void unlock_global_ddl_log(); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 351ed0dd5a6..f038c2232cf 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -5342,7 +5342,8 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt, DBUG_ENTER("handle_alter_part_error"); if (!part_info->first_log_entry && - execute_ddl_log_entry(part_info->first_log_entry->entry_pos)) + execute_ddl_log_entry(current_thd, + part_info->first_log_entry->entry_pos)) { /* We couldn't recover from error, most likely manual interaction diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 90251184120..e8f5fffd88b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -434,8 +434,6 @@ static uint read_ddl_log_header() else successful_open= TRUE; } - else - sql_print_error("Failed to open ddl log file in recovery"); entry_no= uint4korr(&file_entry_buf[DDL_LOG_NUM_ENTRY_POS]); global_ddl_log.name_len= uint4korr(&file_entry_buf[DDL_LOG_NAME_LEN_POS]); global_ddl_log.handler_name_len= @@ -526,11 +524,12 @@ static bool init_ddl_log() sql_print_error("Failed to open ddl log file"); DBUG_RETURN(TRUE); } + global_ddl_log.inited= TRUE; if (write_ddl_log_header()) { + global_ddl_log.inited= FALSE; DBUG_RETURN(TRUE); } - global_ddl_log.inited= TRUE; DBUG_RETURN(FALSE); } @@ -776,7 +775,6 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, VOID(sync_ddl_log()); if (write_ddl_log_header()) error= TRUE; - VOID(sync_ddl_log()); } if (error) release_ddl_log_memory_entry(*active_entry); @@ -861,7 +859,6 @@ bool write_execute_ddl_log_entry(uint first_entry, release_ddl_log_memory_entry(*active_entry); DBUG_RETURN(TRUE); } - VOID(sync_ddl_log()); } DBUG_RETURN(FALSE); } @@ -1046,7 +1043,9 @@ bool execute_ddl_log_entry(THD *thd, uint first_entry) void execute_ddl_log_recovery() { uint num_entries, i; + THD *thd; DDL_LOG_ENTRY ddl_log_entry; + char file_name[FN_REFLEN]; DBUG_ENTER("execute_ddl_log_recovery"); /* @@ -1069,7 +1068,7 @@ void execute_ddl_log_recovery() } if (ddl_log_entry.entry_type == DDL_LOG_EXECUTE_CODE) { - if (execute_ddl_log_entry(ddl_log_entry.next_entry)) + if (execute_ddl_log_entry(thd, ddl_log_entry.next_entry)) { /* Real unpleasant scenario but we continue anyways. */ DBUG_ASSERT(0);