#######################################################
# Basic test for innodb_log_arch_dir variable #
#######################################################

--source include/have_xtradb.inc

let $datadir= `select @@datadir`;

####################################################################
#   Displaying default value                                       #
####################################################################
--replace_result $datadir ./
SELECT @@GLOBAL.innodb_log_arch_dir;
--echo NULL Expected


####################################################################
#   Check if Value can set                                         #
####################################################################

--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_log_arch_dir=1;
--echo Expected error 'Read only variable'

--replace_result $datadir ./
SELECT @@GLOBAL.innodb_log_arch_dir;
--echo NULL Expected

--replace_result $datadir ./
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
WHERE VARIABLE_NAME='innodb_log_arch_dir';
--echo empty string Expected

############################################
#  Check accessing variable without GLOBAL #
############################################
--replace_result $datadir ./
SELECT @@innodb_log_arch_dir;
--echo NULL Expected



##########################################################################
#   Check if innodb_log_arch_dir can be accessed without @@ sign #
##########################################################################

--replace_result $datadir ./
SELECT @@innodb_log_arch_dir;
--echo NULL Expected

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@local.innodb_log_arch_dir;
--echo Expected error 'Variable is a GLOBAL variable'

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.innodb_log_arch_dir;
--echo Expected error 'Variable is a GLOBAL variable'

--replace_result $datadir ./
SELECT @@GLOBAL.innodb_log_arch_dir;
--echo NULL Expected

--Error ER_BAD_FIELD_ERROR
SELECT innodb_log_arch_dir = @@SESSION.innodb_log_arch_dir;
--echo Expected error Unknown column 'innodb_log_arch_dir' in 'field list'


