1
################# mysql-test\t\log_output_basic.test ##########################
3
# Variable Name: log_output #
5
# Access Type: Dynamic #
6
# Data Type: enumeration #
7
# Default Value: TABLE #
8
# Range: TABLE, FILE, NONE #
11
# Creation Date: 2008-02-07 #
14
# Description: Test Cases of Dynamic System Variable log_output #
15
# that checks the behavior of this variable in the following ways#
17
# * Valid & Invalid values #
18
# * Scope & Access method #
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22
# server-system-variables.html #
24
###############################################################################
26
--source include/load_sysvars.inc
28
########################################################################
29
# START OF log_output TESTS #
30
########################################################################
33
########################################################################
34
# Saving initial value of log_output in a temporary variable #
35
########################################################################
37
SET @start_value = @@global.log_output;
41
--echo '#--------------------FN_DYNVARS_065_01------------------------#'
42
########################################################################
43
# Display the DEFAULT value of log_output #
44
########################################################################
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';
54
--echo '#---------------------FN_DYNVARS_065_02-------------------------#'
55
##################################################
56
# Check if NULL or empty value is accepeted #
57
##################################################
59
--Error ER_WRONG_VALUE_FOR_VAR
60
SET @@global.log_output = NULL;
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';
68
--echo '#--------------------FN_DYNVARS_065_03------------------------#'
69
########################################################################
70
# Change the value of log_output to a valid value #
71
########################################################################
73
SET @@global.log_output = 'TABLE';
74
SELECT @@global.log_output;
76
SET @@global.log_output = 'FILE';
77
SELECT @@global.log_output;
79
SET @@global.log_output = 'NONE';
80
SELECT @@global.log_output;
82
SET @@global.log_output = 'FILE,TABLE';
83
SELECT @@global.log_output;
85
SET @@global.log_output = 'TABLE,FILE';
86
SELECT @@global.log_output;
88
SET @@global.log_output = 'NONE,TABLE';
89
SELECT @@global.log_output;
91
SET @@global.log_output = 'NONE,FILE';
92
SELECT @@global.log_output;
94
SET @@global.log_output = 'FILE,TABLE,NONE';
95
SELECT @@global.log_output;
97
SET @@global.log_output = 'TABLE,NONE';
98
SELECT @@global.log_output;
100
SET @@global.log_output = 'TABLE,TABLE';
101
SELECT @@global.log_output;
103
SET @@global.log_output = ',TABLE';
104
SELECT @@global.log_output;
106
SET @@global.log_output = ',';
107
SELECT @@global.log_output;
109
SET @@global.log_output = 'TABLE,,FILE,,,';
110
SELECT @@global.log_output;
113
--echo '#--------------------FN_DYNVARS_065_04-------------------------#'
114
###########################################################################
115
# Change the value of log_output to invalid value #
116
###########################################################################
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';
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';
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;
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.';
152
--echo '#-------------------FN_DYNVARS_065_05----------------------------#'
153
######################################################################
154
# Test if accessing session log_output gives error #
155
######################################################################
157
--Error ER_GLOBAL_VARIABLE
158
SET @@log_output = 0;
159
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
160
SELECT @@session.log_output;
163
--echo '#----------------------FN_DYNVARS_065_06------------------------#'
164
########################################################################
165
# Check if the value in GLOBAL Table matches value in variable #
166
########################################################################
168
SELECT @@log_output = VARIABLE_VALUE
169
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
170
WHERE VARIABLE_NAME='log_output';
173
--echo '#---------------------FN_DYNVARS_065_07-------------------------#'
174
###################################################################
175
# Check if numbers can be used on variable #
176
###################################################################
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;
183
--Error ER_WRONG_VALUE_FOR_VAR
184
SET @@global.log_output = 1;
185
SELECT @@global.log_output;
187
--Error ER_WRONG_VALUE_FOR_VAR
188
SET @@global.log_output = 2;
189
SELECT @@global.log_output;
191
--Error ER_WRONG_VALUE_FOR_VAR
192
SET @@global.log_output = 3;
193
SELECT @@global.log_output;
195
--Error ER_WRONG_VALUE_FOR_VAR
196
SET @@global.log_output = 4;
197
SELECT @@global.log_output;
199
--Error ER_WRONG_VALUE_FOR_VAR
200
SET @@global.log_output = 5;
201
SELECT @@global.log_output;
203
--Error ER_WRONG_VALUE_FOR_VAR
204
SET @@global.log_output = 6;
205
SELECT @@global.log_output;
207
--Error ER_WRONG_VALUE_FOR_VAR
208
SET @@global.log_output = 7;
209
SELECT @@global.log_output;
211
--Error ER_WRONG_VALUE_FOR_VAR
212
SET @@global.log_output = 8;
215
--echo '#---------------------FN_DYNVARS_065_08----------------------#'
216
###################################################################
217
# Check if TRUE and FALSE values can be used on variable #
218
###################################################################
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;
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
234
SET global log_output = 'TABLE';
235
SELECT @@global.log_output;
237
##############################
238
# Restore initial value #
239
##############################
241
SET @@global.log_output = @start_value;
242
SELECT @@global.log_output;
244
###################################################################
245
# END OF log_output TESTS #
246
###################################################################