diff options
author | unknown <antony@pcg5ppc.xiphis.org> | 2008-03-14 11:13:54 -0700 |
---|---|---|
committer | unknown <antony@pcg5ppc.xiphis.org> | 2008-03-14 11:13:54 -0700 |
commit | 4801c682e73f032a9d0c2f16e27435e7a7191dd5 (patch) | |
tree | 8b48bb23a946e0bc0f25a78b76f73a06061f54c8 /sql/partition_info.cc | |
parent | 1bffc51066b2a79f03e4177f8103e5cc2320ca67 (diff) | |
parent | 269ebe54211cf96c4e64fa7268a1414588ca1de8 (diff) | |
download | mariadb-git-4801c682e73f032a9d0c2f16e27435e7a7191dd5.tar.gz |
Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1
into pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1
configure.in:
Auto merged
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/partition.result:
Auto merged
mysql-test/r/partition_symlink.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/partition_info.cc:
Auto merged
sql/partition_info.h:
Auto merged
sql/rpl_rli.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_show.cc:
Auto merged
mysql-test/r/symlink.result:
manual merge
mysql-test/suite/parts/inc/partition_basic.inc:
manual merge
mysql-test/suite/parts/r/partition_basic_innodb.result:
manual merge
mysql-test/suite/parts/r/partition_basic_myisam.result:
manual merge
mysql-test/t/partition_symlink.test:
manual merge
mysql-test/t/symlink.test:
manual merge
sql/sql_parse.cc:
manual merge
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 1d21a10beaa..e7f4d6a62c1 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -1265,4 +1265,60 @@ error: mem_alloc_error(size); DBUG_RETURN(TRUE); } + + +/* + Check if path does not contain mysql data home directory + for partition elements with data directory and index directory + + SYNOPSIS + check_partition_dirs() + part_info partition_info struct + + RETURN VALUES + 0 ok + 1 error +*/ + +bool check_partition_dirs(partition_info *part_info) +{ + if (!part_info) + return 0; + + partition_element *part_elem; + List_iterator<partition_element> part_it(part_info->partitions); + while ((part_elem= part_it++)) + { + if (part_elem->subpartitions.elements) + { + List_iterator<partition_element> sub_it(part_elem->subpartitions); + partition_element *subpart_elem; + while ((subpart_elem= sub_it++)) + { + if (test_if_data_home_dir(subpart_elem->data_file_name)) + goto dd_err; + if (test_if_data_home_dir(subpart_elem->index_file_name)) + goto id_err; + } + } + else + { + if (test_if_data_home_dir(part_elem->data_file_name)) + goto dd_err; + if (test_if_data_home_dir(part_elem->index_file_name)) + goto id_err; + } + } + return 0; + +dd_err: + my_error(ER_WRONG_ARGUMENTS,MYF(0),"DATA DIRECORY"); + return 1; + +id_err: + my_error(ER_WRONG_ARGUMENTS,MYF(0),"INDEX DIRECORY"); + return 1; +} + + #endif /* WITH_PARTITION_STORAGE_ENGINE */ |