Bug #112099 The query result is incorrect.
Submitted: 17 Aug 2023 11:36 Modified: 17 Aug 2023 13:44
Reporter: ziyao lian Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:8.0.25 OS:Linux
Assigned to: CPU Architecture:x86

[17 Aug 2023 11:36] ziyao lian
Description:
The data in the records column is incorrect. The actual data in 200 rows is 0.

How to repeat:
1. Create an instance.

2. Create 20,000 common tables and 1000 partition tables.

3. Query the top 50 diagnostic disks,

4. Insert data to the queried table.

5. Query the data of the top 50 diagnostic disks again.

SELECT n.table_schema, n.table_name, n.table_rows AS records, (n.data_length + n.index_length + n.data_free)/(1024 * 1024) AS file_Mbytes, n.data_length /(1024 * 1024) AS data_Mbytes, n.index_length /(1024 * 1024) AS index_Mbytes, n.data_free /(1024 * 1024) AS free_Mbytes FROM information_schema.tables n WHERE n.engine = "InnoDB" ORDER BY file_Mbytes DESC LIMIT 50;
[17 Aug 2023 13:44] MySQL Verification Team
Hi Mr. lian,

Thank you for your bug report.

However, we are not able to repeat it with 8.0.34.

We have created 1000 normal tables, 1000 partitioned tables, inserted data and ran your query. This is what we have got as a result:

-------------------------------------------------
TABLE_SCHEMA	TABLE_NAME	records	file_Mbytes	data_Mbytes	index_Mbytes	free_Mbytes
mysql	help_topic	601	6768.0000	1552.0000	96.0000	5120.0000
mysql	help_keyword	878	5392.0000	128.0000	144.0000	5120.0000
mysql	global_grants	159	5216.0000	96.0000	0.0000	5120.0000
mysql	help_relation	1945	5216.0000	96.0000	0.0000	5120.0000
mysql	tables_priv	2	5152.0000	16.0000	16.0000	5120.0000
mysql	replication_group_member_actions	2	5152.0000	16.0000	16.0000	5120.0000
mysql	db	2	5152.0000	16.0000	16.0000	5120.0000
mysql	replication_asynchronous_connection_failover	0	5152.0000	16.0000	16.0000	5120.0000
mysql	proxies_priv	1	5152.0000	16.0000	16.0000	5120.0000
mysql	procs_priv	0	5152.0000	16.0000	16.0000	5120.0000
mysql	help_category	53	5152.0000	16.0000	16.0000	5120.0000
mysql	gtid_executed	0	5136.0000	16.0000	0.0000	5120.0000
mysql	innodb_index_stats	96	5136.0000	16.0000	0.0000	5120.0000
mysql	innodb_table_stats	32	5136.0000	16.0000	0.0000	5120.0000
mysql	password_history	0	5136.0000	16.0000	0.0000	5120.0000
mysql	plugin	0	5136.0000	16.0000	0.0000	5120.0000
mysql	func	0	5136.0000	16.0000	0.0000	5120.0000
mysql	engine_cost	2	5136.0000	16.0000	0.0000	5120.0000
mysql	default_roles	0	5136.0000	16.0000	0.0000	5120.0000
mysql	replication_asynchronous_connection_failover_managed	0	5136.0000	16.0000	0.0000	5120.0000
mysql	replication_group_configuration_version	1	5136.0000	16.0000	0.0000	5120.0000
mysql	component	0	5136.0000	16.0000	0.0000	5120.0000
mysql	role_edges	0	5136.0000	16.0000	0.0000	5120.0000
mysql	server_cost	6	5136.0000	16.0000	0.0000	5120.0000
mysql	servers	0	5136.0000	16.0000	0.0000	5120.0000
mysql	slave_master_info	0	5136.0000	16.0000	0.0000	5120.0000
mysql	slave_relay_log_info	0	5136.0000	16.0000	0.0000	5120.0000
mysql	slave_worker_info	0	5136.0000	16.0000	0.0000	5120.0000
mysql	columns_priv	0	5136.0000	16.0000	0.0000	5120.0000
mysql	time_zone	0	5136.0000	16.0000	0.0000	5120.0000
mysql	time_zone_leap_second	0	5136.0000	16.0000	0.0000	5120.0000
mysql	time_zone_name	0	5136.0000	16.0000	0.0000	5120.0000
mysql	time_zone_transition	0	5136.0000	16.0000	0.0000	5120.0000
mysql	time_zone_transition_type	0	5136.0000	16.0000	0.0000	5120.0000
mysql	user	7	5136.0000	16.0000	0.0000	5120.0000
test	v1	0	32.0000	32.0000	0.0000	0.0000
test	v10	0	32.0000	32.0000	0.0000	0.0000
test	v2	0	32.0000	32.0000	0.0000	0.0000
test	v3	0	32.0000	32.0000	0.0000	0.0000
test	v4	0	32.0000	32.0000	0.0000	0.0000
test	v5	0	32.0000	32.0000	0.0000	0.0000
test	v6	0	32.0000	32.0000	0.0000	0.0000
test	v7	0	32.0000	32.0000	0.0000	0.0000
test	v8	0	32.0000	32.0000	0.0000	0.0000
test	v9	0	32.0000	32.0000	0.0000	0.0000
sys	sys_config	6	16.0000	16.0000	0.0000	0.0000
test	t1	0	16.0000	16.0000	0.0000	0.0000
test	t10	0	16.0000	16.0000	0.0000	0.0000
test	t2	0	16.0000	16.0000	0.0000	0.0000
test	t3	0	16.0000	16.0000	0.0000	0.0000
test	t4	0	16.0000	16.0000	0.0000	0.0000
test	t5	0	16.0000	16.0000	0.0000	0.0000
test	t6	0	16.0000	16.0000	0.0000	0.0000
test	t7	0	16.0000	16.0000	0.0000	0.0000
test	t8	0	16.0000	16.0000	0.0000	0.0000
test	t9	0	16.0000	16.0000	0.0000	0.0000
-------------------------------------------------

We also must admit that we do not know what "diagnostic disks" are. In any case, we do not use them.

Can't repeat.