Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
RENAME TABLE is not an "admin" command from the point of view of slow log. Its alias "ALTER TABLE..RENAME" is. They should be both "admin" for consistency.
This script demonstrates that RENAME TABLE does not honor log_slow_filter='admin':
SET @@GLOBAL.slow_query_log=OFF; |
SET @@GLOBAL.log_output='TABLE'; |
TRUNCATE TABLE mysql.slow_log; |
FLUSH SLOW LOGS;
|
SET @@GLOBAL.slow_query_log=ON; |
|
SET @@GLOBAL.log_slow_admin_statements=ON; |
SET log_slow_filter='admin'; |
SET long_query_time=0.000001; |
|
DROP TABLE IF EXISTS t1,t2,t3; |
CREATE TABLE t1 (a INT); |
ALTER TABLE t1 RENAME t2; |
RENAME TABLE t2 TO t3; |
DROP TABLE t3; |
|
SELECT sql_text FROM mysql.slow_log; |
+--------------------------+
|
| sql_text |
|
+--------------------------+
|
| ALTER TABLE t1 RENAME t2 |
|
+--------------------------+
|
Attachments
Issue Links
- relates to
-
MDEV-18333 Slow_queries count doesn't increase when slow_query_log is turned off
- Closed