Commit cb4434c4 authored by Jan Lindström's avatar Jan Lindström

MDEV-24856 : Server crashes when wsrep_provider_options set to NULL

Null pointer reference to wsrep_provider_options variable. Fixed
by adding condition and error handling.
parent 542d769e
connection node_2;
connection node_1;
call mtr.add_suppression("WSREP: Unknown parameter 'a'");
call mtr.add_suppression("WSREP: Set options returned 7");
SET GLOBAL wsrep_provider_options=NULL;
ERROR HY000: Incorrect arguments to SET
SET GLOBAL wsrep_provider_options='';
SET GLOBAL wsrep_provider_options=' ';
SET GLOBAL wsrep_provider_options='a=1';
ERROR HY000: Incorrect arguments to SET
--source include/galera_cluster.inc
call mtr.add_suppression("WSREP: Unknown parameter 'a'");
call mtr.add_suppression("WSREP: Set options returned 7");
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_provider_options=NULL;
SET GLOBAL wsrep_provider_options='';
SET GLOBAL wsrep_provider_options=' ';
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_provider_options='a=1';
......@@ -457,15 +457,21 @@ bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var)
bool wsrep_provider_options_update(sys_var *self, THD* thd, enum_var_type type)
{
enum wsrep::provider::status ret=
Wsrep_server_state::instance().provider().options(wsrep_provider_options);
if (ret)
if (wsrep_provider_options)
{
WSREP_ERROR("Set options returned %d", ret);
refresh_provider_options();
return true;
enum wsrep::provider::status ret=
Wsrep_server_state::instance().provider().options(wsrep_provider_options);
if (ret)
{
WSREP_ERROR("Set options returned %d", ret);
goto err;
}
return refresh_provider_options();
}
return refresh_provider_options();
err:
refresh_provider_options();
return true;
}
void wsrep_provider_options_init(const char* value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment