diff options
author | Michael Widenius <monty@mariadb.org> | 2014-03-23 17:00:29 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2014-03-23 17:00:29 +0200 |
commit | 39e6083e35459c9c8b22d37aaa2b74545884c7b0 (patch) | |
tree | d2173f06d0676cf55be448632ceae58f18a2ff56 /storage/archive | |
parent | 6214f4e51ccfc2c8cbb82549559e61f4a436996b (diff) | |
download | mariadb-git-39e6083e35459c9c8b22d37aaa2b74545884c7b0.tar.gz |
MDEV-5818: MySQL WL#6145: Separate the dependence of DATA DIRECTORY from symbolic links
Copied relevant test cases and code from the MySQL 5.6 tree
Testing of my_use_symdir moved to engines.
mysql-test/r/partition_windows.result:
Updated result file
mysql-test/suite/archive/archive_no_symlink-master.opt:
Testing of symlinks with archive
mysql-test/suite/archive/archive_no_symlink.result:
Testing of symlinks with archive
mysql-test/suite/archive/archive_no_symlink.test:
Testing of symlinks with archive
mysql-test/suite/archive/archive_symlink.result:
Testing of symlinks with archive
mysql-test/suite/archive/archive_symlink.test:
Testing of symlinks with archive
sql/log_event.cc:
Updated comment
sql/partition_info.cc:
Don't test my_use_symdir here
sql/sql_parse.cc:
Updated comment
sql/sql_table.cc:
Don't test my_use_symdir here
sql/table.cc:
Added more DBUG_PRINT
storage/archive/ha_archive.cc:
Give warnings for index_file_name and if we can't use data directory
storage/myisam/ha_myisam.cc:
Give warnings if we can't use data directory or index directory
Diffstat (limited to 'storage/archive')
-rw-r--r-- | storage/archive/ha_archive.cc | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index b30f1339510..fe6b611d1c6 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -104,7 +104,6 @@ >5.1.15 - v.3 */ - /* The file extension */ #define ARZ ".ARZ" // The data file #define ARN ".ARN" // Files used during an optimize call @@ -171,14 +170,14 @@ static void init_archive_psi_keys(void) const char* category= "archive"; int count; - if (PSI_server == NULL) + if (!PSI_server) return; - + count= array_elements(all_archive_mutexes); - PSI_server->register_mutex(category, all_archive_mutexes, count); + mysql_mutex_register(category, all_archive_mutexes, count); count= array_elements(all_archive_files); - PSI_server->register_file(category, all_archive_files, count); + mysql_file_register(category, all_archive_files, count); } #endif /* HAVE_PSI_INTERFACE */ @@ -765,7 +764,10 @@ int ha_archive::create(const char *name, TABLE *table_arg, /* We reuse name_buff since it is available. */ - if (create_info->data_file_name && create_info->data_file_name[0] != '#') +#ifdef HAVE_READLINK + if (my_use_symdir && + create_info->data_file_name && + create_info->data_file_name[0] != '#') { DBUG_PRINT("ha_archive", ("archive will create stream file %s", create_info->data_file_name)); @@ -776,12 +778,29 @@ int ha_archive::create(const char *name, TABLE *table_arg, MY_REPLACE_EXT | MY_UNPACK_FILENAME); } else +#endif /* HAVE_READLINK */ { + if (create_info->data_file_name) + { + push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, + ER_DEFAULT(WARN_OPTION_IGNORED), + "DATA DIRECTORY"); + } fn_format(name_buff, name, "", ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME); linkname[0]= 0; } + /* Archive engine never uses INDEX DIRECTORY. */ + if (create_info->index_file_name) + { + push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, + ER_DEFAULT(WARN_OPTION_IGNORED), + "INDEX DIRECTORY"); + } + /* There is a chance that the file was "discovered". In this case just use whatever file is there. |