SET @start_global_value = @@global.innodb_rollback_segments;
SELECT @start_global_value;
@start_global_value
128
Valid values are zero or above
SELECT @@global.innodb_rollback_segments >=0;
@@global.innodb_rollback_segments >=0
1
SELECT @@global.innodb_rollback_segments <=128;
@@global.innodb_rollback_segments <=128
1
SELECT @@global.innodb_rollback_segments;
@@global.innodb_rollback_segments
128
SELECT @@session.innodb_rollback_segments;
ERROR HY000: Variable 'innodb_rollback_segments' is a GLOBAL variable
SHOW global variables LIKE 'innodb_rollback_segments';
Variable_name	Value
innodb_rollback_segments	128
SHOW session variables LIKE 'innodb_rollback_segments';
Variable_name	Value
innodb_rollback_segments	128
SELECT * FROM information_schema.global_variables 
WHERE variable_name='innodb_rollback_segments';
VARIABLE_NAME	VARIABLE_VALUE
INNODB_ROLLBACK_SEGMENTS	128
SELECT * FROM information_schema.session_variables 
WHERE variable_name='innodb_rollback_segments';
VARIABLE_NAME	VARIABLE_VALUE
INNODB_ROLLBACK_SEGMENTS	128
SET global innodb_rollback_segments=100;
SELECT @@global.innodb_rollback_segments;
@@global.innodb_rollback_segments
100
SELECT * FROM information_schema.global_variables 
WHERE variable_name='innodb_rollback_segments';
VARIABLE_NAME	VARIABLE_VALUE
INNODB_ROLLBACK_SEGMENTS	100
SELECT * FROM information_schema.session_variables 
WHERE variable_name='innodb_rollback_segments';
VARIABLE_NAME	VARIABLE_VALUE
INNODB_ROLLBACK_SEGMENTS	100
SET session innodb_rollback_segments=1;
ERROR HY000: Variable 'innodb_rollback_segments' is a GLOBAL variable and should be set with SET GLOBAL
SET global innodb_rollback_segments=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
SET global innodb_rollback_segments=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
SET global innodb_rollback_segments="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
SET global innodb_rollback_segments=-7;
Warnings:
Warning	1292	Truncated incorrect innodb_rollback_segments value: '-7'
SELECT @@global.innodb_rollback_segments;
@@global.innodb_rollback_segments
1
SELECT * FROM information_schema.global_variables 
WHERE variable_name='innodb_rollback_segments';
VARIABLE_NAME	VARIABLE_VALUE
INNODB_ROLLBACK_SEGMENTS	1
SET @@global.innodb_rollback_segments = @start_global_value;
SELECT @@global.innodb_rollback_segments;
@@global.innodb_rollback_segments
128
