mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-6181 EITS could eat all tmpdir space and hang
Don't ignore errors from Count_distinct_field::add(), pass them to the caller, so that it could abort the data collection loop.
This commit is contained in:
@ -184,7 +184,7 @@ private:
|
||||
public:
|
||||
|
||||
inline void init(THD *thd, Field * table_field);
|
||||
inline void add(ha_rows rowno);
|
||||
inline bool add(ha_rows rowno);
|
||||
inline void finish(ha_rows rows);
|
||||
inline void cleanup();
|
||||
};
|
||||
@ -2219,9 +2219,10 @@ void Column_statistics_collected::init(THD *thd, Field *table_field)
|
||||
*/
|
||||
|
||||
inline
|
||||
void Column_statistics_collected::add(ha_rows rowno)
|
||||
bool Column_statistics_collected::add(ha_rows rowno)
|
||||
{
|
||||
|
||||
bool err= 0;
|
||||
if (column->is_null())
|
||||
nulls++;
|
||||
else
|
||||
@ -2232,8 +2233,9 @@ void Column_statistics_collected::add(ha_rows rowno)
|
||||
if (max_value && column->update_max(max_value, rowno == nulls))
|
||||
set_not_null(COLUMN_STAT_MAX_VALUE);
|
||||
if (count_distinct)
|
||||
count_distinct->add();
|
||||
err= count_distinct->add();
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@ -2487,8 +2489,11 @@ int collect_statistics_for_table(THD *thd, TABLE *table)
|
||||
table_field= *field_ptr;
|
||||
if (!bitmap_is_set(table->read_set, table_field->field_index))
|
||||
continue;
|
||||
table_field->collected_stats->add(rows);
|
||||
if ((rc= table_field->collected_stats->add(rows)))
|
||||
break;
|
||||
}
|
||||
if (rc)
|
||||
break;
|
||||
rows++;
|
||||
}
|
||||
file->ha_rnd_end();
|
||||
@ -2518,7 +2523,7 @@ int collect_statistics_for_table(THD *thd, TABLE *table)
|
||||
else
|
||||
table_field->collected_stats->cleanup();
|
||||
}
|
||||
bitmap_clear_all(table->write_set);
|
||||
bitmap_clear_all(table->write_set);
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
|
Reference in New Issue
Block a user