Debian Codegraph @

mysql-test/suite/sys_vars/t/mysql56_temporal_format_basic.test

raw
1 ############## mysql-test\t\mysql56_temporal_format_basic.test ################
2 # #
3 # Variable Name: mysql56_temporal_format #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: boolean #
7 # Default Value: OFF #
8 # Range: #
9 # #
10 # Creation Date: 2014-08-27 #
11 # #
12 # Description: Test Cases of Dynamic System Variable mysql56_temporal_format #
13 # that checks the behavior of this variable in the following ways#
14 # * Default Value #
15 # * Valid & Invalid values #
16 # * Scope & Access method #
17 # * Data Integrity #
18 # #
19 ###############################################################################
20
21 --source include/load_sysvars.inc
22 ########################################################################
23 # START OF mysql56_temporal_format TESTS #
24 ########################################################################
25
26
27 ###########################################################################
28 # Saving initial value of mysql56_temporal_format in a temporary variable #
29 ###########################################################################
30
31 SET @start_value = @@global.mysql56_temporal_format;
32 SELECT @start_value;
33
34
35 --echo '#--------------------FN_DYNVARS_030_01------------------------#'
36 #############################################################
37 # Display the DEFAULT value of mysql56_temporal_format #
38 #############################################################
39
40 SET @@global.mysql56_temporal_format = ON;
41 SET @@global.mysql56_temporal_format = DEFAULT;
42 SELECT @@global.mysql56_temporal_format;
43
44
45 --echo '#---------------------FN_DYNVARS_030_02-------------------------#'
46 ###############################################
47 # Verify default value of variable #
48 ###############################################
49
50 SET @@global.mysql56_temporal_format = @start_value;
51 SELECT @@global.mysql56_temporal_format;
52
53
54 --echo '#--------------------FN_DYNVARS_030_03------------------------#'
55 ################################################################
56 # Change the value of mysql56_temporal_format to a valid value #
57 ################################################################
58
59 SET @@global.mysql56_temporal_format = ON;
60 SELECT @@global.mysql56_temporal_format;
61 SET @@global.mysql56_temporal_format = OFF;
62 SELECT @@global.mysql56_temporal_format;
63 SET @@global.mysql56_temporal_format = 0;
64 SELECT @@global.mysql56_temporal_format;
65 SET @@global.mysql56_temporal_format = 1;
66 SELECT @@global.mysql56_temporal_format;
67
68
69 --echo '#--------------------FN_DYNVARS_030_04-------------------------#'
70 ###########################################################################
71 # Change the value of mysql56_temporal_format to invalid value #
72 ###########################################################################
73
74 --Error ER_WRONG_VALUE_FOR_VAR
75 SET @@global.mysql56_temporal_format = 2;
76 --Error ER_WRONG_VALUE_FOR_VAR
77 SET @@global.mysql56_temporal_format = -1;
78 --Error ER_WRONG_VALUE_FOR_VAR
79 SET @@global.mysql56_temporal_format = TRUEF;
80 --Error ER_WRONG_VALUE_FOR_VAR
81 SET @@global.mysql56_temporal_format = TRUE_F;
82 --Error ER_WRONG_VALUE_FOR_VAR
83 SET @@global.mysql56_temporal_format = FALSE0;
84 --Error ER_WRONG_VALUE_FOR_VAR
85 SET @@global.mysql56_temporal_format = OON;
86 --Error ER_WRONG_VALUE_FOR_VAR
87 SET @@global.mysql56_temporal_format = ONN;
88 --Error ER_WRONG_VALUE_FOR_VAR
89 SET @@global.mysql56_temporal_format = OOFF;
90 --Error ER_WRONG_VALUE_FOR_VAR
91 SET @@global.mysql56_temporal_format = 0FF;
92 --Error ER_WRONG_VALUE_FOR_VAR
93 SET @@global.mysql56_temporal_format = ' ';
94 --Error ER_WRONG_VALUE_FOR_VAR
95 SET @@global.mysql56_temporal_format = " ";
96 --Error ER_WRONG_VALUE_FOR_VAR
97 SET @@global.mysql56_temporal_format = '';
98
99
100 --echo '#-------------------FN_DYNVARS_030_05----------------------------#'
101 ###########################################################################
102 # Test if accessing session mysql56_temporal_format gives error #
103 ###########################################################################
104
105 --Error ER_GLOBAL_VARIABLE
106 SET @@session.mysql56_temporal_format = 1;
107 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
108 SELECT @@session.mysql56_temporal_format;
109
110
111 --echo '#----------------------FN_DYNVARS_030_06------------------------#'
112 ####################################################################
113 # Check if the value in GLOBAL Tables matches values in variable #
114 ####################################################################
115
116 SELECT IF(@@global.mysql56_temporal_format, "ON", "OFF") = VARIABLE_VALUE
117 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
118 WHERE VARIABLE_NAME='mysql56_temporal_format';
119
120
121 --echo '#---------------------FN_DYNVARS_030_07----------------------#'
122 ###################################################################
123 # Check if TRUE and FALSE values can be used on variable #
124 ###################################################################
125
126 SET @@global.mysql56_temporal_format = TRUE;
127 SELECT @@global.mysql56_temporal_format;
128 SET @@global.mysql56_temporal_format = FALSE;
129 SELECT @@global.mysql56_temporal_format;
130
131
132 --echo '#---------------------FN_DYNVARS_030_08----------------------#'
133 ###############################################################################
134 # Check if accessing variable without SCOPE points to same global variable #
135 ###############################################################################
136
137 SET @@global.mysql56_temporal_format = 1;
138 SELECT @@mysql56_temporal_format = @@global.mysql56_temporal_format;
139
140 --echo '#---------------------FN_DYNVARS_030_09----------------------#'
141 #############################################################################
142 # Check if mysql56_temporal_format can be accessed with and without @@ sign #
143 #############################################################################
144
145 --Error ER_GLOBAL_VARIABLE
146 SET mysql56_temporal_format = 1;
147 --Error ER_UNKNOWN_TABLE
148 SELECT global.mysql56_temporal_format;
149 --Error ER_BAD_FIELD_ERROR
150 SELECT mysql56_temporal_format = @@session.mysql56_temporal_format;
151
152
153 ##############################
154 # Restore initial value #
155 ##############################
156
157 SET @@global.mysql56_temporal_format = @start_value;
158 SELECT @@global.mysql56_temporal_format;
159
160
161 #############################################################
162 # END OF mysql56_temporal_format TESTS #
163 #############################################################