Commit 07b25239 authored by Sergei Golubchik's avatar Sergei Golubchik

rename a handler method to more precisely reflect what kind of a hack it does

parent 5d364e53
......@@ -511,7 +511,7 @@ int ha_partition::rename_table(const char *from, const char *to)
Create the handler file (.par-file)
SYNOPSIS
create_handler_files()
create_partitioning_metadata()
name Full path of table name
create_info Create info generated for CREATE TABLE
......@@ -520,19 +520,19 @@ int ha_partition::rename_table(const char *from, const char *to)
0 Success
DESCRIPTION
create_handler_files is called to create any handler specific files
create_partitioning_metadata is called to create any handler specific files
before opening the file with openfrm to later call ::create on the
file object.
In the partition handler this is used to store the names of partitions
and types of engines in the partitions.
*/
int ha_partition::create_handler_files(const char *path,
int ha_partition::create_partitioning_metadata(const char *path,
const char *old_path,
int action_flag,
HA_CREATE_INFO *create_info)
{
DBUG_ENTER("ha_partition::create_handler_files()");
DBUG_ENTER("ha_partition::create_partitioning_metadata()");
/*
We need to update total number of parts since we might write the handler
......
......@@ -229,7 +229,7 @@ public:
chance for the handler to add any interesting comments to the table
comments not provided by the users comment.
create_handler_files is called before opening a new handler object
create_partitioning_metadata is called before opening a new handler object
with openfrm to call create. It is used to create any local handler
object needed in opening the object in openfrm
-------------------------------------------------------------------------
......@@ -238,7 +238,7 @@ public:
virtual int rename_table(const char *from, const char *to);
virtual int create(const char *name, TABLE *form,
HA_CREATE_INFO *create_info);
virtual int create_handler_files(const char *name,
virtual int create_partitioning_metadata(const char *name,
const char *old_name, int action_flag,
HA_CREATE_INFO *create_info);
virtual void update_create_info(HA_CREATE_INFO *create_info);
......
......@@ -3835,16 +3835,16 @@ handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info)
/**
Create handler files for CREATE TABLE: public interface.
@sa handler::create_handler_files()
@sa handler::create_partitioning_metadata()
*/
int
handler::ha_create_handler_files(const char *name, const char *old_name,
handler::ha_create_partitioning_metadata(const char *name, const char *old_name,
int action_flag, HA_CREATE_INFO *info)
{
mark_trx_read_write();
return create_handler_files(name, old_name, action_flag, info);
return create_partitioning_metadata(name, old_name, action_flag, info);
}
......
......@@ -2063,7 +2063,7 @@ public:
int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info);
int ha_create_handler_files(const char *name, const char *old_name,
int ha_create_partitioning_metadata(const char *name, const char *old_name,
int action_flag, HA_CREATE_INFO *info);
int ha_change_partitions(HA_CREATE_INFO *create_info,
......@@ -3003,7 +3003,7 @@ private:
virtual void drop_table(const char *name);
virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0;
virtual int create_handler_files(const char *name, const char *old_name,
virtual int create_partitioning_metadata(const char *name, const char *old_name,
int action_flag, HA_CREATE_INFO *info)
{ return FALSE; }
......
......@@ -1707,7 +1707,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
lpt->table_name, lpt->create_info,
lpt->alter_info->create_list, lpt->key_count,
lpt->key_info_buffer, lpt->table->file)) ||
lpt->table->file->ha_create_handler_files(shadow_path, NULL,
lpt->table->file->ha_create_partitioning_metadata(shadow_path, NULL,
CHF_CREATE_FLAG,
lpt->create_info))
{
......@@ -1760,13 +1760,13 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
*/
if (mysql_file_delete(key_file_frm, frm_name, MYF(MY_WME)) ||
#ifdef WITH_PARTITION_STORAGE_ENGINE
lpt->table->file->ha_create_handler_files(path, shadow_path,
lpt->table->file->ha_create_partitioning_metadata(path, shadow_path,
CHF_DELETE_FLAG, NULL) ||
deactivate_ddl_log_entry(part_info->frm_log_entry->entry_pos) ||
(sync_ddl_log(), FALSE) ||
mysql_file_rename(key_file_frm,
shadow_frm_name, frm_name, MYF(MY_WME)) ||
lpt->table->file->ha_create_handler_files(path, shadow_path,
lpt->table->file->ha_create_partitioning_metadata(path, shadow_path,
CHF_RENAME_FLAG, NULL))
#else
mysql_file_rename(key_file_frm,
......@@ -4029,7 +4029,7 @@ static bool check_if_created_table_can_be_opened(THD *thd,
/*
It is impossible to open definition of partitioned table without .par file.
*/
if (file->ha_create_handler_files(path, NULL, CHF_CREATE_FLAG, create_info))
if (file->ha_create_partitioning_metadata(path, NULL, CHF_CREATE_FLAG, create_info))
return TRUE;
init_tmp_table_share(thd, &share, db, 0, table_name, path);
......@@ -4041,7 +4041,7 @@ static bool check_if_created_table_can_be_opened(THD *thd,
(void) closefrm(&table, 0);
free_table_share(&share);
(void) file->ha_create_handler_files(path, NULL, CHF_DELETE_FLAG, create_info);
(void) file->ha_create_partitioning_metadata(path, NULL, CHF_DELETE_FLAG, create_info);
return result;
}
#endif
......@@ -7197,7 +7197,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
/* Tell the handler that a new frm file is in place. */
error= t_table_list->table->file->ha_create_handler_files(path, NULL,
error= t_table_list->table->file->ha_create_partitioning_metadata(path, NULL,
CHF_INDEX_FLAG,
create_info);
......
......@@ -476,14 +476,14 @@ int rea_create_table(THD *thd, const char *path,
if (thd->variables.keep_files_on_create)
create_info->options|= HA_CREATE_KEEP_FILES;
if (!create_info->frm_only &&
(file->ha_create_handler_files(path, NULL, CHF_CREATE_FLAG,
(file->ha_create_partitioning_metadata(path, NULL, CHF_CREATE_FLAG,
create_info) ||
ha_create_table(thd, path, db, table_name, create_info, 0)))
goto err_handler;
DBUG_RETURN(0);
err_handler:
(void) file->ha_create_handler_files(path, NULL, CHF_DELETE_FLAG, create_info);
(void) file->ha_create_partitioning_metadata(path, NULL, CHF_DELETE_FLAG, create_info);
mysql_file_delete(key_file_frm, frm_name, MYF(0));
DBUG_RETURN(1);
} /* rea_create_table */
......
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