summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc31
-rw-r--r--storage/myisam/ha_myisam.cc21
2 files changed, 44 insertions, 8 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.
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 18f0c3b7f60..c997f03463a 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -2006,10 +2006,27 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
(ulonglong) 0);
create_info.data_file_length= ((ulonglong) share->max_rows *
share->avg_row_length);
- create_info.data_file_name= ha_create_info->data_file_name;
- create_info.index_file_name= ha_create_info->index_file_name;
create_info.language= share->table_charset->number;
+#ifdef HAVE_READLINK
+ if (my_use_symdir)
+ {
+ create_info.data_file_name= ha_create_info->data_file_name;
+ create_info.index_file_name= ha_create_info->index_file_name;
+ }
+ else
+#endif /* HAVE_READLINK */
+ {
+ if (ha_create_info->data_file_name)
+ push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "DATA DIRECTORY");
+ if (ha_create_info->index_file_name)
+ push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN,
+ WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+ "INDEX DIRECTORY");
+ }
+
if (ha_create_info->tmp_table())
create_flags|= HA_CREATE_TMP_TABLE | HA_CREATE_DELAY_KEY_WRITE;
if (ha_create_info->options & HA_CREATE_KEEP_FILES)