--source include/have_xtradb.inc

# A dynamic, global variable

SET @start_value = @@GLOBAL.innodb_empty_free_list_algorithm;

# Default value
SELECT @@GLOBAL.innodb_empty_free_list_algorithm;

# Global only
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.innodb_empty_free_list_algorithm;

# Correct values
SET GLOBAL innodb_empty_free_list_algorithm='legacy';
SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
SET GLOBAL innodb_empty_free_list_algorithm='backoff';
SELECT @@GLOBAL.innodb_empty_free_list_algorithm;

# Incorrect values
--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL innodb_empty_free_list_algorithm=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL innodb_empty_free_list_algorithm=1e1;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_empty_free_list_algorithm=2;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_empty_free_list_algorithm='foo';

SET GLOBAL innodb_empty_free_list_algorithm = @start_value;
