Debian Codegraph @

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

raw
1 ############## mysql-test\t\expire_logs_days_basic.test ###############
2 # #
3 # Variable Name: expire_logs_days #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: double #
7 # Default Value:0 #
8 # Range: 0-99 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable expire_logs_days #
15 # that checks the behavior of this variable in the following ways#
16 # * Default Value #
17 # * Valid & Invalid values #
18 # * Scope & Access method #
19 # * Data Integrity #
20 # #
21 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22 # server-system-variables.html #
23 # #
24 ###############################################################################
25
26 --source include/load_sysvars.inc
27
28
29 ########################################################################
30 # START OF expire_logs_days TESTS #
31 ########################################################################
32
33
34 ########################################################################
35 # Saving initial value of expire_logs_days in a temporary variable #
36 ########################################################################
37
38 SET @start_value = @@global.expire_logs_days;
39
40
41 --echo '#--------------------FN_DYNVARS_029_01------------------------#'
42 ########################################################################
43 # Display the DEFAULT value of expire_logs_days #
44 ########################################################################
45
46 SET @@global.expire_logs_days = 99;
47 SET @@global.expire_logs_days = DEFAULT;
48 SELECT @@global.expire_logs_days = 0;
49
50
51 --echo '#---------------------FN_DYNVARS_029_02-------------------------#'
52 ###############################################
53 # Verify default value of variable #
54 ###############################################
55
56 SET @@global.expire_logs_days = @start_value;
57 SELECT @@global.expire_logs_days = @start_value;
58
59
60 --echo '#--------------------FN_DYNVARS_029_03------------------------#'
61 ########################################################################
62 # Change the value of expire_logs_days to a valid value #
63 ########################################################################
64
65 SET @@global.expire_logs_days = 0;
66 SELECT @@global.expire_logs_days;
67 SET @@global.expire_logs_days = 99;
68 SELECT @@global.expire_logs_days;
69 SET @@global.expire_logs_days = 10;
70 SELECT @@global.expire_logs_days;
71 SET @@global.expire_logs_days = 21;
72 SELECT @@global.expire_logs_days;
73
74
75 --echo '#--------------------FN_DYNVARS_029_04-------------------------#'
76 ###########################################################################
77 # Change the value of expire_logs_days to invalid value #
78 ###########################################################################
79
80 SET @@global.expire_logs_days = -1;
81 SELECT @@global.expire_logs_days;
82 SET @@global.expire_logs_days = 100;
83 SELECT @@global.expire_logs_days;
84 SET @@global.expire_logs_days = 1024;
85 SELECT @@global.expire_logs_days;
86 SET @@global.expire_logs_days = 10000.01;
87 SELECT @@global.expire_logs_days;
88 SET @@global.expire_logs_days = -1024;
89 SELECT @@global.expire_logs_days;
90 SET @@global.expire_logs_days = 42949672950;
91 SELECT @@global.expire_logs_days;
92
93 --Error ER_WRONG_TYPE_FOR_VAR
94 SET @@global.expire_logs_days = ON;
95 SELECT @@global.expire_logs_days;
96 --Error ER_WRONG_TYPE_FOR_VAR
97 SET @@global.expire_logs_days = 'test';
98 SELECT @@global.expire_logs_days;
99
100
101 --echo '#-------------------FN_DYNVARS_029_05----------------------------#'
102 ###########################################################################
103 # Test if accessing session expire_logs_days gives error #
104 ###########################################################################
105
106 --Error ER_GLOBAL_VARIABLE
107 SET @@session.expire_logs_days = 0;
108 SELECT @@expire_logs_days;
109
110
111 --echo '#----------------------FN_DYNVARS_029_06------------------------#'
112 ##############################################################################
113 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
114 ##############################################################################
115
116 SELECT @@global.expire_logs_days = VARIABLE_VALUE
117 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
118 WHERE VARIABLE_NAME='expire_logs_days';
119
120 SELECT @@expire_logs_days = VARIABLE_VALUE
121 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
122 WHERE VARIABLE_NAME='expire_logs_days';
123
124
125
126 --echo '#---------------------FN_DYNVARS_029_07----------------------#'
127 ###################################################################
128 # Check if TRUE and FALSE values can be used on variable #
129 ###################################################################
130
131 SET @@global.expire_logs_days = TRUE;
132 SELECT @@global.expire_logs_days;
133 SET @@global.expire_logs_days = FALSE;
134 SELECT @@global.expire_logs_days;
135
136
137 --echo '#---------------------FN_DYNVARS_029_08----------------------#'
138 ########################################################################################################
139 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
140 ########################################################################################################
141
142 SET @@global.expire_logs_days = 1;
143 SELECT @@expire_logs_days = @@global.expire_logs_days;
144
145
146 --echo '#---------------------FN_DYNVARS_029_09----------------------#'
147 ##########################################################################
148 # Check if expire_logs_days can be accessed with and without @@ sign #
149 ##########################################################################
150
151 --Error ER_GLOBAL_VARIABLE
152 SET expire_logs_days = 1;
153 SELECT @@expire_logs_days;
154 --Error ER_UNKNOWN_TABLE
155 SELECT local.expire_logs_days;
156 --Error ER_UNKNOWN_TABLE
157 SELECT global.expire_logs_days;
158 --Error ER_BAD_FIELD_ERROR
159 SELECT expire_logs_days = @@session.expire_logs_days;
160
161
162 ##############################
163 # Restore initial value #
164 ##############################
165
166 SET @@global.expire_logs_days = @start_value;
167
168 ########################################################################
169 # END OF expire_logs_days TESTS #
170 ########################################################################