summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorbin.x.su@oracle.com <>2013-06-25 09:42:54 +0800
committerbin.x.su@oracle.com <>2013-06-25 09:42:54 +0800
commit7b66df16a1ca00084ee6336aaf50d32f914e625c (patch)
treeabed41b4e45e9bbebb1781a51bd3c1ca590c2a2a /storage/innobase/include
parentb31a7ebe2f7d6dd6ca1a14faf4c89dcc11c8687a (diff)
downloadmariadb-git-7b66df16a1ca00084ee6336aaf50d32f914e625c.tar.gz
Bug 16876388 - PLEASE BACKPORT BUG#16208542 TO 5.5
Straight forward backport. Approved by Jimmy, rb#2656
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/dict0dict.h29
-rw-r--r--storage/innobase/include/dict0dict.ic40
-rw-r--r--storage/innobase/include/dict0load.h14
-rw-r--r--storage/innobase/include/dict0types.h2
4 files changed, 31 insertions, 54 deletions
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 7b55a59ea19..deabbfcbe92 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -328,9 +328,11 @@ UNIV_INTERN
ulint
dict_foreign_add_to_cache(
/*======================*/
- dict_foreign_t* foreign, /*!< in, own: foreign key constraint */
- ibool check_charsets);/*!< in: TRUE=check charset
- compatibility */
+ dict_foreign_t* foreign, /*!< in, own: foreign key
+ constraint */
+ ibool check_charsets, /*!< in: TRUE=check charset
+ compatibility */
+ dict_err_ignore_t ignore_err); /*!< in: error to be ignored */
/*********************************************************************//**
Check if the index is referenced by a foreign key, if TRUE return the
matching instance NULL otherwise.
@@ -426,10 +428,14 @@ UNIV_INTERN
dict_table_t*
dict_table_get(
/*===========*/
- const char* table_name, /*!< in: table name */
- ibool inc_mysql_count);
+ const char* table_name,
+ /*!< in: table name */
+ ibool inc_mysql_count,
/*!< in: whether to increment the open
handle count on the table */
+ dict_err_ignore_t ignore_err);
+ /*!< in: errors to ignore when loading
+ the table */
/**********************************************************************//**
Returns a index object, based on table and index id, and memoryfixes it.
@return index, NULL if does not exist */
@@ -454,22 +460,13 @@ function.
@return table, NULL if not found */
UNIV_INLINE
dict_table_t*
-dict_table_get_low_ignore_err(
-/*===========================*/
+dict_table_get_low(
+/*===============*/
const char* table_name, /*!< in: table name */
dict_err_ignore_t
ignore_err); /*!< in: error to be ignored when
loading a table definition */
/**********************************************************************//**
-Gets a table; loads it to the dictionary cache if necessary. A low-level
-function.
-@return table, NULL if not found */
-UNIV_INLINE
-dict_table_t*
-dict_table_get_low(
-/*===============*/
- const char* table_name); /*!< in: table name */
-/**********************************************************************//**
Returns a table object based on table id.
@return table, NULL if does not exist */
UNIV_INLINE
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index faa28959c59..9b0c9e5c001 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2013, Oracle and/or its affiliates. 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
@@ -816,34 +816,6 @@ dict_table_check_if_in_cache_low(
}
/**********************************************************************//**
-load a table into dictionary cache, ignore any error specified during load;
-@return table, NULL if not found */
-UNIV_INLINE
-dict_table_t*
-dict_table_get_low_ignore_err(
-/*==========================*/
- const char* table_name, /*!< in: table name */
- dict_err_ignore_t
- ignore_err) /*!< in: error to be ignored when
- loading a table definition */
-{
- dict_table_t* table;
-
- ut_ad(table_name);
- ut_ad(mutex_own(&(dict_sys->mutex)));
-
- table = dict_table_check_if_in_cache_low(table_name);
-
- if (table == NULL) {
- table = dict_load_table(table_name, TRUE, ignore_err);
- }
-
- ut_ad(!table || table->cached);
-
- return(table);
-}
-
-/**********************************************************************//**
Gets a table; loads it to the dictionary cache if necessary. A low-level
function.
@return table, NULL if not found */
@@ -851,7 +823,10 @@ UNIV_INLINE
dict_table_t*
dict_table_get_low(
/*===============*/
- const char* table_name) /*!< in: table name */
+ const char* table_name, /*!< in: table name */
+ dict_err_ignore_t
+ ignore_err) /*!< in: error to be ignored when
+ loading a table definition */
{
dict_table_t* table;
@@ -860,7 +835,8 @@ dict_table_get_low(
table = dict_table_check_if_in_cache_low(table_name);
- if (table && table->corrupted) {
+ if (table && table->corrupted
+ && !(ignore_err & DICT_ERR_IGNORE_CORRUPT)) {
fprintf(stderr, "InnoDB: table");
ut_print_name(stderr, NULL, TRUE, table->name);
if (srv_load_corrupted) {
@@ -873,7 +849,7 @@ dict_table_get_low(
}
if (table == NULL) {
- table = dict_load_table(table_name, TRUE, DICT_ERR_IGNORE_NONE);
+ table = dict_load_table(table_name, TRUE, ignore_err);
}
ut_ad(!table || table->cached);
diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h
index 654576d07d1..bdc6a2b995c 100644
--- a/storage/innobase/include/dict0load.h
+++ b/storage/innobase/include/dict0load.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2013, Innobase Oy. 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
@@ -207,11 +207,13 @@ UNIV_INTERN
ulint
dict_load_foreigns(
/*===============*/
- const char* table_name, /*!< in: table name */
- ibool check_recursive,/*!< in: Whether to check recursive
- load of tables chained by FK */
- ibool check_charsets);/*!< in: TRUE=check charsets
- compatibility */
+ const char* table_name, /*!< in: table name */
+ ibool check_recursive,/*!< in: Whether to check
+ recursive load of tables
+ chained by FK */
+ ibool check_charsets, /*!< in: TRUE=check charsets
+ compatibility */
+ dict_err_ignore_t ignore_err); /*!< in: error to be ignored */
/********************************************************************//**
Prints to the standard output information on all tables found in the data
dictionary system table. */
diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h
index d9f1f564036..330e6a25114 100644
--- a/storage/innobase/include/dict0types.h
+++ b/storage/innobase/include/dict0types.h
@@ -53,6 +53,8 @@ enum dict_err_ignore {
DICT_ERR_IGNORE_INDEX_ROOT = 1, /*!< ignore error if index root
page is FIL_NULL or incorrect value */
DICT_ERR_IGNORE_CORRUPT = 2, /*!< skip corrupted indexes */
+ DICT_ERR_IGNORE_FK_NOKEY = 4, /*!< ignore error if any foreign
+ key is missing */
DICT_ERR_IGNORE_ALL = 0xFFFF /*!< ignore all errors */
};