# Variable Name: innodb_max_purge_lag_delay
# Scope: Global                                                               #
# Access Type: Static                                                         #
# Data Type: numeric                                                          #

--source include/have_innodb.inc

SELECT @@GLOBAL.innodb_max_purge_lag_delay;
--echo 0 Expected

SET @@GLOBAL.innodb_max_purge_lag_delay=1;

SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
--echo 1 Expected

SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
--echo 1 Expected

SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
--echo 1 Expected

SELECT COUNT(@@innodb_max_purge_lag_delay);
--echo 1 Expected

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_max_purge_lag_delay);
--echo Expected error 'Variable is a GLOBAL variable'

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
--echo Expected error 'Variable is a GLOBAL variable'

--Error ER_BAD_FIELD_ERROR
SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;

set global innodb_max_purge_lag_delay = -1;
set global innodb_max_purge_lag_delay = 1000000;
set global innodb_max_purge_lag_delay = 10000000;
set global innodb_max_purge_lag_delay = 100000000;
set global innodb_max_purge_lag_delay = 100000001;
set global innodb_max_purge_lag_delay = 0;
