summaryrefslogtreecommitdiff
path: root/storage/xtradb/fil/fil0fil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/fil/fil0fil.cc')
-rw-r--r--storage/xtradb/fil/fil0fil.cc59
1 files changed, 47 insertions, 12 deletions
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 2da234ad094..80312d97e01 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
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
@@ -719,16 +719,23 @@ fil_node_open_file(
}
if (UNIV_UNLIKELY(space->flags != flags)) {
- fprintf(stderr,
- "InnoDB: Error: table flags are 0x%lx"
- " in the data dictionary\n"
- "InnoDB: but the flags in file %s are 0x%lx!\n",
- space->flags, node->name, flags);
+ ulint sflags = (space->flags & ~FSP_FLAGS_MASK_DATA_DIR);
+ ulint fflags = (flags & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE);
- ut_error;
- }
+ /* DATA_DIR option is on different place on MariaDB
+ compared to MySQL. If this is the difference. Fix
+ it. */
+
+ if (sflags == fflags) {
+ fprintf(stderr,
+ "InnoDB: Warning: Table flags 0x%lx"
+ " in the data dictionary but in file %s are 0x%lx!\n"
+ " Temporally corrected because DATA_DIR option to 0x%lx.\n",
+ space->flags, node->name, flags, space->flags);
+
+ flags = space->flags;
+ }
- if (UNIV_UNLIKELY(space->flags != flags)) {
if (!dict_tf_verify_flags(space->flags, flags)) {
fprintf(stderr,
"InnoDB: Error: table flags are 0x%lx"
@@ -3829,8 +3836,18 @@ fil_open_single_table_tablespace(
/* Validate this single-table-tablespace with SYS_TABLES,
but do not compare the DATA_DIR flag, in case the
tablespace was relocated. */
+
+ ulint newf = def.flags;
+ if (newf != mod_flags) {
+ if (FSP_FLAGS_HAS_DATA_DIR(newf)) {
+ newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR);
+ } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) {
+ newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE);
+ }
+ }
+
if (def.valid && def.id == id
- && (def.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) {
+ && newf == mod_flags) {
valid_tablespaces_found++;
} else {
def.valid = false;
@@ -3855,8 +3872,17 @@ fil_open_single_table_tablespace(
/* Validate this single-table-tablespace with SYS_TABLES,
but do not compare the DATA_DIR flag, in case the
tablespace was relocated. */
+ ulint newf = remote.flags;
+ if (newf != mod_flags) {
+ if (FSP_FLAGS_HAS_DATA_DIR(newf)) {
+ newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR);
+ } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) {
+ newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE);
+ }
+ }
+
if (remote.valid && remote.id == id
- && (remote.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) {
+ && newf == mod_flags) {
valid_tablespaces_found++;
} else {
remote.valid = false;
@@ -3882,8 +3908,17 @@ fil_open_single_table_tablespace(
/* Validate this single-table-tablespace with SYS_TABLES,
but do not compare the DATA_DIR flag, in case the
tablespace was relocated. */
+ ulint newf = dict.flags;
+ if (newf != mod_flags) {
+ if (FSP_FLAGS_HAS_DATA_DIR(newf)) {
+ newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR);
+ } else if(FSP_FLAGS_HAS_DATA_DIR_ORACLE(newf)) {
+ newf = (newf & ~FSP_FLAGS_MASK_DATA_DIR_ORACLE);
+ }
+ }
+
if (dict.valid && dict.id == id
- && (dict.flags & ~FSP_FLAGS_MASK_DATA_DIR) == mod_flags) {
+ && newf == mod_flags) {
valid_tablespaces_found++;
} else {
dict.valid = false;