1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

bug #14354 - data directory and index directory not working for partitions

mysql-test/r/partition_mgm_err.result:
  only the single drop table since we have disabled query logging for the create table
mysql-test/t/partition_mgm_err.test:
  test for bug #14354
  first make sure /tmp/bug14354 is not there, then make the dir
  create a partitioned table with the partition using
  /tmp/bug14354 as it's data dir
  we are disabling query logging since we are using $MYSQL_TEST_DIR
  and we are not certain where the tmp files will be created.
sql/ha_partition.cc:
  pass partition filename with pathname into 
  set_up_table_before_create.
  
  remove the path from the passed in value and then append the filename
  to the data_file_name or index_file_name if those values were
  specified.
sql/ha_partition.h:
  added partition_name_with_path to set_up_table_before_create
sql/mysql_priv.h:
  move append_file_to_dir to mysql_priv.h
sql/sql_parse.cc:
  moving append_file_to_dir to mysql_priv.h
sql/sql_partition.cc:
  add_keyword_string was not writing keyword value with quotes
This commit is contained in:
unknown
2006-01-23 23:20:23 -06:00
parent 20d0d10ea2
commit f37545521b
7 changed files with 50 additions and 13 deletions

View File

@@ -1936,13 +1936,18 @@ static int add_int(File fptr, longlong number)
}
static int add_keyword_string(File fptr, const char *keyword,
bool should_use_quotes,
const char *keystr)
{
int err= add_string(fptr, keyword);
err+= add_space(fptr);
err+= add_equal(fptr);
err+= add_space(fptr);
if (should_use_quotes)
err+= add_string(fptr, "'");
err+= add_string(fptr, keystr);
if (should_use_quotes)
err+= add_string(fptr, "'");
return err + add_space(fptr);
}
@@ -1968,7 +1973,8 @@ static int add_partition_options(File fptr, partition_element *p_elem)
{
int err= 0;
if (p_elem->tablespace_name)
err+= add_keyword_string(fptr,"TABLESPACE",p_elem->tablespace_name);
err+= add_keyword_string(fptr,"TABLESPACE", FALSE,
p_elem->tablespace_name);
if (p_elem->nodegroup_id != UNDEF_NODEGROUP)
err+= add_keyword_int(fptr,"NODEGROUP",(longlong)p_elem->nodegroup_id);
if (p_elem->part_max_rows)
@@ -1976,11 +1982,13 @@ static int add_partition_options(File fptr, partition_element *p_elem)
if (p_elem->part_min_rows)
err+= add_keyword_int(fptr,"MIN_ROWS",(longlong)p_elem->part_min_rows);
if (p_elem->data_file_name)
err+= add_keyword_string(fptr,"DATA DIRECTORY",p_elem->data_file_name);
err+= add_keyword_string(fptr, "DATA DIRECTORY", TRUE,
p_elem->data_file_name);
if (p_elem->index_file_name)
err+= add_keyword_string(fptr,"INDEX DIRECTORY",p_elem->index_file_name);
err+= add_keyword_string(fptr, "INDEX DIRECTORY", TRUE,
p_elem->index_file_name);
if (p_elem->part_comment)
err+= add_keyword_string(fptr, "COMMENT",p_elem->part_comment);
err+= add_keyword_string(fptr, "COMMENT", FALSE, p_elem->part_comment);
return err + add_engine(fptr,p_elem->engine_type);
}