~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/log_output_basic.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################# mysql-test\t\log_output_basic.test ##########################
 
2
#                                                                             #
 
3
# Variable Name: log_output                                                   # 
 
4
# Scope: GLOBAL                                                               #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: enumeration                                                      #
 
7
# Default Value: TABLE                                                        #
 
8
# Range: TABLE, FILE, NONE                                                    #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-02-07                                                   #
 
12
# Author:  Rizwan                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable log_output               #
 
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
#                    START OF log_output TESTS                         #
 
30
######################################################################## 
 
31
 
 
32
 
 
33
######################################################################## 
 
34
#     Saving initial value of log_output in a temporary variable       #
 
35
######################################################################## 
 
36
 
 
37
SET @start_value = @@global.log_output;
 
38
SELECT @start_value;
 
39
 
 
40
 
 
41
--echo '#--------------------FN_DYNVARS_065_01------------------------#'
 
42
######################################################################## 
 
43
#                    Display the DEFAULT value of log_output           #
 
44
######################################################################## 
 
45
 
 
46
SET @@global.log_output = FILE;
 
47
SET @@global.log_output = DEFAULT;
 
48
SELECT @@global.log_output;
 
49
--echo 'Bug# 34876: Documentation specifies a DEFAULT value of TABLE whereas';
 
50
--echo 'DEFAULT value is FILE. Also note that initial value is different';
 
51
--echo 'from DEFAULT';
 
52
 
 
53
 
 
54
--echo '#---------------------FN_DYNVARS_065_02-------------------------#'
 
55
################################################## 
 
56
#      Check if NULL or empty value is accepeted #
 
57
################################################## 
 
58
 
 
59
--Error ER_WRONG_VALUE_FOR_VAR
 
60
SET @@global.log_output = NULL;
 
61
 
 
62
--Error ER_WRONG_VALUE_FOR_VAR
 
63
SET @@global.log_output = "";
 
64
SELECT @@global.log_output;
 
65
--echo 'Bug# 34838: Empty value is allowed where as it is not specified in';
 
66
--echo 'documentation';
 
67
 
 
68
--echo '#--------------------FN_DYNVARS_065_03------------------------#'
 
69
######################################################################## 
 
70
#              Change the value of log_output to a valid value         #
 
71
######################################################################## 
 
72
 
 
73
SET @@global.log_output = 'TABLE';
 
74
SELECT @@global.log_output;
 
75
 
 
76
SET @@global.log_output = 'FILE';
 
77
SELECT @@global.log_output;
 
78
 
 
79
SET @@global.log_output = 'NONE';
 
80
SELECT @@global.log_output;
 
81
 
 
82
SET @@global.log_output = 'FILE,TABLE';
 
83
SELECT @@global.log_output;
 
84
 
 
85
SET @@global.log_output = 'TABLE,FILE';
 
86
SELECT @@global.log_output;
 
87
 
 
88
SET @@global.log_output = 'NONE,TABLE';
 
89
SELECT @@global.log_output;
 
90
 
 
91
SET @@global.log_output = 'NONE,FILE';
 
92
SELECT @@global.log_output;
 
93
 
 
94
SET @@global.log_output = 'FILE,TABLE,NONE';
 
95
SELECT @@global.log_output;
 
96
 
 
97
SET @@global.log_output = 'TABLE,NONE';
 
98
SELECT @@global.log_output;
 
99
 
 
100
SET @@global.log_output = 'TABLE,TABLE';
 
101
SELECT @@global.log_output;
 
102
 
 
103
SET @@global.log_output = ',TABLE';
 
104
SELECT @@global.log_output;
 
105
 
 
106
SET @@global.log_output = ',';
 
107
SELECT @@global.log_output;
 
108
 
 
109
SET @@global.log_output = 'TABLE,,FILE,,,';
 
110
SELECT @@global.log_output;
 
111
 
 
112
 
 
113
--echo '#--------------------FN_DYNVARS_065_04-------------------------#'
 
114
########################################################################### 
 
115
#               Change the value of log_output to invalid value           #
 
116
########################################################################### 
 
117
 
 
118
--Error ER_WRONG_VALUE_FOR_VAR
 
119
SET @@global.log_output = -1;
 
120
--Error ER_WRONG_VALUE_FOR_VAR
 
121
SET @@global.log_output = TAB;
 
122
--Error ER_WRONG_VALUE_FOR_VAR
 
123
SET @@global.log_output = NIL;
 
124
--Error ER_WRONG_VALUE_FOR_VAR
 
125
SET @@global.log_output = 'FIL';
 
126
--Error ER_WRONG_VALUE_FOR_VAR
 
127
SET @@global.log_output = 'T';
 
128
 
 
129
# use of space in value
 
130
--Error ER_WRONG_VALUE_FOR_VAR
 
131
SET @@global.log_output = 'TABLE, FILE';
 
132
--Error ER_WRONG_VALUE_FOR_VAR
 
133
SET @@global.log_output = ' TABLE,FILE';
 
134
 
 
135
--Error ER_WRONG_VALUE_FOR_VAR
 
136
SET @@global.log_output = ', ';
 
137
--Error ER_WRONG_VALUE_FOR_VAR
 
138
SELECT @@global.log_output;
 
139
--Error ER_WRONG_VALUE_FOR_VAR
 
140
SET @@global.log_output = ' ';
 
141
SELECT @@global.log_output;
 
142
--Error ER_WRONG_VALUE_FOR_VAR
 
143
SET @@global.log_output = '   ';
 
144
SELECT @@global.log_output;
 
145
 
 
146
--echo 'Bug: The behavior of space in value is not consistent.';
 
147
--echo 'Some times it is trimmed and some times not.';
 
148
--echo 'The space before and after value is not accepted where as space';
 
149
--echo 'between comma is accepted.';
 
150
 
 
151
 
 
152
--echo '#-------------------FN_DYNVARS_065_05----------------------------#'
 
153
######################################################################
 
154
#              Test if accessing session log_output gives error      #
 
155
######################################################################
 
156
 
 
157
--Error ER_GLOBAL_VARIABLE
 
158
SET @@log_output = 0;
 
159
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
160
SELECT @@session.log_output;
 
161
 
 
162
 
 
163
--echo '#----------------------FN_DYNVARS_065_06------------------------#'
 
164
######################################################################## 
 
165
#     Check if the value in GLOBAL Table matches value in variable     #
 
166
########################################################################
 
167
 
 
168
SELECT @@log_output = VARIABLE_VALUE 
 
169
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
170
WHERE VARIABLE_NAME='log_output';
 
171
 
 
172
 
 
173
--echo '#---------------------FN_DYNVARS_065_07-------------------------#'
 
174
################################################################### 
 
175
#        Check if numbers can be used on variable                 #
 
176
################################################################### 
 
177
 
 
178
# test if variable accepts 0,1,2
 
179
--Error ER_WRONG_VALUE_FOR_VAR
 
180
SET @@global.log_output = 0;
 
181
SELECT @@global.log_output;
 
182
 
 
183
--Error ER_WRONG_VALUE_FOR_VAR
 
184
SET @@global.log_output = 1;
 
185
SELECT @@global.log_output;
 
186
 
 
187
--Error ER_WRONG_VALUE_FOR_VAR
 
188
SET @@global.log_output = 2;
 
189
SELECT @@global.log_output;
 
190
 
 
191
--Error ER_WRONG_VALUE_FOR_VAR
 
192
SET @@global.log_output = 3;
 
193
SELECT @@global.log_output;
 
194
 
 
195
--Error ER_WRONG_VALUE_FOR_VAR
 
196
SET @@global.log_output = 4;
 
197
SELECT @@global.log_output;
 
198
 
 
199
--Error ER_WRONG_VALUE_FOR_VAR
 
200
SET @@global.log_output = 5;
 
201
SELECT @@global.log_output;
 
202
 
 
203
--Error ER_WRONG_VALUE_FOR_VAR
 
204
SET @@global.log_output = 6;
 
205
SELECT @@global.log_output;
 
206
 
 
207
--Error ER_WRONG_VALUE_FOR_VAR
 
208
SET @@global.log_output = 7;
 
209
SELECT @@global.log_output;
 
210
 
 
211
--Error ER_WRONG_VALUE_FOR_VAR
 
212
SET @@global.log_output = 8;
 
213
 
 
214
 
 
215
--echo '#---------------------FN_DYNVARS_065_08----------------------#'
 
216
################################################################### 
 
217
#      Check if TRUE and FALSE values can be used on variable     #
 
218
################################################################### 
 
219
 
 
220
--Error ER_WRONG_VALUE_FOR_VAR
 
221
SET @@global.log_output = TRUE;
 
222
SELECT @@global.log_output;
 
223
--Error ER_WRONG_VALUE_FOR_VAR
 
224
SET @@global.log_output = FALSE;
 
225
SELECT @@global.log_output;
 
226
 
 
227
--echo '#---------------------FN_DYNVARS_065_09----------------------#'
 
228
################################################################  
 
229
# Check if log_output can be accessed with and without @@ sign #
 
230
################################################################
 
231
--Error ER_GLOBAL_VARIABLE
 
232
SET log_output = ON;
 
233
 
 
234
SET global log_output = 'TABLE';
 
235
SELECT @@global.log_output;
 
236
 
 
237
##############################  
 
238
#   Restore initial value    #
 
239
##############################
 
240
 
 
241
SET @@global.log_output = @start_value;
 
242
SELECT @@global.log_output;
 
243
 
 
244
################################################################### 
 
245
#                    END OF log_output TESTS                      #
 
246
###################################################################