mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 12:15:32 +02:00
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.
This commit is contained in:
parent
d8192f5495
commit
364a20fe0b
3 changed files with 48 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue