From 6473c10445e5a150aa79c2f48c1ba4f2ab37d3c7 Mon Sep 17 00:00:00 2001 From: "mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se" <> Date: Fri, 21 Apr 2006 08:35:25 -0400 Subject: [PATCH] WL 2826: Error handling of ALTER TABLE for partitioning Final review fixes --- sql/mysql_priv.h | 6 ------ sql/sql_table.cc | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 694814aee5d..24014170590 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1282,9 +1282,6 @@ typedef struct st_ddl_log_memory_entry } DDL_LOG_MEMORY_ENTRY; - -#define DDL_LOG_HANDLER_TYPE_LEN 32 - bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, DDL_LOG_MEMORY_ENTRY **active_entry); bool write_execute_ddl_log_entry(uint first_entry, @@ -1474,9 +1471,6 @@ extern ulong delayed_insert_timeout; extern ulong delayed_insert_limit, delayed_queue_size; extern ulong delayed_insert_threads, delayed_insert_writes; extern ulong delayed_rows_in_use,delayed_insert_errors; -#ifdef ERROR_INJECT_SUPPORT -extern ulong error_inject_value; -#endif extern ulong slave_open_temp_tables; extern ulong query_cache_size, query_cache_min_res_unit; extern ulong slow_launch_threads, slow_launch_time; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9fb65451a70..1ed6e5c5cf2 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -764,20 +764,20 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, int4store(&global_ddl_log.file_entry_buf[DDL_LOG_NEXT_ENTRY_POS], ddl_log_entry->next_entry); DBUG_ASSERT(strlen(ddl_log_entry->name) < FN_LEN); - strncpy(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS], - ddl_log_entry->name, FN_LEN); + strmake(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS], + ddl_log_entry->name, FN_LEN - 1); if (ddl_log_entry->action_type == DDL_LOG_RENAME_ACTION || ddl_log_entry->action_type == DDL_LOG_REPLACE_ACTION) { DBUG_ASSERT(strlen(ddl_log_entry->from_name) < FN_LEN); - strncpy(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + FN_LEN], - ddl_log_entry->from_name, FN_LEN); + strmake(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + FN_LEN], + ddl_log_entry->from_name, FN_LEN - 1); } else global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + FN_LEN]= 0; DBUG_ASSERT(strlen(ddl_log_entry->handler_name) < FN_LEN); - strncpy(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + (2*FN_LEN)], - ddl_log_entry->handler_name, FN_LEN); + strmake(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + (2*FN_LEN)], + ddl_log_entry->handler_name, FN_LEN - 1); if (get_free_ddl_log_entry(active_entry, &write_header)) { DBUG_RETURN(TRUE);