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:
Max Kellermann 2024-09-20 08:48:52 +02:00 committed by Marko Mäkelä
commit 45298b730b
6 changed files with 18 additions and 22 deletions

View file

@ -16790,10 +16790,10 @@ int ha_mroonga::get_parent_foreign_key_list(THD *thd,
DBUG_RETURN(res);
}
uint ha_mroonga::wrapper_referenced_by_foreign_key()
inline bool ha_mroonga::wrapper_referenced_by_foreign_key() const noexcept
{
MRN_DBUG_ENTER_METHOD();
uint res;
bool res;
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
res = wrap_handler->referenced_by_foreign_key();
@ -16802,17 +16802,17 @@ uint ha_mroonga::wrapper_referenced_by_foreign_key()
DBUG_RETURN(res);
}
uint ha_mroonga::storage_referenced_by_foreign_key()
inline bool ha_mroonga::storage_referenced_by_foreign_key() const noexcept
{
MRN_DBUG_ENTER_METHOD();
uint res = handler::referenced_by_foreign_key();
bool res = handler::referenced_by_foreign_key();
DBUG_RETURN(res);
}
uint ha_mroonga::referenced_by_foreign_key()
bool ha_mroonga::referenced_by_foreign_key() const noexcept
{
MRN_DBUG_ENTER_METHOD();
uint res;
bool res;
if (share->wrapper_mode)
{
res = wrapper_referenced_by_foreign_key();

View file

@ -618,7 +618,7 @@ protected:
bool can_switch_engines() mrn_override;
int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) mrn_override;
int get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) mrn_override;
uint referenced_by_foreign_key() mrn_override;
bool referenced_by_foreign_key() const noexcept mrn_override;
void init_table_handle_for_HANDLER() mrn_override;
void free_foreign_key_create_info(char* str) mrn_override;
#ifdef MRN_HAVE_HA_REBIND_PSI
@ -1268,8 +1268,8 @@ private:
int storage_get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
int wrapper_get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
int storage_get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
uint wrapper_referenced_by_foreign_key();
uint storage_referenced_by_foreign_key();
bool wrapper_referenced_by_foreign_key() const noexcept;
bool storage_referenced_by_foreign_key() const noexcept;
void wrapper_init_table_handle_for_HANDLER();
void storage_init_table_handle_for_HANDLER();
void wrapper_free_foreign_key_create_info(char* str);