Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron 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.2126 06/02/13 13:52:23 mikron@stripped +3 -0
WL 2826: Error handling of ALTER TABLE for partitioning
Introduce log entry to handle replace of frm file
sql/sql_table.cc
1.316 06/02/13 13:52:10 mikron@stripped +5 -0
Introduce log entry to handle replace of frm file
sql/sql_partition.cc
1.47 06/02/13 13:52:10 mikron@stripped +14 -8
Introduce log entry to handle replace of frm file
sql/handler.h
1.189 06/02/13 13:52:10 mikron@stripped +2 -1
Introduce log entry to handle replace of frm file
# 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: mikron
# Host: mikael-ronstr-ms-dator.local
# Root: /Users/mikron/wl2826
--- 1.188/sql/handler.h 2006-02-11 06:41:35 +01:00
+++ 1.189/sql/handler.h 2006-02-13 13:52:10 +01:00
@@ -852,6 +852,7 @@
st_table_log_memory_entry *first_log_entry;
st_table_log_memory_entry *exec_log_entry;
+ st_table_log_memory_entry *frm_log_entry;
/*
A bitmap of partitions used by the current query.
Usage pattern:
@@ -963,7 +964,7 @@
part_field_array(NULL), subpart_field_array(NULL),
full_part_field_array(NULL),
part_expr(NULL), subpart_expr(NULL), item_free_list(NULL),
- first_log_entry(NULL), exec_log_entry(NULL),
+ first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL),
list_array(NULL),
part_info_string(NULL),
part_func_string(NULL), subpart_func_string(NULL),
--- 1.315/sql/sql_table.cc 2006-02-11 06:41:38 +01:00
+++ 1.316/sql/sql_table.cc 2006-02-13 13:52:10 +01:00
@@ -1136,12 +1136,17 @@
*/
VOID(pthread_mutex_lock(&LOCK_open));
if (my_delete(frm_name, MYF(MY_WME)) ||
+ inactivate_table_log_entry(part_info->frm_log_entry->entry_pos) ||
+ sync_table_log() ||
my_rename(shadow_frm_name, frm_name, MYF(MY_WME)) ||
lpt->table->file->create_handler_files(path, shadow_path, TRUE))
{
error= 1;
}
VOID(pthread_mutex_unlock(&LOCK_open));
+ inactivate_table_log_entry(part_info->frm_log_entry->entry_pos);
+ part_info->frm_log_entry= NULL;
+ VOID(sync_table_log());
}
end:
--- 1.46/sql/sql_partition.cc 2006-02-11 06:41:37 +01:00
+++ 1.47/sql/sql_partition.cc 2006-02-13 13:52:10 +01:00
@@ -5109,7 +5109,7 @@
/*
Log an delete/rename frm file
SYNOPSIS
- write_log_rename_delete_frm()
+ write_log_replace_delete_frm()
lpt Struct for parameters
next_entry Next reference to use in log record
path Name to rename from
@@ -5118,30 +5118,30 @@
TRUE Error
FALSE Success
DESCRIPTION
- Support routine that writes a rename or delete of an frm file into the
+ Support routine that writes a replace or delete of an frm file into the
table log. It also inserts an entry that keeps track of used space into
the partition info object
*/
bool
-write_log_rename_delete_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
+write_log_replace_delete_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
uint next_entry,
const char *from_path,
const char *to_path,
- bool rename_flag)
+ bool replace_flag)
{
TABLE_LOG_ENTRY table_log_entry;
TABLE_LOG_MEMORY_ENTRY *log_entry;
- DBUG_ENTER("write_log_rename_frm");
+ DBUG_ENTER("write_log_replace_frm");
- if (rename_flag)
- table_log_entry.action_type= TLOG_RENAME_ACTION_CODE;
+ if (replace_flag)
+ table_log_entry.action_type= TLOG_REPLACE_ACTION_CODE;
else
table_log_entry.action_type= TLOG_DELETE_ACTION_CODE;
table_log_entry.next_entry= next_entry;
table_log_entry.handler_type= "frm";
table_log_entry.name= to_path;
- if (rename_flag)
+ if (replace_flag)
table_log_entry.from_name= from_path;
if (write_table_log_entry(&table_log_entry, &log_entry))
{
@@ -5468,6 +5468,7 @@
if (write_log_rename_delete_frm(lpt, 0UL, path, shadow_path, FALSE))
break;
log_entry= part_info->first_log_entry;
+ part_info->frm_log_entry= log_entry;
if (write_execute_table_log_entry(log_entry->entry_pos,
FALSE, &exec_log_entry))
break;
@@ -5478,6 +5479,7 @@
release_part_info_log_entries(part_info->first_log_entry);
unlock_global_table_log();
part_info->first_log_entry= old_first_log_entry;
+ part_info->frm_log_entry= NULL;
my_error(ER_TABLE_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
@@ -5527,6 +5529,7 @@
(const char*)tmp_path, TRUE))
break;
log_entry= part_info->first_log_entry;
+ part_info->frm_log_entry= log_entry;
if (write_execute_table_log_entry(log_entry->entry_pos,
FALSE, &exec_log_entry))
break;
@@ -5537,6 +5540,7 @@
release_part_info_log_entries(part_info->first_log_entry);
unlock_global_table_log();
part_info->first_log_entry= old_first_log_entry;
+ part_info->frm_log_entry= NULL;
my_error(ER_TABLE_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
@@ -5646,6 +5650,7 @@
if (write_log_rename_delete_frm(lpt, 0UL, path, shadow_path, FALSE))
break;
log_entry= part_info->first_log_entry;
+ part_info->frm_log_entry= log_entry;
if (write_execute_table_log_entry(log_entry->entry_pos,
FALSE, &exec_log_entry))
break;
@@ -5656,6 +5661,7 @@
release_part_info_log_entries(part_info->first_log_entry);
unlock_global_table_log();
part_info->first_log_entry= old_first_log_entry;
+ part_info->frm_log_entry= NULL;
my_error(ER_TABLE_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
| Thread |
|---|
| • bk commit into 5.1 tree (mikron:1.2126) | mikael | 13 Feb |