summaryrefslogtreecommitdiff
path: root/storage/innobase/dict/dict0load.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2016-05-03 20:53:29 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2016-05-03 21:35:41 +0300
commit5dd0c77e9239217457cf795d6380bdd3bf0808ad (patch)
treeaa118e213bd34b417169a1348bdde71056711142 /storage/innobase/dict/dict0load.cc
parent80da57cc4f0c717ee3e01ac5abccc859b88a2fbf (diff)
downloadmariadb-git-5dd0c77e9239217457cf795d6380bdd3bf0808ad.tar.gz
MDEV-9362: InnoDB tables using DATA_DIRECTORY created using
MySQL 5.6 do not work with MariaDB 10.1 Analysis: Problem is that tablespace flags bit DATA_DIR is on different position on MySQL 5.6 compared to MariaDB 10.1. Fix: If we detect that there is difference between dictionary flags and tablespace flags we remove DATA_DIR flag and compare again. Remote tablespace is tried to locate even in case when DATA_DIR flag is not set.
Diffstat (limited to 'storage/innobase/dict/dict0load.cc')
-rw-r--r--storage/innobase/dict/dict0load.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index d8bd0a66ade..ce5b10a623c 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2241,8 +2242,9 @@ dict_get_and_save_data_dir_path(
bool dict_mutex_own) /*!< in: true if dict_sys->mutex
is owned already */
{
- if (DICT_TF_HAS_DATA_DIR(table->flags)
- && (!table->data_dir_path)) {
+ bool is_temp = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY);
+
+ if (!is_temp && !table->data_dir_path && table->space) {
char* path = fil_space_get_first_path(table->space);
if (!dict_mutex_own) {
@@ -2254,6 +2256,7 @@ dict_get_and_save_data_dir_path(
}
if (path) {
+ table->flags |= (1 << DICT_TF_POS_DATA_DIR);
dict_save_data_dir_path(table, path);
mem_free(path);
}
@@ -2394,16 +2397,14 @@ err_exit:
}
/* Use the remote filepath if needed. */
- if (DICT_TF_HAS_DATA_DIR(table->flags)) {
- /* This needs to be added to the table
- from SYS_DATAFILES */
- dict_get_and_save_data_dir_path(table, true);
+ /* This needs to be added to the tablex1
+ from SYS_DATAFILES */
+ dict_get_and_save_data_dir_path(table, true);
- if (table->data_dir_path) {
- filepath = os_file_make_remote_pathname(
+ if (table->data_dir_path) {
+ filepath = os_file_make_remote_pathname(
table->data_dir_path,
table->name, "ibd");
- }
}
/* Try to open the tablespace. We set the