diff options
author | Igor Babaev <igor@askmonty.org> | 2018-06-23 19:36:26 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-06-23 19:36:26 -0700 |
commit | 364a20fe0b072fb1d2a9b54a8c4e47a5012f3e97 (patch) | |
tree | 06958a680704bdedbd42af2249bfedb37f424b23 /sql | |
parent | d8192f5495ec5db99cde0cee5096bd99b6eaf01f (diff) | |
download | mariadb-git-364a20fe0b072fb1d2a9b54a8c4e47a5012f3e97.tar.gz |
MDEV-16507 SIGSEGV when use_stat_tables = preferably and
optimizer_use_condition_selectivity = 4
It does not makes sense to try to read statistics for temporary tables
because it's not collected.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_statistics.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 471749ad346..1febc02b903 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -2952,7 +2952,7 @@ bool statistics_for_tables_is_needed(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *tl= tables; tl; tl= tl->next_global) { - if (!tl->is_view_or_derived() && tl->table) + if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table) { TABLE_SHARE *table_share= tl->table->s; if (table_share && @@ -2964,7 +2964,7 @@ bool statistics_for_tables_is_needed(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *tl= tables; tl; tl= tl->next_global) { - if (!tl->is_view_or_derived() && tl->table) + if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table) { TABLE_SHARE *table_share= tl->table->s; if (table_share && @@ -3093,7 +3093,7 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables) for (TABLE_LIST *tl= tables; tl; tl= tl->next_global) { - if (!tl->is_view_or_derived() && tl->table) + if (!tl->is_view_or_derived() && !is_temporary_table(tl) && tl->table) { TABLE_SHARE *table_share= tl->table->s; if (table_share && @@ -3867,4 +3867,4 @@ bool is_stat_table(const char *db, const char *table) } } return false; -}
\ No newline at end of file +} |