1
SET @old_general_log= @@global.general_log;
2
SET @old_general_log_file= @@global.general_log_file;
3
SET @old_slow_query_log= @@global.slow_query_log;
4
SET @old_slow_query_log_file= @@global.slow_query_log_file;
1
5
set global general_log= OFF;
2
6
truncate table mysql.general_log;
3
7
truncate table mysql.slow_log;
34
38
log_slow_queries OFF
36
set session long_query_time=1;
40
# Establish connection con1 (user=root)
41
# Switch to connection con1
42
set @long_query_time = <long_query_time>;
43
set session long_query_time = @long_query_time;
44
select sleep(@long_query_time + 1);
45
sleep(@long_query_time + 1)
40
47
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
41
48
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
49
# Switch to connection default
42
50
set global slow_query_log= ON;
43
set session long_query_time=1;
51
# Switch to connection con1
52
set session long_query_time = @long_query_time;
53
select sleep(@long_query_time + 1);
54
sleep(@long_query_time + 1)
47
56
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
48
57
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
49
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
58
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(@long_query_time + 1)
59
# Switch to connection default
50
60
show global variables
51
61
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
52
62
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
92
102
show variables like 'log_output';
93
103
Variable_name Value
94
104
log_output FILE,TABLE
95
set global general_log_file='/not exiting path/log.master';
96
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
105
set global general_log_file='/not existing path/log.master';
106
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
97
107
set global general_log_file='MYSQLTEST_VARDIR';
98
108
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR'
99
109
set global general_log_file='';
153
163
event_time user_host thread_id server_id command_type argument
154
164
TIMESTAMP USER_HOST # 1 Query drop table t1
155
165
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
156
SET @old_general_log_state = @@global.general_log;
157
SET @old_slow_log_state = @@global.slow_query_log;
158
SET GLOBAL general_log = ON;
159
SET GLOBAL slow_query_log = ON;
160
FLUSH TABLES WITH READ LOCK;
161
SET GLOBAL general_log = OFF;
162
SET GLOBAL slow_query_log = OFF;
164
FLUSH TABLES WITH READ LOCK;
165
SET GLOBAL general_log = ON;
166
SET GLOBAL slow_query_log = ON;
168
SET GLOBAL READ_ONLY = ON;
169
SET GLOBAL general_log = OFF;
170
SET GLOBAL slow_query_log = OFF;
171
SET GLOBAL READ_ONLY = OFF;
172
SET GLOBAL READ_ONLY = ON;
173
SET GLOBAL general_log = ON;
174
SET GLOBAL slow_query_log = ON;
175
SET GLOBAL READ_ONLY = OFF;
176
SET GLOBAL general_log = @old_general_log_state;
177
SET GLOBAL slow_query_log = @old_slow_log_state;
178
SET @old_general_log_state = @@global.general_log;
179
SET @old_slow_log_state = @@global.slow_query_log;
166
SET @@global.general_log = @old_general_log;
167
SET @@global.general_log_file = @old_general_log_file;
168
SET @@global.slow_query_log = @old_slow_query_log;
169
SET @@global.slow_query_log_file = @old_slow_query_log_file;
170
SET GLOBAL general_log = ON;
171
SET GLOBAL slow_query_log = ON;
172
FLUSH TABLES WITH READ LOCK;
173
SET GLOBAL general_log = OFF;
174
SET GLOBAL slow_query_log = OFF;
176
FLUSH TABLES WITH READ LOCK;
177
SET GLOBAL general_log = ON;
178
SET GLOBAL slow_query_log = ON;
180
SET GLOBAL READ_ONLY = ON;
181
SET GLOBAL general_log = OFF;
182
SET GLOBAL slow_query_log = OFF;
183
SET GLOBAL READ_ONLY = OFF;
184
SET GLOBAL READ_ONLY = ON;
185
SET GLOBAL general_log = ON;
186
SET GLOBAL slow_query_log = ON;
187
SET GLOBAL READ_ONLY = OFF;
188
SET GLOBAL general_log = @old_general_log;
189
SET GLOBAL slow_query_log = @old_slow_query_log;
190
SET GLOBAL general_log = ON;
180
191
SHOW VARIABLES LIKE 'general_log';
181
192
Variable_name Value
239
250
SELECT @@slow_query_log, @@log_slow_queries;
240
251
@@slow_query_log @@log_slow_queries
242
SET GLOBAL general_log = @old_general_log_state;
243
SET GLOBAL slow_query_log = @old_slow_log_state;
244
set @old_general_log_file= @@global.general_log_file;
245
set @old_slow_query_log_file= @@global.slow_query_log_file;
246
set global general_log_file= concat('/not exiting path/log.maste', 'r');
247
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
248
set global general_log_file= NULL;
253
SET GLOBAL general_log = @old_general_log;
254
SET GLOBAL slow_query_log = @old_slow_query_log;
255
SET GLOBAL general_log_file= CONCAT('/not existing path/log.maste', 'r');
256
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
257
SET GLOBAL general_log_file= NULL;
249
258
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL'
250
set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
251
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master'
252
set global slow_query_log_file= NULL;
259
SET GLOBAL slow_query_log_file= CONCAT('/not existing path/log.maste', 'r');
260
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not existing path/log.master'
261
SET GLOBAL slow_query_log_file= NULL;
253
262
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL'
254
set global general_log_file= @old_general_log_file;
255
set global slow_query_log_file= @old_slow_query_log_file;
263
SET GLOBAL general_log_file= @old_general_log_file;
264
SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
258
267
# -- Bug#32748: Inconsistent handling of assignments to
259
# -- general_log_file/slow_query_log_file.
268
# -- general_log_file/slow_query_log_file.
262
SET @general_log_file_saved = @@global.general_log_file;
263
SET @slow_query_log_file_saved = @@global.slow_query_log_file;
265
271
SET GLOBAL general_log_file = 'bug32748.query.log';
266
272
SET GLOBAL slow_query_log_file = 'bug32748.slow.log';
298
304
SET GLOBAL slow_query_log_file = @my_sqlf;
299
305
SET GLOBAL general_log = DEFAULT;
300
306
SET GLOBAL slow_query_log = DEFAULT;
307
SET @@global.general_log = @old_general_log;
308
SET @@global.general_log_file = @old_general_log_file;
309
SET @@global.slow_query_log = @old_slow_query_log;
310
SET @@global.slow_query_log_file = @old_slow_query_log_file;
312
# Close connection con1
313
SET global general_log = @old_general_log;
314
SET global general_log_file = @old_general_log_file;
315
SET global slow_query_log = @old_slow_query_log;
316
SET global slow_query_log_file = @old_slow_query_log_file;