Bug #76929 mysqlcheck fails with table names containing dot (.)
Submitted: 4 May 2015 12:48 Modified: 8 May 2015 12:38
Reporter: Dirk LANGE Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.6 OS:Solaris
Assigned to: MySQL Verification Team CPU Architecture:Any

[4 May 2015 12:48] Dirk LANGE
Description:
As MySQL does not prohibit dot (.) in table names, within a mysql client the handling is guaranteed by wrapping table names in backticks.
When using command line tool mysqlcheck, the dot is not escaped and leads to an error.
Indirectly, mysql_upgrade is affected, too.

There have been previous bug reports, though the error still exists:
#68015: closed, not solved for 5.6 (ref. #72161)
#72382: verified, pending for 1 year?
#71331: marked as duplicate

my sandbox:

* Solaris 11 on x64_64
* binaries: 5.6.23 (mysql-5.6.23-solaris11-x86_64)

How to repeat:
mysql> CREATE TABLE `.dot_begin` (FLT float) ENGINE=MyISAM;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `dot.within` (FLT float) ENGINE=MyISAM;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `dot_end.` (FLT float) ENGINE=MyISAM;
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| .dot_begin     |
| dot.within     |
| dot_end.       |
+----------------+
3 rows in set (0.01 sec)

mysql> check table `.dot_begin`, `dot.within`, `dot_end.`;
+-----------------+-------+----------+----------+
| Table           | Op    | Msg_type | Msg_text |
+-----------------+-------+----------+----------+
| test..dot_begin | check | status   | OK       |
| test.dot.within | check | status   | OK       |
| test.dot_end.   | check | status   | OK       |
+-----------------+-------+----------+----------+
3 rows in set (0.02 sec)

Whereas on the command line:

bash$> mysqlcheck -h <host> -P <port> -u <user> -p <schema> dot.within
Enter password:
dot.within
Error    : Table 'dot.within' doesn't exist
status   : Operation failed

bash$> mysqlcheck -h <host> -P <port> -u <user> -p <schema> .dot_begin
Enter password:
mysqlcheck: Got error: 1102: Incorrect database name '' when executing 'CHECK TABLE ... '

bash$> mysqlcheck -h <host> -P <port> -u <user> -p <schema> dot_end.
mysqlcheck: Got error: 1103: Incorrect table name '' when executing 'CHECK TABLE ... '

Excursion:
for a user with no global SELECT priv, the dot.within-test reflects only a fraction of the name in the error message, though different:

bash$> mysqlcheck -h <host> -P <port> -u <user> -p <schema> dot.within
Enter password:
mysqlcheck: Got error: 1142: SELECT command denied to user '<user>'@'<host>' for table 'within' when executing 'CHECK TABLE ... '
[6 May 2015 7:31] MySQL Verification Team
[arhimed@gedora msb_5_1_73]$ ./my sqlcheck -A
...
/home/arhimed/MYSQL/5.1.73/bin/mysqlcheck: Got error: 1102: Incorrect database name '' when executing 'CHECK TABLE ... '
[arhimed@gedora msb_5_1_73]$ cd ../msb_5_5_43/
[arhimed@gedora msb_5_5_43]$ ./my sqlcheck -A
...
/home/arhimed/MYSQL/5.5.43/bin/mysqlcheck: Got error: 1102: Incorrect database name '' when executing 'CHECK TABLE ... '
[arhimed@gedora msb_5_5_43]$ cd ../msb_5_6_24/
[arhimed@gedora msb_5_6_24]$ ./my sqlcheck -A
...
/home/arhimed/MYSQL/5.6.24/bin/mysqlcheck: Got error: 1102: Incorrect database name '' when executing 'CHECK TABLE ... '
[arhimed@gedora msb_5_6_24]$ cd ../msb_5_7_7/
[arhimed@gedora msb_5_7_7]$ ./my sqlcheck -A
...
test..dot_begin                                    OK
test.dot.within                                    OK
test.dot_end.                                      OK
[arhimed@gedora msb_5_7_7]$
[6 May 2015 7:35] MySQL Verification Team
Hi Dirk,

This bug is a duplicate of fixed Bug #68015

The bug is fixed only in 5.7.
[8 May 2015 12:38] Dirk LANGE
Is there the intention to fix this bug in 5.6, too?
[11 May 2015 13:55] MySQL Verification Team
No plans to fix pre 5.7 at the moment.