Bug #69953 can't drop mysql.slow_log if slow_log=on even with log_output=FILE
Submitted: 7 Aug 2013 14:46 Modified: 9 Aug 2013 13:36
Reporter: Hartmut Holzgraefe Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:mysql-5.5.27, 5.5.33 OS:Any
Assigned to: CPU Architecture:Any

[7 Aug 2013 14:46] Hartmut Holzgraefe
Description:
Can't drop mysql.slow_log if slow_log=on even with log_output=FILE or NONE

I can understand preventing dropping of a log table that is in active use,
but with log_output!=TABLE it should be dropable the same way as it is when logging is not active at all

How to repeat:
SET GLOBAL log_output='FILE';
SET GLOBAL slow_query_log=1;
SET GLOBAL slow_query_log_file='/tmp/slow.log';

DROP TABLE mysql.slow_log;
=> ERROR 1580 (HY000): You cannot 'DROP' a log table if logging is enabled

SET GLOBAL log_output='NONE';

DROP TABLE mysql.slow_log;
=> ERROR 1580 (HY000): You cannot 'DROP' a log table if logging is enabled

SET GLOBAL slow_query_log=0;

DROP TABLE mysql.slow_log;
=> success

Suggested fix:
only prevent drop of "magic" log tables if logging is enabled *and* configured to log to the table
[8 Aug 2013 10:11] MySQL Verification Team
Hello Hartmut,

Thank you for the bug report and the test case. 
Verified as described on MySQL Version 5.5.33.

Thanks,
Umesh
[8 Aug 2013 11:03] Hartmut Holzgraefe
5.6.13 is also affected, 5.7.1 not any more though ... but i can't find anything in the 5.7.0 or 5.7.1 change logs about this ...?
[9 Aug 2013 13:36] Jon Olav Hauglid
This was fixed by the patch for Bug#56155 'You cannot 'ALTER' a log table if logging is enabled' even if I log to files