#
# wsrep_max_ws_rows
#
# save the initial value
SET @wsrep_max_ws_rows_global_saved = @@global.wsrep_max_ws_rows;
# default
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
0

# scope
SELECT @@session.wsrep_max_ws_rows;
ERROR HY000: Variable 'wsrep_max_ws_rows' is a GLOBAL variable
SET @@global.wsrep_max_ws_rows=1;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
1

# valid values
SET @@global.wsrep_max_ws_rows=131072;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
131072
SET @@global.wsrep_max_ws_rows=131073;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
131073
SET @@global.wsrep_max_ws_rows=0;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
0
SET @@global.wsrep_max_ws_rows=default;
SELECT @global.wsrep_max_ws_rows;
@global.wsrep_max_ws_rows
NULL

# invalid values
SET @@global.wsrep_max_ws_rows=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
SET @@global.wsrep_max_ws_rows='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
SET @@global.wsrep_max_ws_rows=-1;
Warnings:
Warning	1292	Truncated incorrect wsrep_max_ws_rows value: '-1'
SELECT @global.wsrep_max_ws_rows;
@global.wsrep_max_ws_rows
NULL

# restore the initial value
SET @@global.wsrep_max_ws_rows = @wsrep_max_ws_rows_global_saved;
# End of test
