

# 2011-02-09 - Added
#

--source include/have_innodb.inc

SET @start_global_value = @@global.innodb_change_buffer_max_size;
SELECT @start_global_value;

#
# exists as global only
#
--echo Valid values are between 0 and 50
select @@global.innodb_change_buffer_max_size between 0 and 50;
select @@global.innodb_change_buffer_max_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_change_buffer_max_size;
show global variables like 'innodb_change_buffer_max_size';
show session variables like 'innodb_change_buffer_max_size';
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';

#
# show that it's writable
#
set global innodb_change_buffer_max_size=10;
select @@global.innodb_change_buffer_max_size;
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
--error ER_GLOBAL_VARIABLE
set session innodb_change_buffer_max_size=1;

#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffer_max_size=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffer_max_size=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffer_max_size="foo";

set global innodb_change_buffer_max_size=-7;
select @@global.innodb_change_buffer_max_size;
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
set global innodb_change_buffer_max_size=56;
select @@global.innodb_change_buffer_max_size;
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';

#
# min/max/DEFAULT values
#
set global innodb_change_buffer_max_size=0;
select @@global.innodb_change_buffer_max_size;
set global innodb_change_buffer_max_size=50;
select @@global.innodb_change_buffer_max_size;
set global innodb_change_buffer_max_size=DEFAULT;
select @@global.innodb_change_buffer_max_size;


SET @@global.innodb_change_buffer_max_size = @start_global_value;
SELECT @@global.innodb_change_buffer_max_size;
