diff --git a/include/mysql/group_replication_priv.h b/include/mysql/group_replication_priv.h index 4fbab27fb1a..903800ad985 100644 --- a/include/mysql/group_replication_priv.h +++ b/include/mysql/group_replication_priv.h @@ -44,7 +44,7 @@ /** Server side initializations. */ -int group_replication_init(); +int group_replication_init() __attribute__((retain, used)); /** Returns the server connection attribute @@ -53,7 +53,7 @@ int group_replication_init(); @return the pthread for the connection attribute. */ -my_thread_attr_t *get_connection_attrib(); +my_thread_attr_t *get_connection_attrib() __attribute__((retain, used)); /** Returns the server hostname, port and uuid. @@ -65,7 +65,8 @@ my_thread_attr_t *get_connection_attrib(); @param[out] admin_port mysqld admin port */ void get_server_parameters(char **hostname, uint *port, char **uuid, - unsigned int *server_version, uint *admin_port); + unsigned int *server_version, uint *admin_port) + __attribute__((retain, used)); /** Returns the server's client-server interface's ssl configuration values. @@ -73,7 +74,8 @@ void get_server_parameters(char **hostname, uint *port, char **uuid, @param[out] server_ssl_variables server's ssl_variables */ void get_server_main_ssl_parameters( - st_server_ssl_variables *server_ssl_variables); + st_server_ssl_variables *server_ssl_variables) + __attribute__((retain, used)); /** Returns the server's admin interface's ssl configuration values. @@ -81,42 +83,45 @@ void get_server_main_ssl_parameters( @param[out] server_ssl_variables server's ssl_variables */ void get_server_admin_ssl_parameters( - st_server_ssl_variables *server_ssl_variables); + st_server_ssl_variables *server_ssl_variables) + __attribute__((retain, used)); /** Returns the server_id. @return server_id */ -ulong get_server_id(); +ulong get_server_id() __attribute__((retain, used)); /** Returns the server auto_increment_increment @return auto_increment_increment */ -ulong get_auto_increment_increment(); +ulong get_auto_increment_increment() __attribute__((retain, used)); /** Returns the server auto_increment_offset @return auto_increment_offset */ -ulong get_auto_increment_offset(); +ulong get_auto_increment_offset() __attribute__((retain, used)); /** Set server auto_increment_increment @param[in] auto_increment_increment auto-increment increment */ -void set_auto_increment_increment(ulong auto_increment_increment); +void set_auto_increment_increment(ulong auto_increment_increment) + __attribute__((retain, used)); /** Set server auto_increment_offset @param[in] auto_increment_offset auto-increment offset */ -void set_auto_increment_offset(ulong auto_increment_offset); +void set_auto_increment_offset(ulong auto_increment_offset) + __attribute__((retain, used)); /** Returns a struct containing all server startup information needed to evaluate @@ -124,7 +129,8 @@ void set_auto_increment_offset(ulong auto_increment_offset); @param[out] requirements requirements */ -void get_server_startup_prerequirements(Trans_context_info &requirements); +void get_server_startup_prerequirements(Trans_context_info &requirements) + __attribute__((retain, used)); /** Returns the server GTID_EXECUTED encoded as a binary string. @@ -135,7 +141,8 @@ void get_server_startup_prerequirements(Trans_context_info &requirements); @param[out] length binary string length */ bool get_server_encoded_gtid_executed(uchar **encoded_gtid_executed, - size_t *length); + size_t *length) + __attribute__((retain, used)); #if !defined(NDEBUG) /** @@ -174,14 +181,14 @@ void set_slave_thread_options(THD *thd); @param[in] thd The thread */ -void global_thd_manager_add_thd(THD *thd); +void global_thd_manager_add_thd(THD *thd) __attribute__((retain, used)); /** Remove thread from Global_THD_manager singleton. @param[in] thd The thread */ -void global_thd_manager_remove_thd(THD *thd); +void global_thd_manager_remove_thd(THD *thd) __attribute__((retain, used)); /** Function that returns the write set extraction algorithm name. @@ -200,14 +207,14 @@ const char *get_write_set_algorithm_string(unsigned int algorithm); @return true the transaction is committed false otherwise */ -bool is_gtid_committed(const Gtid >id); +bool is_gtid_committed(const Gtid >id) __attribute__((retain, used)); /** Returns the value of replica_max_allowed_packet. @return replica_max_allowed_packet */ -unsigned long get_replica_max_allowed_packet(); +unsigned long get_replica_max_allowed_packet() __attribute__((retain, used)); /** Wait until the given Gtid_set is included in @@GLOBAL.GTID_EXECUTED. @@ -224,12 +231,14 @@ unsigned long get_replica_max_allowed_packet(); @retval true otherwise */ bool wait_for_gtid_set_committed(const char *gtid_set_text, double timeout, - bool update_thd_status); + bool update_thd_status) + __attribute__((retain, used)); /** @returns the maximum value of replica_max_allowed_packet. */ -unsigned long get_max_replica_max_allowed_packet(); +unsigned long get_max_replica_max_allowed_packet() + __attribute__((retain, used)); /** @returns if the server is restarting after a clone @@ -239,6 +248,6 @@ bool is_server_restarting_after_clone(); /** @returns if the server already dropped its data when cloning */ -bool is_server_data_dropped(); +bool is_server_data_dropped() __attribute__((retain, used)); #endif /* GROUP_REPLICATION_PRIV_INCLUDE */ diff --git a/include/mysql/plugin_clone.h b/include/mysql/plugin_clone.h index 0aa958fc29e..9c72e7062db 100644 --- a/include/mysql/plugin_clone.h +++ b/include/mysql/plugin_clone.h @@ -74,15 +74,16 @@ struct Mysql_clone { Called when Clone plugin is installed. @param[in] plugin_name clone plugin name @return error code */ -int clone_handle_create(const char *plugin_name); +int clone_handle_create(const char *plugin_name) __attribute__((retain, used)); /** Drop clone handle. Called when Clone plugin is uninstalled. @return error code */ -int clone_handle_drop(); +int clone_handle_drop() __attribute__((retain, used)); /** Check if it is safe to uninstall clone plugin. @param[in,out] plugin_info plugin @return error code */ -int clone_handle_check_drop(MYSQL_PLUGIN plugin_info); +int clone_handle_check_drop(MYSQL_PLUGIN plugin_info) + __attribute__((retain, used)); #endif diff --git a/libbinlogevents/include/control_events.h b/libbinlogevents/include/control_events.h index f7994bada56..379f9d61aa7 100644 --- a/libbinlogevents/include/control_events.h +++ b/libbinlogevents/include/control_events.h @@ -1199,9 +1199,10 @@ class Gtid_event : public Binary_log_event { @param value The commit_group_ticket value. */ - void set_commit_group_ticket_and_update_transaction_length( - std::uint64_t value); -}; + void + set_commit_group_ticket_and_update_transaction_length(std::uint64_t value) + __attribute__((retain, used)); + }; /** @class Previous_gtids_event diff --git a/libbinlogevents/include/gtids/gtidset.h b/libbinlogevents/include/gtids/gtidset.h index e7ca37e6532..a398e83facc 100644 --- a/libbinlogevents/include/gtids/gtidset.h +++ b/libbinlogevents/include/gtids/gtidset.h @@ -90,7 +90,8 @@ class Gno_interval { * @return true If both intervals match. * @return false If intervals do not match. */ - virtual bool operator==(const Gno_interval &other) const; + virtual bool operator==(const Gno_interval &other) const + __attribute__((retain, used)); /** * @brief Construct a new Gno_interval object. diff --git a/sql/binlog/group_commit/bgc_ticket_manager.h b/sql/binlog/group_commit/bgc_ticket_manager.h index 07566d9c98c..3d8ae6d50dd 100644 --- a/sql/binlog/group_commit/bgc_ticket_manager.h +++ b/sql/binlog/group_commit/bgc_ticket_manager.h @@ -305,8 +305,9 @@ class Bgc_ticket_manager { @return A pair holding the before and after invocation back ticket pointer values. */ - std::pair push_new_ticket( - BgcTmOptions options = BgcTmOptions::empty); + std::pair + push_new_ticket(BgcTmOptions options = BgcTmOptions::empty) + __attribute__((retain, used)); /** Closes the current front ticket processing window, pops the front ticket assigned sessions count from the session-count queue, sets the diff --git a/sql/log_event.h b/sql/log_event.h index d3e0973b480..899cf8945cf 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -3744,7 +3744,9 @@ class Transaction_payload_log_event void print(FILE *file, PRINT_EVENT_INFO *print_event_info) const override; #endif - size_t get_event_length() { return LOG_EVENT_HEADER_LEN + get_data_size(); } + size_t get_event_length() __attribute__((retain, used)) { + return LOG_EVENT_HEADER_LEN + get_data_size(); + } size_t get_data_size() override; #if defined(MYSQL_SERVER) @@ -3812,7 +3814,8 @@ class Gtid_log_event : public binary_log::Gtid_event, public Log_event { ulonglong immediate_commit_timestamp_arg, const Gtid_specification spec_arg, uint32_t original_server_version_arg, - uint32_t immediate_server_version_arg); + uint32_t immediate_server_version_arg) + __attribute__((retain, used)); #endif #ifdef MYSQL_SERVER @@ -4144,7 +4147,8 @@ class Transaction_context_log_event #ifdef MYSQL_SERVER Transaction_context_log_event(const char *server_uuid_arg, bool using_trans, my_thread_id thread_id_arg, - bool is_gtid_specified_arg); + bool is_gtid_specified_arg) + __attribute__((retain, used)); #endif Transaction_context_log_event(const char *buffer, @@ -4177,7 +4181,7 @@ class Transaction_context_log_event @param[in] hash row identifier */ - void add_write_set(const char *hash); + void add_write_set(const char *hash) __attribute__((retain, used)); /** Return a pointer to write-set list. @@ -4202,7 +4206,7 @@ class Transaction_context_log_event since its required locks will collide with the server gtid state initialization procedure. */ - bool read_snapshot_version(); + bool read_snapshot_version() __attribute__((retain, used)); /** Return the transaction snapshot timestamp. @@ -4267,7 +4271,7 @@ class View_change_log_event : public binary_log::View_change_event, size_t get_size_data_map(std::map *map); public: - View_change_log_event(const char *view_id); + View_change_log_event(const char *view_id) __attribute__((retain, used)); View_change_log_event(const char *buffer, const Format_description_event *descr_event); @@ -4307,7 +4311,7 @@ class View_change_log_event : public binary_log::View_change_event, @param[out] event_size the event size after this operation */ void set_certification_info(std::map *info, - size_t *event_size); + size_t *event_size) __attribute__((retain, used)); /** Returns the certification info diff --git a/sql/replication.h b/sql/replication.h index 0749259d03a..911bf10d82d 100644 --- a/sql/replication.h +++ b/sql/replication.h @@ -57,9 +57,9 @@ struct st_server_ssl_variables { char *ssl_crlpath; unsigned int ssl_fips_mode; - void init(); + void init() __attribute__((retain, used)); - void deinit(); + void deinit() __attribute__((retain, used)); }; /** @@ -738,7 +738,8 @@ typedef struct Binlog_relay_IO_observer { @retval 0 Success @retval 1 Observer already exists */ -int register_trans_observer(Trans_observer *observer, void *p); +int register_trans_observer(Trans_observer *observer, void *p) + __attribute__((retain, used)); /** Unregister a transaction observer @@ -749,7 +750,8 @@ int register_trans_observer(Trans_observer *observer, void *p); @retval 0 Success @retval 1 Observer not exists */ -int unregister_trans_observer(Trans_observer *observer, void *p); +int unregister_trans_observer(Trans_observer *observer, void *p) + __attribute__((retain, used)); /** Register a binlog storage observer @@ -785,7 +787,7 @@ int unregister_binlog_storage_observer(Binlog_storage_observer *observer, @retval 1 Observer already exists */ int register_binlog_transmit_observer(Binlog_transmit_observer *observer, - void *p); + void *p) __attribute__((retain, used)); /** Unregister a binlog transmit observer @@ -797,7 +799,7 @@ int register_binlog_transmit_observer(Binlog_transmit_observer *observer, @retval 1 Observer not exists */ int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, - void *p); + void *p) __attribute__((retain, used)); /** Register a server state observer @@ -808,7 +810,8 @@ int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, @retval 0 Success @retval 1 Observer already exists */ -int register_server_state_observer(Server_state_observer *observer, void *p); +int register_server_state_observer(Server_state_observer *observer, void *p) + __attribute__((retain, used)); /** Unregister a server state observer @@ -819,7 +822,8 @@ int register_server_state_observer(Server_state_observer *observer, void *p); @retval 0 Success @retval 1 Observer not exists */ -int unregister_server_state_observer(Server_state_observer *observer, void *p); +int unregister_server_state_observer(Server_state_observer *observer, void *p) + __attribute__((retain, used)); /** Register a binlog relay IO (slave IO thread) observer @@ -831,7 +835,7 @@ int unregister_server_state_observer(Server_state_observer *observer, void *p); @retval 1 Observer already exists */ int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, - void *p); + void *p) __attribute__((retain, used)); /** Unregister a binlog relay IO (slave IO thread) observer @@ -843,7 +847,7 @@ int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, @retval 1 Observer not exists */ int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, - void *p); + void *p) __attribute__((retain, used)); /** Set thread entering a condition @@ -889,7 +893,7 @@ void thd_exit_cond(void *opaque_thd, const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line); -#define THD_EXIT_COND(P1, P2) \ +#define THD_EXIT_COND(P1, P2) \ thd_exit_cond(P1, P2, __func__, __FILE__, __LINE__) /** diff --git a/sql/rpl_channel_service_interface.h b/sql/rpl_channel_service_interface.h index 76b5d55f88d..001651f5b66 100644 --- a/sql/rpl_channel_service_interface.h +++ b/sql/rpl_channel_service_interface.h @@ -79,7 +79,8 @@ struct Channel_ssl_info { char *tls_ciphersuites; // list of permissible ciphersuites for TLS 1.3 }; -void initialize_channel_ssl_info(Channel_ssl_info *channel_ssl_info); +void initialize_channel_ssl_info(Channel_ssl_info *channel_ssl_info) + __attribute__((retain, used)); /** Creation information for a channel. @@ -113,7 +114,8 @@ struct Channel_creation_info { bool m_allow_drop_write_set; }; -void initialize_channel_creation_info(Channel_creation_info *channel_info); +void initialize_channel_creation_info(Channel_creation_info *channel_info) + __attribute__((retain, used)); // Start settings @@ -147,7 +149,8 @@ struct Channel_connection_info { char *view_id; // The view id to wait on a until condition }; -void initialize_channel_connection_info(Channel_connection_info *channel_info); +void initialize_channel_connection_info(Channel_connection_info *channel_info) + __attribute__((retain, used)); /** Initializes a channel connection in a similar way to a change master command. @@ -164,7 +167,8 @@ void initialize_channel_connection_info(Channel_connection_info *channel_info); @retval !=0 Error on channel creation */ int channel_create(const char *channel, - Channel_creation_info *channel_information); + Channel_creation_info *channel_information) + __attribute__((retain, used)); /** Start the Applier/Receiver threads according to the given options. @@ -192,7 +196,8 @@ int channel_create(const char *channel, int channel_start(const char *channel, Channel_connection_info *connection_info, int threads_to_start, int wait_for_connection, bool use_server_mta_configuration = false, - bool channel_map_already_locked = false); + bool channel_map_already_locked = false) + __attribute__((retain, used)); /** Stops the channel threads according to the given options. @@ -204,7 +209,8 @@ int channel_start(const char *channel, Channel_connection_info *connection_info, @retval 0 OK @retval !=0 Error */ -int channel_stop(const char *channel, int threads_to_stop, long timeout); +int channel_stop(const char *channel, int threads_to_stop, long timeout) + __attribute__((retain, used)); /** Kills the Binlog Dump threads. @@ -212,7 +218,7 @@ int channel_stop(const char *channel, int threads_to_stop, long timeout); @return the operation status @retval 0 OK */ -int binlog_dump_thread_kill(); +int binlog_dump_thread_kill() __attribute__((retain, used)); /** Stops all the running channel threads according to the given options. @@ -226,7 +232,7 @@ int binlog_dump_thread_kill(); @retval !=0 Error */ int channel_stop_all(int threads_to_stop, long timeout, - std::string *error_message); + std::string *error_message) __attribute__((retain, used)); /** Purges the channel logs @@ -238,7 +244,8 @@ int channel_stop_all(int threads_to_stop, long timeout, @retval 0 OK @retval !=0 Error */ -int channel_purge_queue(const char *channel, bool reset_all); +int channel_purge_queue(const char *channel, bool reset_all) + __attribute__((retain, used)); /** Tells if the selected component of the channel is active or not. @@ -252,7 +259,8 @@ int channel_purge_queue(const char *channel, bool reset_all); @retval true Yes @retval false No */ -bool channel_is_active(const char *channel, enum_channel_thread_types type); +bool channel_is_active(const char *channel, enum_channel_thread_types type) + __attribute__((retain, used)); /** Returns the id(s) of the channel threads: receiver or applier. @@ -270,7 +278,8 @@ bool channel_is_active(const char *channel, enum_channel_thread_types type); */ int channel_get_thread_id(const char *channel, enum_channel_thread_types thread_type, - unsigned long **thread_id, bool need_lock = true); + unsigned long **thread_id, bool need_lock = true) + __attribute__((retain, used)); /** Returns last GNO from applier from a given UUID. @@ -282,7 +291,8 @@ int channel_get_thread_id(const char *channel, @retval <0 the channel does no exists, or the applier is not present @retval >0 the gno */ -long long channel_get_last_delivered_gno(const char *channel, int sidno); +long long channel_get_last_delivered_gno(const char *channel, int sidno) + __attribute__((retain, used)); /** Adds server executed GTID set to channel received GTID set. @@ -293,7 +303,8 @@ long long channel_get_last_delivered_gno(const char *channel, int sidno); @retval 0 OK @retval != 0 Error */ -int channel_add_executed_gtids_to_received_gtids(const char *channel); +int channel_add_executed_gtids_to_received_gtids(const char *channel) + __attribute__((retain, used)); /** Queues a event packet into the current active channel. @@ -307,7 +318,7 @@ int channel_add_executed_gtids_to_received_gtids(const char *channel); @retval != 0 Error on queue */ int channel_queue_packet(const char *channel, const char *buf, - unsigned long len); + unsigned long len) __attribute__((retain, used)); /** Checks if all the queued transactions were executed. @@ -325,7 +336,8 @@ int channel_queue_packet(const char *channel, const char *buf, @retval REPLICATION_THREAD_WAIT_TIMEOUT_ERROR A timeout occurred @retval REPLICATION_THREAD_WAIT_NO_INFO_ERROR An error occurred */ -int channel_wait_until_apply_queue_applied(const char *channel, double timeout); +int channel_wait_until_apply_queue_applied(const char *channel, double timeout) + __attribute__((retain, used)); /** Checks if all the transactions in the given set were executed. @@ -344,7 +356,8 @@ int channel_wait_until_apply_queue_applied(const char *channel, double timeout); int channel_wait_until_transactions_applied(const char *channel, const char *gtid_set, double timeout, - bool update_THD_status = true); + bool update_THD_status = true) + __attribute__((retain, used)); /** Checks if the applier, and its workers when parallel applier is @@ -358,7 +371,8 @@ int channel_wait_until_transactions_applied(const char *channel, @retval 0 Applier is not waiting @retval 1 Applier is waiting */ -int channel_is_applier_waiting(const char *channel); +int channel_is_applier_waiting(const char *channel) + __attribute__((retain, used)); /** Checks if the applier thread, and its workers when parallel applier is @@ -383,7 +397,7 @@ int channel_is_applier_thread_waiting(unsigned long thread_id, @retval 0 OK @retval != 0 Error on flush */ -int channel_flush(const char *channel); +int channel_flush(const char *channel) __attribute__((retain, used)); /** Initializes channel structures if needed. @@ -406,7 +420,8 @@ int initialize_channel_service_interface(); @retval 0 OK @retval !=0 Error on retrieval */ -int channel_get_retrieved_gtid_set(const char *channel, char **retrieved_set); +int channel_get_retrieved_gtid_set(const char *channel, char **retrieved_set) + __attribute__((retain, used)); /** Tells if the selected component of the channel is stopping or not. @@ -418,7 +433,8 @@ int channel_get_retrieved_gtid_set(const char *channel, char **retrieved_set); @retval true Yes @retval false No, no type was specified or the channel does not exist. */ -bool channel_is_stopping(const char *channel, enum_channel_thread_types type); +bool channel_is_stopping(const char *channel, enum_channel_thread_types type) + __attribute__((retain, used)); /** Checks if the given channel's relaylog contains a partial transaction. @@ -428,7 +444,8 @@ bool channel_is_stopping(const char *channel, enum_channel_thread_types type); @retval true If relaylog contains partial transcation. @retval false If relaylog does not contain partial transaction. */ -bool is_partial_transaction_on_channel_relay_log(const char *channel); +bool is_partial_transaction_on_channel_relay_log(const char *channel) + __attribute__((retain, used)); /** Checks if any slave threads of any channel is running @@ -438,7 +455,8 @@ bool is_partial_transaction_on_channel_relay_log(const char *channel); @retval true at least one channel thread is running. @retval false none of the the channels are running. */ -bool is_any_slave_channel_running(int thread_mask); +bool is_any_slave_channel_running(int thread_mask) + __attribute__((retain, used)); /** Checks if any slave threads of any channel configured with @@ -461,7 +479,8 @@ bool is_any_slave_channel_running_with_failover_enabled(int thread_mask); @retval false none of the the channels have the same uuid */ -bool channel_has_same_uuid_as_group_name(const char *group_name); +bool channel_has_same_uuid_as_group_name(const char *group_name) + __attribute__((retain, used)); /** Method to get the credentials configured for a channel @@ -475,7 +494,8 @@ bool channel_has_same_uuid_as_group_name(const char *group_name); @retval true Error, channel not found */ int channel_get_credentials(const char *channel, std::string &user, - std::string &password); + std::string &password) + __attribute__((retain, used)); /** Method to get the network namespace configured for a channel @@ -487,7 +507,8 @@ int channel_get_credentials(const char *channel, std::string &user, @retval false OK @retval true Error, channel not found */ -int channel_get_network_namespace(const char *channel, std::string &net_ns); +int channel_get_network_namespace(const char *channel, std::string &net_ns) + __attribute__((retain, used)); /** Return type for function @@ -527,7 +548,8 @@ has_any_slave_channel_open_temp_table_or_is_its_applier_running(); @retval 1 Error, channel not found */ -int channel_delete_credentials(const char *channel_name); +int channel_delete_credentials(const char *channel_name) + __attribute__((retain, used)); /** Start channels which have SOURCE_CONNECTION_AUTO_FAILOVER=1. @@ -536,7 +558,7 @@ int channel_delete_credentials(const char *channel_name); @retval false OK @retval true Error */ -bool start_failover_channels(); +bool start_failover_channels() __attribute__((retain, used)); /** Set SOURCE_CONNECTION_AUTO_FAILOVER on the given channel @@ -566,7 +588,7 @@ bool unset_source_connection_auto_failover_on_all_channels(); Reload the status values on `Rpl_acf_status_configuration` singleton. */ -void reload_failover_channels_status(); +void reload_failover_channels_status() __attribute__((retain, used)); /** Get replication failover channels configuration in @@ -581,7 +603,7 @@ void reload_failover_channels_status(); @retval true Error */ bool get_replication_failover_channels_configuration( - std::string &serialized_configuration); + std::string &serialized_configuration) __attribute__((retain, used)); /** Set replication failover channels configuration that was @@ -600,7 +622,8 @@ bool get_replication_failover_channels_configuration( */ bool set_replication_failover_channels_configuration( const std::vector - &exchanged_replication_failover_channels_serialized_configuration); + &exchanged_replication_failover_channels_serialized_configuration) + __attribute__((retain, used)); /** Collect and broadcast the replication failover channels configuration @@ -612,6 +635,7 @@ bool set_replication_failover_channels_configuration( @retval false OK @retval true Error */ -bool force_my_replication_failover_channels_configuration_on_all_members(); +bool force_my_replication_failover_channels_configuration_on_all_members() + __attribute__((retain, used)); #endif // RPL_SERVICE_INTERFACE_INCLUDE diff --git a/sql/rpl_commit_stage_manager.h b/sql/rpl_commit_stage_manager.h index 375afa0afce..104e40064f8 100644 --- a/sql/rpl_commit_stage_manager.h +++ b/sql/rpl_commit_stage_manager.h @@ -399,11 +399,11 @@ class Commit_stage_manager { /** Disables the ability for session BGC tickets to be set manually. */ - static void disable_manual_session_tickets(); + static void disable_manual_session_tickets() __attribute__((retain, used)); /** Enables the ability for session BGC tickets to be set manually. */ - static void enable_manual_session_tickets(); + static void enable_manual_session_tickets() __attribute__((retain, used)); private: /** check if Commit_stage_manager variables already initialized. */ diff --git a/sql/rpl_group_replication.h b/sql/rpl_group_replication.h index 5f959319167..e4386b88cc5 100644 --- a/sql/rpl_group_replication.h +++ b/sql/rpl_group_replication.h @@ -89,6 +89,7 @@ bool is_group_replication_member_secondary(); // Callback definition for socket donation typedef void (*gr_incoming_connection_cb)(THD *thd, int fd, SSL *ssl_ctx); -void set_gr_incoming_connection(gr_incoming_connection_cb x); +void set_gr_incoming_connection(gr_incoming_connection_cb x) + __attribute__((retain, used)); #endif /* RPL_GROUP_REPLICATION_INCLUDED */ diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index 1f104f8fb76..d599a92f1aa 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -1125,7 +1125,7 @@ struct Gtid { int to_string(const Sid_map *sid_map, char *buf, bool need_lock = false) const; /// Returns true if this Gtid has the same sid and gno as 'other'. - bool equals(const Gtid &other) const { + bool equals(const Gtid &other) const __attribute__((retain, used)) { return sidno == other.sidno && gno == other.gno; } /** @@ -1464,7 +1464,8 @@ class Gtid_set { number of SIDs. This may be NULL if such changes do not need to be protected. */ - Gtid_set(Sid_map *sid_map, Checkable_rwlock *sid_lock = nullptr); + Gtid_set(Sid_map *sid_map, Checkable_rwlock *sid_lock = nullptr) + __attribute__((retain, used)); /** Constructs a new Gtid_set that contains the gtids in the given string, in the same format as add_gtid_text(char *). @@ -1699,7 +1700,8 @@ class Gtid_set { @param result Gtid_set where the result will be stored. @return RETURN_STATUS_OK or RETURN_STATUS_REPORTED_ERROR. */ - enum_return_status intersection(const Gtid_set *other, Gtid_set *result); + enum_return_status intersection(const Gtid_set *other, Gtid_set *result) + __attribute__((retain, used)); /// Returns true if this Gtid_set is empty. bool is_empty() const { Gtid_iterator git(this); @@ -1715,7 +1717,8 @@ class Gtid_set { @retval true if the set contains >= num GTIDs. @retval false if the set contains < num GTIDs. */ - bool is_size_greater_than_or_equal(ulonglong num) const; + bool is_size_greater_than_or_equal(ulonglong num) const + __attribute__((retain, used)); /** What is the count of all the GTIDs in all intervals for a sidno @@ -3997,7 +4000,8 @@ int gtid_acquire_ownership_multiple(THD *thd); /** Return sidno for a given sid, see Sid_map::add_sid() for details. */ -rpl_sidno get_sidno_from_global_sid_map(rpl_sid sid); +rpl_sidno get_sidno_from_global_sid_map(rpl_sid sid) + __attribute__((retain, used)); /** Return last gno for a given sidno, see diff --git a/sql/rpl_write_set_handler.h b/sql/rpl_write_set_handler.h index 0991ef207ef..f1f87b34900 100644 --- a/sql/rpl_write_set_handler.h +++ b/sql/rpl_write_set_handler.h @@ -38,7 +38,8 @@ struct TABLE; @return the algorithm name */ -const char *get_write_set_algorithm_string(unsigned int algorithm); +const char *get_write_set_algorithm_string(unsigned int algorithm) + __attribute__((retain, used)); /** Function to add the hash of the PKE to the transaction context object. diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 9163c48bc87..c57837adff4 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -184,7 +184,8 @@ extern void plugin_unlock_list(THD *thd, plugin_ref *list, size_t count); extern void plugin_thdvar_init(THD *thd, bool enable_plugins); extern void plugin_thdvar_cleanup(THD *thd, bool enable_plugins); extern void plugin_thdvar_safe_update(THD *thd, SYS_VAR *var, char **dest, - const char *value); + const char *value) + __attribute__((retain, used)); extern bool check_valid_path(const char *path, size_t length); extern void alloc_and_copy_thd_dynamic_variables(THD *thd, bool global_lock);