Bug #37998 Lock doesn't allow to copy data from general_log to another table
Submitted: 9 Jul 2008 17:38 Modified: 9 Jul 2008 17:44
Reporter: Markus Popp Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Locking Severity:S3 (Non-critical)
Version:5.1.25 OS:Any
Assigned to: CPU Architecture:Any

[9 Jul 2008 17:38] Markus Popp
Description:
Even though logging is disabled, I am not allowed to run INSERT INTO  ... SELECT FROM general_log due to a lock. The general_log table in my example is a MyISAM.

How to repeat:
mysql> SET @@global.log := 0;
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT @@log;
+-------+
| @@log |
+-------+
|     0 |
+-------+
1 row in set (0.00 sec)

mysql> CREATE TABLE general_log_archive LIKE general_log;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO general_log_archive SELECT * FROM general_log;
ERROR 1556 (HY000): You can't use locks with log tables.

Suggested fix:
Running "INSERT INTO  ... SELECT FROM general_log" should be possible, at least when logging is disabled.
[9 Jul 2008 17:44] Sveta Smirnova
Thank you for the report.

There is bug #34306 about very same problem with slow log, so I close this as duplicate of that one.