Commit f99f322e authored by unknown's avatar unknown

Bug fixes + debug stuff

parent 8a0f12a1
...@@ -5450,7 +5450,8 @@ bool ...@@ -5450,7 +5450,8 @@ bool
write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
{ {
partition_info *part_info= lpt->part_info; partition_info *part_info= lpt->part_info;
TABLE_LOG_MEMORY_ENTRY *log_entry, *exec_log_entry; TABLE_LOG_MEMORY_ENTRY *log_entry;
TABLE_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
char tmp_path[FN_LEN]; char tmp_path[FN_LEN];
char path[FN_LEN]; char path[FN_LEN];
uint next_entry= 0; uint next_entry= 0;
...@@ -5779,7 +5780,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ...@@ -5779,7 +5780,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH("crash_drop_partition_2") || ERROR_INJECT_CRASH("crash_drop_partition_2") ||
write_log_drop_partition(lpt) || write_log_drop_partition(lpt) ||
ERROR_INJECT_CRASH("crash_drop_partition_3") || ERROR_INJECT_CRASH("crash_drop_partition_3") ||
(not_completed= FALSE) || ((not_completed= FALSE), FALSE) ||
abort_and_upgrade_lock(lpt) || abort_and_upgrade_lock(lpt) ||
((!thd->lex->no_write_to_binlog) && ((!thd->lex->no_write_to_binlog) &&
(write_bin_log(thd, FALSE, (write_bin_log(thd, FALSE,
...@@ -5796,6 +5797,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ...@@ -5796,6 +5797,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH("crash_drop_partition_8") || ERROR_INJECT_CRASH("crash_drop_partition_8") ||
(mysql_wait_completed_table(lpt, table), FALSE)) (mysql_wait_completed_table(lpt, table), FALSE))
{ {
abort();
if (!not_completed) if (!not_completed)
abort(); abort();
fast_alter_partition_error_handler(lpt); fast_alter_partition_error_handler(lpt);
...@@ -5845,7 +5847,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ...@@ -5845,7 +5847,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
thd->query, thd->query_length), FALSE)) || thd->query, thd->query_length), FALSE)) ||
ERROR_INJECT_CRASH("crash_add_partition_4") || ERROR_INJECT_CRASH("crash_add_partition_4") ||
write_log_rename_frm(lpt) || write_log_rename_frm(lpt) ||
(not_completed= FALSE) || ((not_completed= FALSE), FALSE) ||
ERROR_INJECT_CRASH("crash_add_partition_5") || ERROR_INJECT_CRASH("crash_add_partition_5") ||
mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) || mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
ERROR_INJECT_CRASH("crash_add_partition_6") || ERROR_INJECT_CRASH("crash_add_partition_6") ||
...@@ -5853,6 +5855,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ...@@ -5853,6 +5855,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
write_log_completed(lpt) || write_log_completed(lpt) ||
ERROR_INJECT_CRASH("crash_add_partition_7")) ERROR_INJECT_CRASH("crash_add_partition_7"))
{ {
abort();
if (!not_completed) if (!not_completed)
abort(); abort();
fast_alter_partition_error_handler(lpt); fast_alter_partition_error_handler(lpt);
...@@ -5923,7 +5926,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ...@@ -5923,7 +5926,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH("crash_change_partition_3") || ERROR_INJECT_CRASH("crash_change_partition_3") ||
write_log_final_change_partition(lpt) || write_log_final_change_partition(lpt) ||
ERROR_INJECT_CRASH("crash_change_partition_4") || ERROR_INJECT_CRASH("crash_change_partition_4") ||
(not_completed= FALSE) || ((not_completed= FALSE), FALSE) ||
abort_and_upgrade_lock(lpt) || abort_and_upgrade_lock(lpt) ||
((!thd->lex->no_write_to_binlog) && ((!thd->lex->no_write_to_binlog) &&
(write_bin_log(thd, FALSE, (write_bin_log(thd, FALSE,
...@@ -5943,6 +5946,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ...@@ -5943,6 +5946,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH("crash_change_partition_11") || ERROR_INJECT_CRASH("crash_change_partition_11") ||
(mysql_wait_completed_table(lpt, table), FALSE)) (mysql_wait_completed_table(lpt, table), FALSE))
{ {
abort();
if (!not_completed) if (!not_completed)
abort(); abort();
fast_alter_partition_error_handler(lpt); fast_alter_partition_error_handler(lpt);
......
...@@ -641,14 +641,19 @@ write_table_log_entry(TABLE_LOG_ENTRY *table_log_entry, ...@@ -641,14 +641,19 @@ write_table_log_entry(TABLE_LOG_ENTRY *table_log_entry,
global_table_log.file_entry[1]= table_log_entry->action_type; global_table_log.file_entry[1]= table_log_entry->action_type;
int4store(&global_table_log.file_entry[2], int4store(&global_table_log.file_entry[2],
table_log_entry->next_entry); table_log_entry->next_entry);
strcpy(&global_table_log.file_entry[6], table_log_entry->name); DBUG_ASSERT(strlen(table_log_entry->name) < FN_LEN);
strncpy(&global_table_log.file_entry[6], table_log_entry->name, FN_LEN);
if (table_log_entry->action_type == 'r') if (table_log_entry->action_type == 'r')
strcpy(&global_table_log.file_entry[6 + FN_LEN], {
table_log_entry->from_name); DBUG_ASSERT(strlen(table_log_entry->from_name) < FN_LEN);
strncpy(&global_table_log.file_entry[6 + FN_LEN],
table_log_entry->from_name, FN_LEN);
}
else else
global_table_log.file_entry[6 + FN_LEN]= 0; global_table_log.file_entry[6 + FN_LEN]= 0;
strcpy(&global_table_log.file_entry[6 + (2*FN_LEN)], DBUG_ASSERT(strlen(table_log_entry->handler_type) < FN_LEN);
table_log_entry->handler_type); strncpy(&global_table_log.file_entry[6 + (2*FN_LEN)],
table_log_entry->handler_type, FN_LEN);
if (get_free_table_log_entry(active_entry, &write_header)) if (get_free_table_log_entry(active_entry, &write_header))
{ {
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment