Bug #99275 "SHOW TABLES" does not show a table if .frm is a hidden file on Windows
Submitted: 16 Apr 2020 6:38 Modified: 20 Apr 2020 14:44
Reporter: YASUHARU SAKAI Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6/5.7 OS:Windows
Assigned to: CPU Architecture:Any

[16 Apr 2020 6:38] YASUHARU SAKAI
The document of "SHOW TABLES Statement" describes as:

> If you have no privileges for a base table or view, it does not show up in the output from SHOW TABLES or mysqlshow db_name.

But actually, "SHOW TABLES" does not show a table on which I have enough privilege if the .frm file is a hidden file on Windows.

How to repeat:
mysql> create database d1;
Query OK, 1 row affected (0.02 sec)

mysql> create table d1.t1 (num int);
Query OK, 0 rows affected (0.01 sec)

### set hidden attribute
c:\Program Files\mysql > attrib +H data\d1\t1.frm

### cannot show tables
mysql> show tables from d1;
Empty set (0.00 sec)

### confirm to have privilege
mysql> select * from d1.t1;
Empty set (0.00 sec)

c:\Program Files\mysql > attrib -H data\d1\t1.frm

mysql> show tables from d1;
| Tables_in_d1 |
| t1           |
1 row in set (0.00 sec)
[16 Apr 2020 12:25] MySQL Verification Team
Thank you for the bug report.
[20 Apr 2020 14:44] Daniel Price
Posted by developer:
The following information was added to the CREATE DATABASE documentation:

"When you create a database, let the server manage the directory
and the files in it. Manipulating database directories and files
directly can cause inconsistencies and unexpected results."

The change should appear online soon.

Thank you for the bug report.