summaryrefslogtreecommitdiff
path: root/storage/innobase/include/dict0dict.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/dict0dict.h')
-rw-r--r--storage/innobase/include/dict0dict.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 6f84f2eadf7..12a566a27c6 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -115,12 +115,7 @@ dict_table_open_on_id(
/**********************************************************************//**
Returns a table object based on table id.
@return table, NULL if does not exist */
-UNIV_INTERN
-dict_table_t*
-dict_table_open_on_index_id(
-/*==================*/
- table_id_t table_id, /*!< in: table id */
- bool dict_locked) /*!< in: TRUE=data dictionary locked */
+dict_table_t* dict_table_open_on_index_id(index_id_t index_id)
__attribute__((warn_unused_result));
/********************************************************************//**
Decrements the count of open handles to a table. */
@@ -523,6 +518,21 @@ dict_table_open_on_name(
dict_err_ignore_t ignore_err)
MY_ATTRIBUTE((warn_unused_result));
+/** Outcome of dict_foreign_find_index() or dict_foreign_qualify_index() */
+enum fkerr_t
+{
+ /** A backing index was found for a FOREIGN KEY constraint */
+ FK_SUCCESS = 0,
+ /** There is no index that covers the columns in the constraint. */
+ FK_INDEX_NOT_FOUND,
+ /** The index is for a prefix index, not a full column. */
+ FK_IS_PREFIX_INDEX,
+ /** A condition of SET NULL conflicts with a NOT NULL column. */
+ FK_COL_NOT_NULL,
+ /** The column types do not match */
+ FK_COLS_NOT_EQUAL
+};
+
/*********************************************************************//**
Tries to find an index whose first fields are the columns in the array,
in the same order and is not marked for deletion and is not the same
@@ -549,11 +559,11 @@ dict_foreign_find_index(
/*!< in: nonzero if none of
the columns must be declared
NOT NULL */
- ulint* error, /*!< out: error code */
- ulint* err_col_no,
+ fkerr_t* error = NULL, /*!< out: error code */
+ ulint* err_col_no = NULL,
/*!< out: column number where
error happened */
- dict_index_t** err_index)
+ dict_index_t** err_index = NULL)
/*!< out: index where error
happened */
@@ -629,7 +639,7 @@ dict_foreign_qualify_index(
/*!< in: nonzero if none of
the columns must be declared
NOT NULL */
- ulint* error, /*!< out: error code */
+ fkerr_t* error, /*!< out: error code */
ulint* err_col_no,
/*!< out: column number where
error happened */