3
################## mysql-test\t\system_time_zone_basic.test ###################
5
# Variable Name: system_time_zone #
7
# Access Type: Static #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable system_time_zone #
16
# that checks the behavior of this variable in the following ways #
20
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21
# server-system-variables.html #
23
###############################################################################
25
--echo '#---------------------BS_STVARS_050_01----------------------#'
26
####################################################################
27
# Displaying default value #
28
####################################################################
29
SELECT COUNT(@@GLOBAL.system_time_zone);
33
--echo '#---------------------BS_STVARS_050_02----------------------#'
34
####################################################################
35
# Check if Value can set #
36
####################################################################
38
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
39
SET @@GLOBAL.system_time_zone=1;
40
--echo Expected error 'Read only variable'
42
SELECT COUNT(@@GLOBAL.system_time_zone);
48
--echo '#---------------------BS_STVARS_050_03----------------------#'
49
#################################################################
50
# Check if the value in GLOBAL Table matches value in variable #
51
#################################################################
53
SELECT @@GLOBAL.system_time_zone = VARIABLE_VALUE
54
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
55
WHERE VARIABLE_NAME='system_time_zone';
58
SELECT COUNT(@@GLOBAL.system_time_zone);
61
SELECT COUNT(VARIABLE_VALUE)
62
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
63
WHERE VARIABLE_NAME='system_time_zone';
68
--echo '#---------------------BS_STVARS_050_04----------------------#'
69
################################################################################
70
# Check if accessing variable with and without GLOBAL point to same variable #
71
################################################################################
72
SELECT @@system_time_zone = @@GLOBAL.system_time_zone;
77
--echo '#---------------------BS_STVARS_050_05----------------------#'
78
################################################################################
79
# Check if system_time_zone can be accessed with and without @@ sign #
80
################################################################################
82
SELECT COUNT(@@system_time_zone);
85
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
86
SELECT COUNT(@@local.system_time_zone);
87
--echo Expected error 'Variable is a GLOBAL variable'
89
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
90
SELECT COUNT(@@SESSION.system_time_zone);
91
--echo Expected error 'Variable is a GLOBAL variable'
93
SELECT COUNT(@@GLOBAL.system_time_zone);
96
--Error ER_BAD_FIELD_ERROR
97
SELECT system_time_zone = @@SESSION.system_time_zone;
98
--echo Expected error 'Readonly variable'