@@ -1967,7 +1967,7 @@ class Stat_table_write_iter
19671967
19681968class Histogram_builder
19691969{
1970- public :
1970+ protected :
19711971 Field *column; /* table field for which the histogram is built */
19721972 uint col_length; /* size of this field */
19731973 ha_rows records; /* number of records the histogram is built for */
@@ -1982,6 +1982,7 @@ class Histogram_builder
19821982 /* number of distinct values that occured only once */
19831983 ulonglong count_distinct_single_occurence;
19841984
1985+ public:
19851986 Histogram_builder (Field *col, uint col_len, ha_rows rows)
19861987 : column(col), col_length(col_len), records(rows)
19871988 {
@@ -2934,7 +2935,8 @@ bool Column_statistics_collected::add()
29342935*/
29352936
29362937inline
2937- void Column_statistics_collected::finish (MEM_ROOT *mem_root, ha_rows rows, double sample_fraction)
2938+ void Column_statistics_collected::finish (MEM_ROOT *mem_root, ha_rows rows,
2939+ double sample_fraction)
29382940{
29392941 double val;
29402942
@@ -3486,7 +3488,7 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
34863488 if (table_field->read_stats ->histogram_type_on_disk != INVALID_HISTOGRAM)
34873489 have_histograms= true ;
34883490 }
3489- table_share->stats_cb .total_hist_size = have_histograms? 1 : 0 ; // total_hist_size
3491+ table_share->stats_cb .have_histograms = have_histograms;
34903492
34913493 /* Read statistics from the statistical table index_stats */
34923494 stat_table= stat_tables[INDEX_STAT].table ;
@@ -3626,7 +3628,7 @@ int read_histograms_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
36263628{
36273629 TABLE_STATISTICS_CB *stats_cb= &table->s ->stats_cb ;
36283630 DBUG_ENTER (" read_histograms_for_table" );
3629-
3631+
36303632 if (stats_cb->start_histograms_load ())
36313633 {
36323634 Column_stat column_stat (stat_tables[COLUMN_STAT].table , table);
@@ -4547,7 +4549,7 @@ double Histogram_binary::range_selectivity(Field *field,
45474549}
45484550
45494551/*
4550- Check whether the table is one of the persistent statistical tables.
4552+ Check whether the table is one of the persistent statistical tables.
45514553*/
45524554bool is_stat_table (const LEX_CSTRING *db, LEX_CSTRING *table)
45534555{
0 commit comments