mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
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
|
@ -0,0 +1,11 @@
|
||||
--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)
|
||||
|
Reference in New Issue
Block a user