Commit 09f7889b authored by Jan Lindström's avatar Jan Lindström

MDEV-29706 : SIGSEGV in wsrep_TOI_begin on non-Galera builds

Do not allow setting wsrep_on=ON if no provider is set.
parent 074e3582
SET GLOBAL wsrep_on=ON;
ERROR HY000: WSREP (galera) can't be enabled if the wsrep_provider is unset or set to 'none'
SELECT @@global.wsrep_on;
@@global.wsrep_on
0
--source include/have_wsrep.inc
--echo #
--echo # wsrep_on
--echo #
--echo # save the initial values
SET @wsrep_on_global_saved = @@global.wsrep_on;
SET @wsrep_on_session_saved = @@session.wsrep_on;
--echo # default
SELECT @@global.wsrep_on;
SELECT @@session.wsrep_on;
--echo
--echo # scope and valid values
SET @@global.wsrep_on=OFF;
SELECT @@global.wsrep_on;
SET @@global.wsrep_on=ON;
SELECT @@global.wsrep_on;
SET @@session.wsrep_on=OFF;
SELECT @@session.wsrep_on;
SET @@session.wsrep_on=ON;
SELECT @@session.wsrep_on;
SET @@session.wsrep_on=default;
SELECT @@session.wsrep_on;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_on=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_on='junk';
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.wsrep_on=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.wsrep_on='junk';
--echo
--echo # restore the initial values
SET @@global.wsrep_on = @wsrep_on_global_saved;
SET @@session.wsrep_on = @wsrep_on_session_saved;
--echo # End of test
--source include/not_embedded.inc
#
# @@global.wsrep_on is not allowed if there
# is no wsrep_provider
#
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_on=ON;
SELECT @@global.wsrep_on;
\ No newline at end of file
......@@ -70,6 +70,12 @@ bool wsrep_on_check(sys_var *self, THD* thd, set_var* var)
" innodb_lock_schedule_algorithm=FCFS and restart.", MYF(0));
return true;
}
if (new_wsrep_on && !WSREP_PROVIDER_EXISTS)
{
my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) can't be enabled "
"if the wsrep_provider is unset or set to 'none'", MYF(0));
return true;
}
return false;
}
......
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