Skip to content

Commit

Permalink
MDEV-33157 WSREP: Fix function pointer mismatch
Browse files Browse the repository at this point in the history
wsrep_plugin_init(), wsrep_plugin_deinit(): Remove these dummy functions
in order to fix an error that would be flagged by cmake -DWITH_UBSAN=ON
when using clang.

wsrep_show_ready(), wsrep_show_bf_aborts(): Correct the signature.
  • Loading branch information
dr-m committed Jan 3, 2024
1 parent 832e96d commit 96130b1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
3 changes: 2 additions & 1 deletion sql/wsrep_mysqld.cc
Expand Up @@ -512,7 +512,8 @@ my_bool wsrep_ready_get (void)
return ret;
}

int wsrep_show_ready(THD *thd, SHOW_VAR *var, char *buff)
int wsrep_show_ready(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_MY_BOOL;
var->value= buff;
Expand Down
3 changes: 2 additions & 1 deletion sql/wsrep_mysqld.h
Expand Up @@ -148,7 +148,8 @@ extern char* wsrep_cluster_capabilities;

int wsrep_show_status(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *status_var, enum_var_type scope);
int wsrep_show_ready(THD *thd, SHOW_VAR *var, char *buff);
int wsrep_show_ready(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type);
void wsrep_free_status(THD *thd);
void wsrep_update_cluster_state_uuid(const char* str);

Expand Down
16 changes: 2 additions & 14 deletions sql/wsrep_plugin.cc
Expand Up @@ -18,18 +18,6 @@

#include <mysql/plugin.h>

static int wsrep_plugin_init(void *p)
{
WSREP_DEBUG("wsrep_plugin_init()");
return 0;
}

static int wsrep_plugin_deinit(void *p)
{
WSREP_DEBUG("wsrep_plugin_deinit()");
return 0;
}

struct Mysql_replication wsrep_plugin= {
MYSQL_REPLICATION_INTERFACE_VERSION
};
Expand All @@ -42,8 +30,8 @@ maria_declare_plugin(wsrep)
"Codership Oy",
"Wsrep replication plugin",
PLUGIN_LICENSE_GPL,
wsrep_plugin_init,
wsrep_plugin_deinit,
NULL,
NULL,
0x0100,
NULL, /* Status variables */
NULL, /* System variables */
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_thd.cc
Expand Up @@ -36,7 +36,7 @@ static Wsrep_thd_queue* wsrep_rollback_queue= 0;
static Atomic_counter<uint64_t> wsrep_bf_aborts_counter;


int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff,
int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, void *, system_status_var *,
enum enum_var_type scope)
{
wsrep_local_bf_aborts= wsrep_bf_aborts_counter;
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_thd.h
Expand Up @@ -82,7 +82,7 @@ class Wsrep_thd_queue
mysql_cond_t COND_wsrep_thd_queue;
};

int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff,
int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, void *, system_status_var *,
enum enum_var_type scope);
bool wsrep_create_appliers(long threads, bool mutex_protected=false);
void wsrep_create_rollbacker();
Expand Down

0 comments on commit 96130b1

Please sign in to comment.