From e20cbe27de0b97ad585cc9a6cb002ecff05dea8a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Feb 2006 11:08:08 +0100 Subject: WL 2826: Error handling of ALTER TABLE for partitioning Started writing detailed error handler of ALTER TABLE for partitioning. Philosophical issue, should one always attempt to make recovery automatic or should one rely on manual means also. sql/mysql_priv.h: Flag to ensure we can't be killed in a very critical spot sql/sql_base.cc: Flag to ensure we can't be killed in a very critical spot sql/sql_partition.cc: Started writing detailed error handler of ALTER TABLE for partitioning. Philosophical issue, should one always attempt to make recovery automatic or should one rely on manual means also. --- sql/sql_base.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 44b3a22ec52..707b593b044 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6107,7 +6107,8 @@ bool is_equal(const LEX_STRING *a, const LEX_STRING *b) old_lock_level Old lock level */ -bool abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt) +bool abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt, + bool can_be_killed) { uint flags= RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG; int error= FALSE; @@ -6117,7 +6118,7 @@ bool abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt) VOID(pthread_mutex_lock(&LOCK_open)); mysql_lock_abort(lpt->thd, lpt->table, TRUE); VOID(remove_table_from_cache(lpt->thd, lpt->db, lpt->table_name, flags)); - if (lpt->thd->killed) + if (can_be_killed && lpt->thd->killed) { lpt->thd->no_warnings_for_error= 0; error= TRUE; -- cgit v1.2.1 From 3928d9620fcf96adc94c2d13a7fd216c338eb928 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Mar 2006 18:19:13 -0500 Subject: WL 2826: Error handling of ALTER TABLE for partitioning Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter Fixed mysqlish method intro's Fixed warning statements 5.1.7 was released still with partition states in clear text Fixed io_size bug Fixed bug in open that TRUNCATED before reading :) file_entry => file_entry_buf Don't open DDL log until first write call to DDL log handler_type => handler_name no => num sql/ha_partition.cc: Loads of review comments fixed inactivate => deactivate table log => ddl log sql/mysql_priv.h: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter sql/mysqld.cc: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter sql/partition_element.h: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter sql/partition_info.h: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter sql/share/errmsg.txt: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter sql/sql_base.cc: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter sql/sql_partition.cc: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter Fixed mysqlish method intro's Fixed warning statements sql/sql_table.cc: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter Fixed mysqlish method intro's Fixed warning statements Fixed io_size bug Fixed bug in open that TRUNCATED before reading :) file_entry => file_entry_buf Don't open DDL log until first write call to DDL log handler_type => handler_name no => num sql/table.cc: Loads of review comments fixed inactivate => deactivate table log => ddl log Commented on Error Inject Module added Put various #defines into enums Fixed abort_and_upgrade_lock, removed unnecessary parameter Fixed mysqlish method intro's Fixed warning statements 5.1.7 was released still with partition states in clear text Fixed io_size bug Fixed bug in open that TRUNCATED before reading :) file_entry => file_entry_buf Don't open DDL log until first write call to DDL log handler_type => handler_name no => num --- sql/sql_base.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 5419416ef3c..ed893f35aec 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6124,24 +6124,17 @@ bool is_equal(const LEX_STRING *a, const LEX_STRING *b) old_lock_level Old lock level */ -bool abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt, - bool can_be_killed) +void abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt) { uint flags= RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG; - int error= FALSE; DBUG_ENTER("abort_and_upgrade_locks"); lpt->old_lock_type= lpt->table->reginfo.lock_type; VOID(pthread_mutex_lock(&LOCK_open)); mysql_lock_abort(lpt->thd, lpt->table, TRUE); VOID(remove_table_from_cache(lpt->thd, lpt->db, lpt->table_name, flags)); - if (can_be_killed && lpt->thd->killed) - { - lpt->thd->no_warnings_for_error= 0; - error= TRUE; - } VOID(pthread_mutex_unlock(&LOCK_open)); - DBUG_RETURN(error); + DBUG_VOID_RETURN; } -- cgit v1.2.1