mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 23:03:28 +03:00
Addressed the following issues from the review of the patch:
1. The PERSISTENT FOR clause of the ANALYZE command overrides the setting of the system variable use_stat_tables: with this clause ANALYZE unconditionally collects persistent statistics. 2. ANALYZE collects persistent statistics only for tables of the USER category. So it never collects persistent statistics for system tables.
This commit is contained in:
@ -650,6 +650,12 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
TABLE *tab= table->table;
|
||||
Field **field_ptr= tab->field;
|
||||
|
||||
if (lex->with_persistent_for_clause &&
|
||||
tab->s->table_category != TABLE_CATEGORY_USER)
|
||||
{
|
||||
compl_result_code= result_code= HA_ADMIN_INVALID;
|
||||
}
|
||||
|
||||
if (!lex->column_list)
|
||||
{
|
||||
uint fields= 0;
|
||||
@ -711,7 +717,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
|
||||
if (compl_result_code == HA_ADMIN_OK &&
|
||||
operator_func == &handler::ha_analyze &&
|
||||
thd->variables.use_stat_tables > 0)
|
||||
table->table->s->table_category == TABLE_CATEGORY_USER &&
|
||||
(thd->variables.use_stat_tables > 0 ||
|
||||
lex->with_persistent_for_clause))
|
||||
{
|
||||
if (!(compl_result_code=
|
||||
alloc_statistics_for_table(thd, table->table)) &&
|
||||
|
Reference in New Issue
Block a user