mysqlcheck -A --auto-repair selects wrong database when trying to repair broken table

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
===

Environment

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

Status

Assignee

Oleksandr Byelkin

Reporter

Lucian Atody

Labels

External issue ID

None

External issue ID

None

Components

Fix versions

Affects versions

10.0
10.1
10.1.10
5.5

Priority

Major