Bug #45740 mysqldump doesn't dump general_log and slow_query causes restore problem
Submitted: 25 Jun 12:13 Modified: 25 Jun 22:55
Reporter: Roger Nay
Status: Verified
Category:Client Severity:S3 (Non-critical)
Version:5.1.31, 5.1 bzr OS:Linux
Assigned to: Jim Winstead Target Version:5.1+
Triage: Triaged: D3 (Medium)

[25 Jun 12:13] Roger Nay
Description:
A fix for http://bugs.mysql.com/bug.php?id=26121 has an unwanted side-effect. Turning off
mysqldump for the general_log has created a problem when dumping and restoring. 

After restoring the tables don't exist and if you have turned on logging to TABLES in the
mean time it starts creating errors in the log file.

Requires turning on logging "after the mysqldump" in the configuration files and dropping
the mysql database (probably doesn't happen that often).

How to repeat:
* install version 5.1
* mysqldump --all-databases

look at the dump file the general_log, slow_log tables (create statements) are not dumped

* turn on logging to tables in my.cnf
* restart server
* drop mysql database
* import the previous dump
* errors in log because the tables don't exist

090625 11:31:38 [ERROR] Failed to write to mysql.general_log: Table 'mysql.general_log'
doesn't exist
090625 11:31:38 [ERROR] Failed to write to mysql.general_log: Table 'mysql.general_log'
doesn't exist
090625 11:31:38 [ERROR] Failed to write to mysql.general_log: Table 'mysql.general_log'
doesn't exist
090625 11:31:40 [ERROR] Failed to write to mysql.general_log: Table 'mysql.general_log'
doesn't exist

Suggested fix:
Would be nice if the CREATE TABLE statements for the general_log and slow_log tables in
there even if the data is not dumped, possibly IF NOT EXISTS so you don't lose any data in
the tables (seeing as they are not dumped).

*** Put some information in the manual about what ever changes are made (even if nothing
is changed), there is nothing about these tables not being dumped on the mysqldump or
general/slow log manual pages.
[25 Jun 22:55] Sveta Smirnova
Thank you for the report.

Verified as described.