From a5b43381fe44144bb878b0084f5f811eebdaefb9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Aug 2006 09:05:15 -0400 Subject: [PATCH] BUG#21350: Fix correct error handling when using DATA DIRECTORY and INDEX DIRECTORY Review fixes --- sql/ha_partition.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 40ff3239b6f..1d7d83a3e92 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1752,6 +1752,8 @@ int ha_partition::set_up_table_before_create(TABLE *table, partition_element *part_elem) { int error= 0; + const char *partition_name; + THD *thd= current_thd; DBUG_ENTER("set_up_table_before_create"); if (!part_elem) @@ -1762,17 +1764,16 @@ int ha_partition::set_up_table_before_create(TABLE *table, } table->s->max_rows= part_elem->part_max_rows; table->s->min_rows= part_elem->part_min_rows; - const char *partition_name= strrchr(partition_name_with_path, FN_LIBCHAR); + partition_name= strrchr(partition_name_with_path, FN_LIBCHAR); if ((part_elem->index_file_name && - (error= append_file_to_dir(current_thd, + (error= append_file_to_dir(thd, (const char**)&part_elem->index_file_name, partition_name+1))) || (part_elem->data_file_name && - (error= append_file_to_dir(current_thd, + (error= append_file_to_dir(thd, (const char**)&part_elem->data_file_name, partition_name+1)))) { - DBUG_ASSERT(error); DBUG_RETURN(error); } info->index_file_name= part_elem->index_file_name;