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