mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
sql/handler: referenced_by_foreign_key() returns bool
The method was declared to return an unsigned integer, but it is really a boolean (and used as such by all callers). A secondary change is the addition of "const" and "noexcept" to this method. In ha_mroonga.cpp, I also added "inline" to the two helper methods of referenced_by_foreign_key(). This allows the compiler to flatten the method.
This commit is contained in:
parent
b88f1267e4
commit
45298b730b
6 changed files with 18 additions and 22 deletions
|
|
@ -10052,8 +10052,8 @@ wsrep_append_key(
|
|||
static bool
|
||||
referenced_by_foreign_key2(
|
||||
/*=======================*/
|
||||
dict_table_t* table,
|
||||
dict_index_t* index)
|
||||
const dict_table_t* table,
|
||||
const dict_index_t* index) noexcept
|
||||
{
|
||||
ut_ad(table != NULL);
|
||||
ut_ad(index != NULL);
|
||||
|
|
@ -15451,16 +15451,12 @@ ha_innobase::can_switch_engines(void)
|
|||
DBUG_RETURN(can_switch);
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
Checks if a table is referenced by a foreign key. The MySQL manual states that
|
||||
a REPLACE is either equivalent to an INSERT, or DELETE(s) + INSERT. Only a
|
||||
/** Checks if a table is referenced by a foreign key. The MySQL manual states
|
||||
that a REPLACE is either equivalent to an INSERT, or DELETE(s) + INSERT. Only a
|
||||
delete is then allowed internally to resolve a duplicate key conflict in
|
||||
REPLACE, not an update.
|
||||
@return > 0 if referenced by a FOREIGN KEY */
|
||||
|
||||
uint
|
||||
ha_innobase::referenced_by_foreign_key(void)
|
||||
/*========================================*/
|
||||
@return whether the table is referenced by a FOREIGN KEY */
|
||||
bool ha_innobase::referenced_by_foreign_key() const noexcept
|
||||
{
|
||||
if (dict_table_is_referenced_by_foreign_key(m_prebuilt->table)) {
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ public:
|
|||
|
||||
bool can_switch_engines() override;
|
||||
|
||||
uint referenced_by_foreign_key() override;
|
||||
bool referenced_by_foreign_key() const noexcept override;
|
||||
|
||||
void free_foreign_key_create_info(char* str) override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue