diff options
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 87c056e7bae..b32bdd6c2bd 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2567,7 +2567,7 @@ int ha_partition::set_up_table_before_create(TABLE *tbl, partition_element *part_elem) { int error= 0; - const char *partition_name; + LEX_CSTRING part_name; THD *thd= ha_thd(); DBUG_ENTER("set_up_table_before_create"); @@ -2577,15 +2577,16 @@ int ha_partition::set_up_table_before_create(TABLE *tbl, DBUG_RETURN(1); tbl->s->max_rows= part_elem->part_max_rows; tbl->s->min_rows= part_elem->part_min_rows; - partition_name= strrchr(partition_name_with_path, FN_LIBCHAR); + part_name.str= strrchr(partition_name_with_path, FN_LIBCHAR)+1; + part_name.length= strlen(part_name.str); if ((part_elem->index_file_name && (error= append_file_to_dir(thd, (const char**)&part_elem->index_file_name, - partition_name+1))) || + &part_name))) || (part_elem->data_file_name && (error= append_file_to_dir(thd, (const char**)&part_elem->data_file_name, - partition_name+1)))) + &part_name)))) { DBUG_RETURN(error); } @@ -10789,10 +10790,8 @@ int ha_partition::check_for_upgrade(HA_CHECK_OPT *check_opt) partition_info::enum_key_algorithm old_algorithm; old_algorithm= m_part_info->key_algorithm; error= HA_ADMIN_FAILED; - append_identifier(ha_thd(), &db_name, table_share->db.str, - table_share->db.length); - append_identifier(ha_thd(), &table_name, table_share->table_name.str, - table_share->table_name.length); + append_identifier(ha_thd(), &db_name, &table_share->db); + append_identifier(ha_thd(), &table_name, &table_share->table_name); if (m_part_info->key_algorithm != partition_info::KEY_ALGORITHM_NONE) { /* |