Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL), 11.4
-
None
Description
I execute the following SQL script with a Linux MariaDB server running with --lower-case-table-names=0:
SET GLOBAL userstat=1; |
CREATE TABLE t1 (a INT, KEY(a)); |
INSERT INTO t1 VALUES (1),(2),(3),(4); |
SELECT * FROM t1 ORDER BY a; |
CREATE TABLE T1 (a INT, KEY(a)); |
INSERT INTO T1 VALUES (1),(2),(3),(4); |
SELECT * FROM T1 ORDER BY a; |
+--------------+------------+-----------+--------------+------------------------+
|
| TABLE_SCHEMA | TABLE_NAME | ROWS_READ | ROWS_CHANGED | ROWS_CHANGED_X_INDEXES |
|
+--------------+------------+-----------+--------------+------------------------+
|
| test | T1 | 1 | 1 | 1 |
|
+--------------+------------+-----------+--------------+------------------------+
|
Looks wrong. The statistics for t1 and T1 should have separate records.
INDEX_STATISTICS has the same problem:
SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS; |
+--------------+------------+------------+-----------+
|
| TABLE_SCHEMA | TABLE_NAME | INDEX_NAME | ROWS_READ |
|
+--------------+------------+------------+-----------+
|
| test | T1 | a | 1 |
|
+--------------+------------+------------+-----------+
|
The problem is in these function in sql_connect.cc:
void init_global_table_stats(void)
|
{
|
my_hash_init(PSI_INSTRUMENT_ME, &global_table_stats, system_charset_info,
|
max_connections, 0, 0, (my_hash_get_key) get_key_table_stats,
|
(my_hash_free_key) free_table_stats, 0);
|
}
|
void init_global_index_stats(void)
|
{
|
my_hash_init(PSI_INSTRUMENT_ME, &global_index_stats, system_charset_info,
|
max_connections, 0, 0, (my_hash_get_key) get_key_index_stats,
|
(my_hash_free_key) free_index_stats, 0);
|
}
|