CREATE TABLE valid_values (value varchar(255)) ENGINE=myisam;
INSERT INTO valid_values VALUES(0);
INSERT INTO valid_values VALUES(1);
INSERT INTO valid_values VALUES(1024);
INSERT INTO valid_values VALUES(1024 * 1024 * 1024);
CREATE TABLE invalid_values (value varchar(255)) ENGINE=myisam;
INSERT INTO invalid_values VALUES('\'aaa\'');
SET @start_global_value = @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
SELECT @start_global_value;
@start_global_value
0
'# Setting to valid values in global scope#'
"Trying to set variable @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME to 0"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME   = 0;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
0
"Setting the global scope variable back to default"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = DEFAULT;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
60000000
"Trying to set variable @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME to 1"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME   = 1;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
1
"Setting the global scope variable back to default"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = DEFAULT;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
60000000
"Trying to set variable @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME to 1024"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME   = 1024;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
1024
"Setting the global scope variable back to default"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = DEFAULT;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
60000000
"Trying to set variable @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME to 1073741824"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME   = 1073741824;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
1073741824
"Setting the global scope variable back to default"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = DEFAULT;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
60000000
"Trying to set variable @@session.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME to 444. It should fail because it is not session."
SET @@session.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME   = 444;
ERROR HY000: Variable 'rocksdb_force_compute_memtable_stats_cachetime' is a GLOBAL variable and should be set with SET GLOBAL
'# Testing with invalid values in global scope #'
"Trying to set variable @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME to 'aaa'"
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME   = 'aaa';
Got one of the listed errors
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
60000000
SET @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME = @start_global_value;
SELECT @@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME;
@@global.ROCKSDB_FORCE_COMPUTE_MEMTABLE_STATS_CACHETIME
0
DROP TABLE valid_values;
DROP TABLE invalid_values;
