1SET @start_global_value = @@global.innodb_background_scrub_data_compressed;
2#
3# exists as global only
4#
5select @@global.innodb_background_scrub_data_compressed;
6@@global.innodb_background_scrub_data_compressed
70
8select @@session.innodb_background_scrub_data_compressed;
9ERROR HY000: Variable 'innodb_background_scrub_data_compressed' is a GLOBAL variable
10show global variables like 'innodb_background_scrub_data_compressed';
11Variable_name	Value
12innodb_background_scrub_data_compressed	OFF
13show session variables like 'innodb_background_scrub_data_compressed';
14Variable_name	Value
15innodb_background_scrub_data_compressed	OFF
16select * from information_schema.global_variables
17where variable_name='innodb_background_scrub_data_compressed';
18VARIABLE_NAME	VARIABLE_VALUE
19INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED	OFF
20Warnings:
21Warning	1287	'INFORMATION_SCHEMA.GLOBAL_VARIABLES' is deprecated and will be removed in a future release. Please use performance_schema.global_variables instead
22select * from information_schema.session_variables
23where variable_name='innodb_background_scrub_data_compressed';
24VARIABLE_NAME	VARIABLE_VALUE
25INNODB_BACKGROUND_SCRUB_DATA_COMPRESSED	OFF
26Warnings:
27Warning	1287	'INFORMATION_SCHEMA.SESSION_VARIABLES' is deprecated and will be removed in a future release. Please use performance_schema.session_variables instead
28#
29# show that it's writable
30#
31set global innodb_background_scrub_data_compressed=ON;
32select @@global.innodb_background_scrub_data_compressed;
33@@global.innodb_background_scrub_data_compressed
341
35set global innodb_background_scrub_data_compressed=OFF;
36select @@global.innodb_background_scrub_data_compressed;
37@@global.innodb_background_scrub_data_compressed
380
39set global innodb_background_scrub_data_compressed=1;
40select @@global.innodb_background_scrub_data_compressed;
41@@global.innodb_background_scrub_data_compressed
421
43set session innodb_background_scrub_data_compressed=1;
44ERROR HY000: Variable 'innodb_background_scrub_data_compressed' is a GLOBAL variable and should be set with SET GLOBAL
45#
46# incorrect types
47#
48set global innodb_background_scrub_data_compressed=1.1;
49ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_compressed'
50set global innodb_background_scrub_data_compressed=1e1;
51ERROR 42000: Incorrect argument type to variable 'innodb_background_scrub_data_compressed'
52set global innodb_background_scrub_data_compressed="foo";
53ERROR 42000: Variable 'innodb_background_scrub_data_compressed' can't be set to the value of 'foo'
54SET @@global.innodb_background_scrub_data_compressed = @start_global_value;
55