mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@ -3059,6 +3059,39 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@breif
|
||||
Cleanup of min/max statistical values for table share
|
||||
*/
|
||||
|
||||
void delete_stat_values_for_table_share(TABLE_SHARE *table_share)
|
||||
{
|
||||
TABLE_STATISTICS_CB *stats_cb= &table_share->stats_cb;
|
||||
Table_statistics *table_stats= stats_cb->table_stats;
|
||||
if (!table_stats)
|
||||
return;
|
||||
Column_statistics *column_stats= table_stats->column_stats;
|
||||
if (!column_stats)
|
||||
return;
|
||||
|
||||
for (Field **field_ptr= table_share->field;
|
||||
*field_ptr;
|
||||
field_ptr++, column_stats++)
|
||||
{
|
||||
if (column_stats->min_value)
|
||||
{
|
||||
delete column_stats->min_value;
|
||||
column_stats->min_value= NULL;
|
||||
}
|
||||
if (column_stats->max_value)
|
||||
{
|
||||
delete column_stats->max_value;
|
||||
column_stats->max_value= NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@brief
|
||||
Check whether any statistics is to be read for tables from a table list
|
||||
@ -3289,7 +3322,7 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables)
|
||||
The function is called when executing the statement DROP TABLE 'tab'.
|
||||
*/
|
||||
|
||||
int delete_statistics_for_table(THD *thd, LEX_CSTRING *db, LEX_CSTRING *tab)
|
||||
int delete_statistics_for_table(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *tab)
|
||||
{
|
||||
int err;
|
||||
enum_binlog_format save_binlog_format;
|
||||
|
Reference in New Issue
Block a user