# See kill_idle_transaction_basic.test

SET @saved_innodb_kill_idle_transaction= @@GLOBAL.innodb_kill_idle_transaction;

SELECT @@innodb_kill_idle_transaction;
SELECT @@kill_idle_transaction;

--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.innodb_kill_idle_transaction;

SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
SHOW SESSION VARIABLES LIKE 'innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name='innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE variable_name='innodb_kill_idle_transaction';

--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL innodb_kill_idle_transaction= 1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL innodb_kill_idle_transaction= 1e1;
--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL innodb_kill_idle_transaction= "foo";

SET GLOBAL innodb_kill_idle_transaction= 0;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name='innodb_kill_idle_transaction';
SELECT @@kill_idle_transaction;

SET GLOBAL innodb_kill_idle_transaction= 12345;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name='innodb_kill_idle_transaction';
SELECT @@kill_idle_transaction;

SET GLOBAL innodb_kill_idle_transaction= 4294967295;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name='innodb_kill_idle_transaction';
SELECT @@kill_idle_transaction;

SET GLOBAL innodb_kill_idle_transaction= 31536000;
SHOW GLOBAL VARIABLES LIKE 'innodb_kill_idle_transaction';
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name='innodb_kill_idle_transaction';
SELECT @@kill_idle_transaction;

SET GLOBAL innodb_kill_idle_transaction= @saved_innodb_kill_idle_transaction;
