| 1 |
SET @old_log_output= @@global.log_output; |
| 2 |
SET @old_slow_query_log= @@global.slow_query_log; |
| 3 |
SET @old_long_query_time= @@session.long_query_time; |
| 4 |
SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements; |
| 5 |
USE test; |
| 6 |
CREATE TABLE log_slow_admin_statements ( |
| 7 |
i INT PRIMARY KEY AUTO_INCREMENT, |
| 8 |
j VARCHAR(255) |
| 9 |
) ENGINE=InnoDB; |
| 10 |
SET GLOBAL log_output = 'file,table'; |
| 11 |
SET GLOBAL slow_query_log = on; |
| 12 |
SET SESSION long_query_time = 0; |
| 13 |
SET SESSION log_slow_admin_statements = on; |
| 14 |
Warnings: |
| 15 |
Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead |
| 16 |
ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17; |
| 17 |
CREATE PROCEDURE add_rows() |
| 18 |
BEGIN |
| 19 |
DECLARE count INT; |
| 20 |
SET count = 1; |
| 21 |
INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255)); |
| 22 |
WHILE count <= 15 DO |
| 23 |
INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements; |
| 24 |
SET count = count + 1; |
| 25 |
END WHILE; |
| 26 |
END |
| 27 |
$ |
| 28 |
CALL add_rows(); |
| 29 |
OPTIMIZE TABLE log_slow_admin_statements; |
| 30 |
Table Op Msg_type Msg_text |
| 31 |
test.log_slow_admin_statements optimize note Table does not support optimize, doing recreate + analyze instead |
| 32 |
test.log_slow_admin_statements optimize status OK |
| 33 |
CHECK TABLE log_slow_admin_statements EXTENDED; |
| 34 |
Table Op Msg_type Msg_text |
| 35 |
test.log_slow_admin_statements check status OK |
| 36 |
DROP TABLE log_slow_admin_statements; |
| 37 |
SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%'; |
| 38 |
sql_text |
| 39 |
ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17 |
| 40 |
OPTIMIZE TABLE log_slow_admin_statements |
| 41 |
CHECK TABLE log_slow_admin_statements EXTENDED |
| 42 |
DROP TABLE log_slow_admin_statements |
| 43 |
SET @@global.log_output= @old_log_output; |
| 44 |
SET @@global.slow_query_log= @old_slow_query_log; |
| 45 |
SET @@session.long_query_time= @old_long_query_time; |
| 46 |
SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements; |
| 47 |
Warnings: |
| 48 |
Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead |
| 49 |
DROP PROCEDURE add_rows; |
| 50 |
TRUNCATE TABLE mysql.slow_log; |
| 51 |
SET @save_log_slow_disabled_statements= @@global.log_slow_disabled_statements; |
| 52 |
SET @@SESSION.log_slow_admin_statements= TRUE; |
| 53 |
Warnings: |
| 54 |
Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead |
| 55 |
select @@SESSION.log_slow_disabled_statements; |
| 56 |
@@SESSION.log_slow_disabled_statements |
| 57 |
sp |
| 58 |
SET @@SESSION.log_slow_admin_statements= FALSE; |
| 59 |
Warnings: |
| 60 |
Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead |
| 61 |
select @@SESSION.log_slow_disabled_statements; |
| 62 |
@@SESSION.log_slow_disabled_statements |
| 63 |
admin,sp |
| 64 |
SET @@GLOBAL.log_slow_admin_statements= TRUE; |
| 65 |
Warnings: |
| 66 |
Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead |
| 67 |
select @@GLOBAL.log_slow_disabled_statements; |
| 68 |
@@GLOBAL.log_slow_disabled_statements |
| 69 |
sp |
| 70 |
SET @@GLOBAL.log_slow_admin_statements= FALSE; |
| 71 |
Warnings: |
| 72 |
Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead |
| 73 |
select @@GLOBAL.log_slow_disabled_statements; |
| 74 |
@@GLOBAL.log_slow_disabled_statements |
| 75 |
admin,sp |
| 76 |
SET @@SESSION.log_slow_disabled_statements=""; |
| 77 |
select @@SESSION.log_slow_admin_statements; |
| 78 |
@@SESSION.log_slow_admin_statements |
| 79 |
1 |
| 80 |
SET @@SESSION.log_slow_disabled_statements="admin"; |
| 81 |
select @@SESSION.log_slow_admin_statements; |
| 82 |
@@SESSION.log_slow_admin_statements |
| 83 |
0 |
| 84 |
SET @@GLOBAL.log_slow_disabled_statements=""; |
| 85 |
select @@GLOBAL.log_slow_admin_statements; |
| 86 |
@@GLOBAL.log_slow_admin_statements |
| 87 |
1 |
| 88 |
SET @@GLOBAL.log_slow_disabled_statements="admin"; |
| 89 |
select @@GLOBAL.log_slow_admin_statements; |
| 90 |
@@GLOBAL.log_slow_admin_statements |
| 91 |
0 |
| 92 |
SET @@global.log_slow_disabled_statements= @save_log_slow_disabled_statements; |