Bug #65670 mysqldump 5.5.25 client fails to dump mysql db from remote 5.0.96 server
Submitted: 19 Jun 2012 11:42 Modified: 5 Jun 2013 17:28
Reporter: Van Stokes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:5.5.25, 5.5.26 OS:Linux (Ubuntu 11.10 x86_64)
Assigned to: CPU Architecture:Any
Tags: mysqldump, regression

[19 Jun 2012 11:42] Van Stokes
Description:
Linux server having the 5.5.25 client utilities installed is used to dump remote mysql servers. A 5.0.96 mysql server (RHEL dist) is still deployed. When dumping from server we get this error:

Error: Couldn't read status information for table general_log ()
mysqldump: Couldn't execute 'show create table `general_log`': Table 'mysql.general_log' doesn't exist (1146)

This problem was not present in the 5.5.24 client utilities.

How to repeat:
1. Install a 5.0.96 RHEL mysql server dist one one server.
2. Install a 5.5.25 mysql client dist on a separate server.
3. Dump the mysql database from the 5.0.96 server.

Suggested fix:
Go back to 5.5.24 logic?
[19 Jun 2012 12:12] Valeriy Kravchuk
Thank you for the bug report. Same problem with 5.5.26 on Mac OS X:

macbook-pro:5.5 openxs$ bin/mysqldump -uroot mysql
-- MySQL dump 10.13  Distrib 5.5.26, for osx10.5 (i386)
--
-- Host: localhost    Database: mysql
-- ------------------------------------------------------
-- Server version	5.0.97-debug

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Not dumping tablespaces as no INFORMATION_SCHEMA.FILES table on this server
--
Error: Couldn't read status information for table general_log ()
mysqldump: Couldn't execute 'show create table `general_log`': Table 'mysql.general_log' doesn't exist (1146)
[19 Oct 2012 2:45] Quan Tong Anh
Same problem with mysqldump from Percona-XtraDB-Cluster-client-5.5.27-23.6.356.rhel5. The remote server is running mysql-server-5.0.95-1.el5_7.1.

Here're the snippet of the output from Zmanda:

tracker:backup:INFO: Command used for logical backup is "/usr/bin"/mysqldump --opt --extended-insert --create-options --default-character-set=latin1 --routines --master-data=2 --lock-all-tables --triggers --events --user="backup" --password="*****" --host="192.168.5.211" --all-databases  > "/var/lib/mysql-zrm/tracker/20121019092826/backup.sql"
Error: Couldn't read status information for table general_log ()
mysqldump: Couldn't execute 'show create table `general_log`': Table 'mysql.general_log' doesn't exist (1146)
tracker:backup:ERROR: mysqldump did not succeed.
[17 Nov 2012 21:34] [ name withheld ]
I'm seeing this with mysqldump from 5.1.66 as well.  I believe the problem was introduced by the fix for bug #45740: http://bazaar.launchpad.net/~mysql/mysql-server/5.1/revision/3731 introduces a hunk into  dump_all_tables_in_db() that naively assumes that general_log and slow_log exist.  I think this is probably broken even without considering the incompatibility against 5.0: isn't it supposed to be allowed for these tables not to exist?
[28 Nov 2012 17:00] Honza Horak
Proposed patch which adds checking if tables `general_log` and `slow_log` exist before reading their structure.

Attachment: mysql-logs.patch (text/x-patch), 3.08 KiB.

[21 Jan 2013 13:18] Gary Wilson
As workaround on the 5.0 servers create the tables as they are on 5.1:

"
--
-- Table structure for table general_log
--

CREATE TABLE IF NOT EXISTS general_log (
  event_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  user_host mediumtext NOT NULL,
  thread_id int(11) NOT NULL,
  server_id int(10) unsigned NOT NULL,
  command_type varchar(64) NOT NULL,
  argument mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';

--
-- Table structure for table slow_log
--

CREATE TABLE IF NOT EXISTS slow_log (
  start_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  user_host mediumtext NOT NULL,
  query_time time NOT NULL,
  lock_time time 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 mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';"
[5 Jun 2013 17:28] Paul DuBois
Noted in 5.5.33, 5.6.13, 5.7.2 changelogs.

mysqldump assumed the existence of the general_log and slow_log 
tables in the mysql database. It failed if invoked to dump tables
from an older server where these tables do not exist.
[4 Feb 2014 22:39] Justin Beck
This also effects Ubuntu 10.04 and mysql-client, will this be back ported?

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"

ii  libdbd-mysql-perl               4.012-1ubuntu1                    A Perl5 database interface to the MySQL data
ii  libmysqlclient16                5.1.73-0ubuntu0.10.04.1           MySQL database client library
ii  mysql-client                    5.1.73-0ubuntu0.10.04.1           MySQL database client (metapackage depending
ii  mysql-client-5.1                5.1.73-0ubuntu0.10.04.1           MySQL database client binaries
ii  mysql-client-core-5.1           5.1.73-0ubuntu0.10.04.1           MySQL database core client binaries
ii  mysql-common                    5.1.73-0ubuntu0.10.04.1           MySQL database common files (e.g. /etc/mysql
[6 Feb 2014 15:15] Morgan Tocker
MySQL 5.1 entered sustaining support on December 31st. See:
http://www.mysql.com/support/eol-notice.html

A backported patch will not be available.