# ulong session
--source include/have_maria.inc

SET @start_global_value = @@global.aria_sort_buffer_size;

#
# exists as global only
#
select @@global.aria_sort_buffer_size;
select @@session.aria_sort_buffer_size;
show global variables like 'aria_sort_buffer_size';
show session variables like 'aria_sort_buffer_size';
select * from information_schema.global_variables where variable_name='aria_sort_buffer_size';
select * from information_schema.session_variables where variable_name='aria_sort_buffer_size';

#
# show that it's writable
#
set global aria_sort_buffer_size=10;
select @@global.aria_sort_buffer_size;
set session aria_sort_buffer_size=10;
select @@session.aria_sort_buffer_size;

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

#
# min/max values, block size
#
set global aria_sort_buffer_size=0;
select @@global.aria_sort_buffer_size;
--disable_warnings
set session aria_sort_buffer_size=cast(-1 as unsigned int);
--enable_warnings
--replace_result 4294967295 18446744073709551615
select @@session.aria_sort_buffer_size;

SET @@global.aria_sort_buffer_size = @start_global_value;

