Bug #77934 mysqlpump does not dump mysql.{general_log,slow_log} table definitions
Submitted: 4 Aug 2015 16:33 Modified: 25 Aug 2015 4:54
Reporter: Paul DuBois Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.8+ OS:Any
Assigned to: CPU Architecture:Any

[4 Aug 2015 16:33] Paul DuBois
Description:
mysqldump has this behavior:

mysqldump includes statements to recreate the general_log and slow_query_log tables for dumps of the mysql database. Log table contents are not dumped.

(http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html)

mysqlpump does not even dump the table definitions. It should.

How to repeat:
mysqlpump mysql > out

Look in output file, see that CREATE TABLE statements for general_log, slow_log are missing

Suggested fix:
Add CREATE TABLE statements for general_log, slow_log when dumping mysql database.
[5 Aug 2015 7:11] MySQL Verification Team
Hi Paul,

Thank you for the report.
Confirmed that CREATE TABLE statements for general_log, slow_log exists in dumps. Could you please confirm your build details and or any others details which would help us to reproduce this issue?

-- Build
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9: cat docs/INFO_SRC
commit: e340e9f665fe6ddcca50d4ce8fa9a28bd0dc91bc
date: 2015-08-03 16:27:03 +0100
build-date: 2015-08-03 18:02:34 +0200
short: e340e9f
branch: mysql-5.7

MySQL source 5.7.9
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9:  bin/mysqldump -uroot -S /tmp/mysql_ushastry.sock mysql > bug77934.sql
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9:
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9: grep -A 10 "general_log" bug77934.sql
-- Table structure for table `general_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `general_log` (
  `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumblob NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
/*!40101 SET character_set_client = @saved_cs_client */;

--
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9: grep -A 18 "slow_log" bug77934.sql
-- Table structure for table `slow_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `slow_log` (
  `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `query_time` time(6) NOT NULL,
  `lock_time` time(6) NOT NULL,
  `rows_sent` int(11) NOT NULL,
  `rows_examined` int(11) NOT NULL,
  `db` varchar(512) NOT NULL,
  `last_insert_id` int(11) NOT NULL,
  `insert_id` int(11) NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `sql_text` mediumblob NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

// 5.7.8 - Linux - Generic(mysql-5.7.8-rc-linux-glibc2.5-x86_64.tar.gz) from downloads.mysql.com

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc:  bin/mysqldump -uroot -S /tmp/mysql_ushastry.sock mysql > dump.sql                                                                  
[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc: grep -A 10 "general_log" dump.sql
-- Table structure for table `general_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `general_log` (
  `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumblob NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
/*!40101 SET character_set_client = @saved_cs_client */;

--
[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8-rc: grep -A 18 "slow_log" dump.sql
-- Table structure for table `slow_log`
--

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `slow_log` (
  `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `user_host` mediumtext NOT NULL,
  `query_time` time(6) NOT NULL,
  `lock_time` time(6) NOT NULL,
  `rows_sent` int(11) NOT NULL,
  `rows_examined` int(11) NOT NULL,
  `db` varchar(512) NOT NULL,
  `last_insert_id` int(11) NOT NULL,
  `insert_id` int(11) NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `sql_text` mediumblob NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

Thanks,
Umesh
[5 Aug 2015 17:42] MySQL Verification Team
Thank you Paul for correcting my mistake(I was using mysqldump instead of mysqlpump for the verification). Verified as described with 5.7.8 build.

Regards,
Umesh