[MDEV-9440] mysqlcheck -A --auto-repair selects wrong database when trying to repair broken table Created: 2016-01-20  Updated: 2016-08-08  Resolved: 2016-08-08

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.1.10, 5.5, 10.0, 10.1
Fix Version/s: 5.5.51, 10.1.17, 10.0.27

Type: Bug Priority: Critical
Reporter: Lucian Atody Assignee: Sergei Golubchik
Resolution: Fixed Votes: 3
Labels: regression
Environment:

Debian 8
$ mysqlcheck -V
mysqlcheck Ver 2.7.4-MariaDB Distrib 10.1.10-MariaDB, for debian-linux-gnu (x86_64)


Issue Links:
Relates
relates to MDEV-10005 mysqlcheck doesn't correctly set defa... Closed
relates to MDEV-10348 mysql_upgrade mixing up table list Closed

 Description   

Given 2 databases each with a table called "table":
db1.tableA
db2.tableB

Break table db1.tableA and run `mysqlcheck -A --auto-repair --fast`. mysqlcheck will scan all tables and then should try to repair db1.tableA but instead it remains connected to the last database it checked (in this case db2) and tries to repair table db2.tableA - which does not exist.
===
Repairing tables
db2.tableA
Error : Table 'db2.tableA' doesn't exist
status : Operation failed
===



 Comments   
Comment by Elena Stepanova [ 2016-01-20 ]

Thanks for the report.

The problem appeared in 5.5 tree with the following revision:

Author: unknown <sanja@askmonty.org>
Date:   Wed Jan 28 11:49:55 2015 +0100
 
    MDEV-6128:[PATCH] mysqlcheck wrongly escapes '.' in table names
    
    Backport from mysql 5.7. The patch reviewed, test added.

Not reproducible on current MySQL 5.5, 5.6, 5.7.

Comment by Elena Stepanova [ 2016-07-08 ]

See also MDEV-10005 and MDEV-10348. I'm raising the priority because a) it's a regression; b) it affects upgrade which means negative first impression; c) users keep raising it.

When fixed, please check the linked issues to make sure all scenarios are covered by the fix.

Generated at Thu Feb 08 07:34:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.