Bug #54830 mysql_upgrade moves all databases into database with period in name
Submitted: 26 Jun 2010 21:36 Modified: 10 May 2011 17:01
Reporter: Sean Jenkins Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.1.47 OS:Linux
Assigned to: CPU Architecture:Any
Tags: mysql_upgrade, period

[26 Jun 2010 21:36] Sean Jenkins
Description:
Any database created with a period in its name gets rewritten to the filesystem as mydb@002eextension, with @002e representing the period.  In some cases, when performing mysql_upgrade, the process will choke on the database with the period in it and move the entirety of, in my case /var/lib/mysql/* to /var/lib/mysql/mydb@002eextension, where mydb@002eextension is the name of the database with the period in it.

How to repeat:
Out of 800 servers that I performed a mysql_upgrade on and only 20 of them having databases with periods in their names, I was only able to reproduce this 3 times.  However, this is essentially what "might" trigger the problem:

mysqladmin create 'test.test'
mysql_upgrade (or with --force if it's already been performed before)

mysql_upgrade may hang on test.test (test@002etest) and then fail.  Investigating /var/lib/mysql will show only test@002etest and inside that will be the entirety of what was in /var/lib/mysql

Suggested fix:
Ensure mysql_upgrade properly escapes special characters and most prominently, doesn't move the contents of /var/lib/mysql into a sub-folder just because it didn't recognize how to handle @002e
[26 Jun 2010 21:41] Sean Jenkins
Of the 3 this did occur on, attempting to recreate the problem to re-trigger the bug again didn't result in the contents getting moved around.
[28 Jun 2010 7:01] Sveta Smirnova
Thank you for the report.

This looks very similar to private bug #53804 which was fixed in version 5.1.48. Please upgrade to version 5.1.48 and inform us if your problem still exists.
[28 Jul 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".