1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4

No need to read statistics for tables that are not USER tables.
We allocate memory for structures to collect statistics only for USER TABLES.
This commit is contained in:
Varun Gupta
2018-08-24 01:59:02 +05:30
committed by Marko Mäkelä
parent 7d8d37c31d
commit 69d7bfd970
4 changed files with 41 additions and 0 deletions

View File

@ -3129,6 +3129,9 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables)
if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table)
{
TABLE_SHARE *table_share= tl->table->s;
if (table_share && !(table_share->table_category == TABLE_CATEGORY_USER))
continue;
if (table_share &&
table_share->stats_cb.stats_can_be_read &&
!table_share->stats_cb.stats_is_read)