Bug #102292 ANALYZE TABLE capitalized table name, statistics results are not updated.
Submitted: 19 Jan 9:54 Modified: 20 Jan 10:14
Reporter: qichao zhou Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.22, 8.0.23 OS:Any (CentOS Linux release 8.0.1905 (Core))
Assigned to: CPU Architecture:Any (4.18.0-80.el8.x86_64 )

[19 Jan 9:54] qichao zhou
Description:
 When setting lower_case_table_names to 1, ANALYZE TABLE capitalized table name, statistics return normal, but statistics results are not updated. ANALYZE TABLE lowercase table names to work properly. See the following example.

How to repeat:
mysql> select count(*) from test2;
+----------+
| count(*) |
+----------+
|      162 |
+----------+
1 row in set (0.01 sec)

mysql> select TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS from information_schema.tables where TABLE_SCHEMA ='zhouqch' and TABLE_NAME='test2';
+--------------+------------+------------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ROWS |
+--------------+------------+------------+
| zhouqch      | test2      |         62 |
+--------------+------------+------------+
1 row in set (0.00 sec)

mysql> analyze table TEST2;
+---------------+---------+----------+----------+
| Table         | Op      | Msg_type | Msg_text |
+---------------+---------+----------+----------+
| zhouqch.test2 | analyze | status   | OK       |
+---------------+---------+----------+----------+
1 row in set (0.01 sec)

mysql> select TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS from information_schema.tables where TABLE_SCHEMA ='zhouqch' and TABLE_NAME='test2';
+--------------+------------+------------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ROWS |
+--------------+------------+------------+
| zhouqch      | test2      |         62 |
+--------------+------------+------------+
1 row in set (0.01 sec)

mysql> analyze table test2;
+---------------+---------+----------+----------+
| Table         | Op      | Msg_type | Msg_text |
+---------------+---------+----------+----------+
| zhouqch.test2 | analyze | status   | OK       |
+---------------+---------+----------+----------+
1 row in set (0.01 sec)

mysql> select TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS from information_schema.tables where TABLE_SCHEMA ='zhouqch' and TABLE_NAME='test2';
+--------------+------------+------------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ROWS |
+--------------+------------+------------+
| zhouqch      | test2      |        162 |
+--------------+------------+------------+
1 row in set (0.00 sec)

mysql>

Suggested fix:
Optimize the performance of statistics in case lower_case_table_names is 1, ANALYZE TABLE uppercase table name update statistics.
[20 Jan 10:14] MySQL Verification Team
Hello qichao zhou,

Thank you for the report.

regards,
Umesh
[3 Mar 8:04] MySQL Verification Team
Bug #102792 marked as duplicate of this one