Bug #46792 Hard coded 'mysql' table schema in error messages
Submitted: 18 Aug 2009 18:30 Modified: 4 Aug 2010 22:52
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:mysql-azalea OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[18 Aug 2009 18:30] Marc ALFF
Description:
In errmsg.txt:

ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
        eng "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted"

ER_CANNOT_LOAD_FROM_TABLE
        eng "Cannot load from mysql.%s. The table is probably corrupted"

The table schema is hard coded to mysql.

This is wrong, the table schema should be a %s argument in the error message,
so that the error message itself could be used for information_schema, performance_schema, etc.

Currently, table_check_intact() in table.cc get a fully qualified table schema
+ table name, but raise wrong messages like:
Column count of mysql.FILE_SUMMARY_BY_EVENT_NAME is wrong. Expected ...
instead of
Column count of perfschema.FILE_SUMMARY_BY_EVENT_NAME is wrong. Expected ...
because the table schema is hard coded to mysql in the error message.

How to repeat:
read errmsg.txt, read table.cc

Suggested fix:
%s in the message text
[18 Aug 2009 22:31] MySQL Verification Team
Thank you for the bug report.
[16 Apr 2010 14:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105891
[20 Apr 2010 9:08] Marc ALFF
Approved by Kevin by email
[20 Apr 2010 10:07] Marc ALFF
Pushed into:
- mysql-next-mr-bugfixing
- mysql-6.0-codebase-bugfixing
[27 Apr 2010 9:46] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100427094135-5s49ecp3ckson6e2) (version source revid:alik@sun.com-20100427093843-uekr85qkd7orx12t) (merge vers: 6.0.14-alpha) (pib:16)
[27 Apr 2010 9:51] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100427094036-38frbg3famdlvjup) (version source revid:alik@sun.com-20100427093825-92wc8b22d4yg34ju) (pib:16)
[12 May 2010 1:26] Paul DuBois
Noted in 6.0.14 changelog.

Some error messages included a literal mysql database name rather
than a parameter for the database name.
[4 Aug 2010 8:06] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100427095914-pzlxbqjjtnngxmf0) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:22] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100427095914-pzlxbqjjtnngxmf0) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 22:52] Paul DuBois
Noted in 5.6.0 changelog.