#
# 2011-08-02 - Added
#
--source include/not_embedded.inc
--source include/have_innodb.inc
--source suite/innodb/include/restart_and_reinit.inc

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

#
# exists as global only
#
--echo Valid values are 'Antelope' and 'Barracuda' 
SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
SELECT @@global.innodb_file_format_max;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_file_format_max;
SHOW global variables LIKE 'innodb_file_format_max';
SHOW session variables LIKE 'innodb_file_format_max';
SELECT * FROM information_schema.global_variables 
WHERE variable_name='innodb_file_format_max';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_file_format_max';

#
# show that it's writable
#
SET global innodb_file_format_max='Antelope';
SELECT @@global.innodb_file_format_max;
SELECT * FROM information_schema.global_variables 
WHERE variable_name='innodb_file_format_max';
SELECT * FROM information_schema.session_variables 
WHERE variable_name='innodb_file_format_max';
SET @@global.innodb_file_format_max='Barracuda';
SELECT @@global.innodb_file_format_max;
SELECT * FROM information_schema.global_variables 
WHERE variable_name='innodb_file_format_max';
SELECT * FROM information_schema.session_variables 
WHERE variable_name='innodb_file_format_max';
--error ER_GLOBAL_VARIABLE
SET session innodb_file_format_max='Salmon';
--error ER_GLOBAL_VARIABLE
SET @@session.innodb_file_format_max='Salmon';

#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_file_format_max=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_file_format_max=1e1;
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_file_format_max='Salmon';

#
# Cleanup
#

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