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

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

#
# show that it's writable
#
set global end_markers_in_json=1;
select @@global.end_markers_in_json;
set session end_markers_in_json=1;
select @@session.end_markers_in_json;
set global end_markers_in_json=0;
select @@global.end_markers_in_json;
set session end_markers_in_json=0;
select @@session.end_markers_in_json;
set session end_markers_in_json=on;
select @@session.end_markers_in_json;
set session end_markers_in_json=off;
select @@session.end_markers_in_json;
set session end_markers_in_json=default;
select @@session.end_markers_in_json;

#
# incorrect assignments
#
--error ER_WRONG_TYPE_FOR_VAR
set global end_markers_in_json=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global end_markers_in_json=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set session end_markers_in_json="foobar";

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