mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Merge branch '10.0' into 10.1
This commit is contained in:
commit
dfb74dea30
239 changed files with 7223 additions and 2734 deletions
|
|
@ -3317,71 +3317,6 @@ dict_table_is_referenced_by_foreign_key(
|
|||
return(!table->referenced_set.empty());
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Check if the index is referenced by a foreign key, if TRUE return foreign
|
||||
else return NULL
|
||||
@return pointer to foreign key struct if index is defined for foreign
|
||||
key, otherwise NULL */
|
||||
UNIV_INTERN
|
||||
dict_foreign_t*
|
||||
dict_table_get_referenced_constraint(
|
||||
/*=================================*/
|
||||
dict_table_t* table, /*!< in: InnoDB table */
|
||||
dict_index_t* index) /*!< in: InnoDB index */
|
||||
{
|
||||
dict_foreign_t* foreign;
|
||||
|
||||
ut_ad(index != NULL);
|
||||
ut_ad(table != NULL);
|
||||
|
||||
for (dict_foreign_set::iterator it = table->referenced_set.begin();
|
||||
it != table->referenced_set.end();
|
||||
++it) {
|
||||
|
||||
foreign = *it;
|
||||
|
||||
if (foreign->referenced_index == index) {
|
||||
|
||||
return(foreign);
|
||||
}
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Checks if a index is defined for a foreign key constraint. Index is a part
|
||||
of a foreign key constraint if the index is referenced by foreign key
|
||||
or index is a foreign key index.
|
||||
@return pointer to foreign key struct if index is defined for foreign
|
||||
key, otherwise NULL */
|
||||
UNIV_INTERN
|
||||
dict_foreign_t*
|
||||
dict_table_get_foreign_constraint(
|
||||
/*==============================*/
|
||||
dict_table_t* table, /*!< in: InnoDB table */
|
||||
dict_index_t* index) /*!< in: InnoDB index */
|
||||
{
|
||||
dict_foreign_t* foreign;
|
||||
|
||||
ut_ad(index != NULL);
|
||||
ut_ad(table != NULL);
|
||||
|
||||
for (dict_foreign_set::iterator it = table->foreign_set.begin();
|
||||
it != table->foreign_set.end();
|
||||
++it) {
|
||||
|
||||
foreign = *it;
|
||||
|
||||
if (foreign->foreign_index == index) {
|
||||
|
||||
return(foreign);
|
||||
}
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**********************************************************************//**
|
||||
Removes a foreign constraint struct from the dictionary cache. */
|
||||
UNIV_INTERN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue