SET GLOBAL log_output='TABLE';
SET GLOBAL slow_query_log=0;
SET GLOBAL general_log=0;
TRUNCATE TABLE mysql.slow_log;
TRUNCATE TABLE mysql.general_log;
SET GLOBAL long_query_time=0;
SET GLOBAL log_slow_rate_type = 'query';
SET GLOBAL slow_query_log=1;
SET GLOBAL general_log=1;
SET GLOBAL log_slow_admin_statements = 1;
SELECT SLEEP(120);
SET GLOBAL slow_query_log=0;
SET GLOBAL general_log=0;
SELECT (
SELECT COUNT(*) FROM slow_log WHERE lcase(sql_text) LIKE '%update%'
) slow,
(
SELECT COUNT(*) FROM general_log WHERE lcase(argument) LIKE '%update%'
) general;
mysql> SELECT (
-> SELECT COUNT(*) FROM slow_log WHERE lcase(sql_text) LIKE '%update%'
-> ) slow,
-> (
-> SELECT COUNT(*) FROM general_log WHERE lcase(argument) LIKE '%update%'
-> ) general;
+------+---------+
| slow | general |
+------+---------+
| 645 | 923 |
+------+---------+
1 row in set (0.88 sec)
SET GLOBAL log_output='TABLE'; admin_statement s = 1;
SET GLOBAL slow_query_log=0;
SET GLOBAL general_log=0;
TRUNCATE TABLE mysql.slow_log;
TRUNCATE TABLE mysql.general_log;
SET GLOBAL long_query_time=0;
SET GLOBAL log_slow_rate_type = 'query';
SET GLOBAL slow_query_log=1;
SET GLOBAL general_log=1;
SET GLOBAL log_slow_
SELECT SLEEP(120);
SET GLOBAL slow_query_log=0;
SET GLOBAL general_log=0;
SELECT (
SELECT COUNT(*) FROM slow_log WHERE lcase(sql_text) LIKE '%update%'
) slow,
(
SELECT COUNT(*) FROM general_log WHERE lcase(argument) LIKE '%update%'
) general;
mysql> SELECT (
-> SELECT COUNT(*) FROM slow_log WHERE lcase(sql_text) LIKE '%update%'
-> ) slow,
-> (
-> SELECT COUNT(*) FROM general_log WHERE lcase(argument) LIKE '%update%'
-> ) general;
+------+---------+
| slow | general |
+------+---------+
| 645 | 923 |
+------+---------+
1 row in set (0.88 sec)