Bug #45059 mysqlcheck ignores commands from mysql_upgrade
Submitted: 25 May 2009 5:12 Modified: 25 May 2009 5:16
Reporter: Susanne Ebrecht Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.1, 5.4, 6.0 OS:Any
Assigned to: CPU Architecture:Any

[25 May 2009 5:12] Susanne Ebrecht
Description:
Test 1:

$ mysql_upgrade
...
Running 'mysqlcheck'...
All databases will be checked

Because mysql_upgarde is calling mysqlcheck --all-databases

Test 2:

$ mysql_upgrade --all-databases
...
Running 'mysqlcheck'...
All databases will be checked

Because mysql_upgarde is calling mysqlcheck --all-databases

Test 3 (here is the bug):

$ mysql_upgrade mysql
...
Running 'mysqlcheck'...
All databases will be checked

This is fatal. This will cost too much time. Consider, customer production is hit here.

When you want to do the upgrade step by step means database by database you don't want to wait days because mysqlcheck always checks all databases.

It is clear that the system databases like mysql or information_schema always need to be checked too but not the other user databases.

Also when I only want to check the database mysql then mysqlcheck only should check the database mysql and maybe other system databases but not my user database.

How to repeat:
Repeat method 1:

Use mysql 5.0:
create two or three databases.

stop server, remove 5.0, install 5.1:

start server 5.1 and run:

$ mysql_upgrade mysql

****

Repeat method 2:

This is the easier method:

look into the source code from mysql_upgrade and mysqlcheck.

You will see that they don't communicate with each other. That mysqlcheck is ignoring single database input.

Suggested fix:
Repair mysqlcheck and mysql_upgrade so that mysqlcheck only will check the databases that you give with mysql_upgrade if necessary additionally the system databases.