1
set global general_log= OFF;
2
truncate table mysql.general_log;
3
truncate table mysql.slow_log;
5
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
6
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
13
set global general_log= ON;
14
create table t1(f1 int);
15
select * from mysql.general_log;
16
event_time user_host thread_id server_id command_type argument
17
TIMESTAMP USER_HOST # 1 Query create table t1(f1 int)
18
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
19
set global general_log= OFF;
21
select * from mysql.general_log;
22
event_time user_host thread_id server_id command_type argument
23
TIMESTAMP USER_HOST # 1 Query create table t1(f1 int)
24
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
25
TIMESTAMP USER_HOST # 1 Query set global general_log= OFF
26
set global general_log= ON;
29
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
30
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
36
set session long_query_time=1;
40
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
41
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
42
set global slow_query_log= ON;
43
set session long_query_time=1;
47
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
48
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)
51
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
52
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
58
set global general_log= ON;
59
set global general_log= OFF;
60
set global general_log= OFF;
61
set global slow_query_log= ON;
62
set global slow_query_log= OFF;
63
set global slow_query_log= OFF;
64
set global general_log= ON;
65
truncate table mysql.general_log;
66
create table t1(f1 int);
68
select * from mysql.general_log;
69
event_time user_host thread_id server_id command_type argument
70
TIMESTAMP USER_HOST # 1 Query create table t1(f1 int)
71
TIMESTAMP USER_HOST # 1 Query drop table t1
72
TIMESTAMP USER_HOST # 1 Query select * from mysql.general_log
73
set global general_log= OFF;
74
truncate table mysql.general_log;
75
select * from mysql.general_log;
76
event_time user_host thread_id server_id command_type argument
77
set global general_log= ON;
79
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
80
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
86
show variables like 'general_log_file';
89
show variables like 'slow_query_log_file';
92
show variables like 'log_output';
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'
97
set global general_log_file='MYSQLTEST_VARDIR';
98
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR'
99
set global general_log_file='';
100
ERROR 42000: Variable 'general_log_file' can't be set to the value of ''
101
show variables like 'general_log_file';
104
set global general_log= OFF;
105
set global general_log_file='MYSQLTEST_VARDIR/tmp/log.master';
106
set global general_log= ON;
107
create table t1(f1 int);
109
set global general_log= OFF;
110
set global general_log_file=default;
111
set global general_log= ON;
112
create table t1(f1 int);
114
show variables like 'general_log_file';
117
show variables like 'slow_query_log_file';
119
slow_query_log_file #
120
set global general_log= default;
121
set global slow_query_log= default;
122
set global general_log_file= default;
123
set global slow_query_log_file= default;
124
show variables like 'general_log';
127
show variables like 'slow_query_log';
130
set global general_log=ON;
131
set global log_output=default;
132
show variables like 'log_output';
135
set global general_log=OFF;
136
set global log_output=FILE;
137
truncate table mysql.general_log;
138
show variables like 'log_output';
141
set global general_log=ON;
142
create table t1(f1 int);
143
select * from mysql.general_log;
144
event_time user_host thread_id server_id command_type argument
145
set global general_log=OFF;
146
set global log_output="FILE,TABLE";
147
show variables like 'log_output';
149
log_output FILE,TABLE
150
set global general_log=ON;
152
select * from mysql.general_log;
153
event_time user_host thread_id server_id command_type argument
154
TIMESTAMP USER_HOST # 1 Query drop table t1
155
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;
180
SHOW VARIABLES LIKE 'general_log';
183
SHOW VARIABLES LIKE 'log';
186
SELECT @@general_log, @@log;
190
SHOW VARIABLES LIKE 'general_log';
193
SHOW VARIABLES LIKE 'log';
196
SELECT @@general_log, @@log;
199
SET GLOBAL general_log = 1;
200
SHOW VARIABLES LIKE 'general_log';
203
SHOW VARIABLES LIKE 'log';
206
SELECT @@general_log, @@log;
209
SHOW VARIABLES LIKE 'slow_query_log';
212
SHOW VARIABLES LIKE 'log_slow_queries';
215
SELECT @@slow_query_log, @@log_slow_queries;
216
@@slow_query_log @@log_slow_queries
218
SET GLOBAL log_slow_queries = 0;
219
SHOW VARIABLES LIKE 'slow_query_log';
222
SHOW VARIABLES LIKE 'log_slow_queries';
225
SELECT @@slow_query_log, @@log_slow_queries;
226
@@slow_query_log @@log_slow_queries
228
SET GLOBAL slow_query_log = 1;
229
SHOW VARIABLES LIKE 'slow_query_log';
232
SHOW VARIABLES LIKE 'log_slow_queries';
235
SELECT @@slow_query_log, @@log_slow_queries;
236
@@slow_query_log @@log_slow_queries
238
SET GLOBAL general_log = @old_general_log_state;
239
SET GLOBAL slow_query_log = @old_slow_log_state;
240
set @old_general_log_file= @@global.general_log_file;
241
set @old_slow_query_log_file= @@global.slow_query_log_file;
242
set global general_log_file= concat('/not exiting path/log.maste', 'r');
243
ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
244
set global general_log_file= NULL;
245
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL'
246
set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
247
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master'
248
set global slow_query_log_file= NULL;
249
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL'
250
set global general_log_file= @old_general_log_file;
251
set global slow_query_log_file= @old_slow_query_log_file;
254
# -- Bug#32748: Inconsistent handling of assignments to
255
# -- general_log_file/slow_query_log_file.
258
SET @general_log_file_saved = @@global.general_log_file;
259
SET @slow_query_log_file_saved = @@global.slow_query_log_file;
261
SET GLOBAL general_log_file = 'bug32748.query.log';
262
SET GLOBAL slow_query_log_file = 'bug32748.slow.log';
264
SHOW VARIABLES LIKE '%log_file';
266
general_log_file bug32748.query.log
267
slow_query_log_file bug32748.slow.log
269
SET GLOBAL general_log_file = @general_log_file_saved;
270
SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
272
# -- End of Bug#32748.