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