Recently we got a crash on our MariaDB server, the call stack is
The main problem is that the it try to read histogram of a performance schema table. In my understand, only TABLE_CATEGORY_USER should be read statistics because on open_and_process_table it only init stats when table is TABLE_CATEGORY_USER.
But when try to read histogram, when call statistics_for_tables_is_needed, the statistics_for_tables_is_needed return true instead of false.
I found in this commit https://github.com/MariaDB/server/commit/10f6b7001bd7b683c013ae407c2c48793caa3633 ,
the code changed from
which means only mysql stats table will be ignored. This code change may be not correct.