@@ -1967,7 +1967,7 @@ class Stat_table_write_iter
1967
1967
1968
1968
class Histogram_builder
1969
1969
{
1970
- public :
1970
+ protected :
1971
1971
Field *column; /* table field for which the histogram is built */
1972
1972
uint col_length; /* size of this field */
1973
1973
ha_rows records; /* number of records the histogram is built for */
@@ -1982,6 +1982,7 @@ class Histogram_builder
1982
1982
/* number of distinct values that occured only once */
1983
1983
ulonglong count_distinct_single_occurence;
1984
1984
1985
+ public:
1985
1986
Histogram_builder (Field *col, uint col_len, ha_rows rows)
1986
1987
: column(col), col_length(col_len), records(rows)
1987
1988
{
@@ -2934,7 +2935,8 @@ bool Column_statistics_collected::add()
2934
2935
*/
2935
2936
2936
2937
inline
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)
2938
2940
{
2939
2941
double val;
2940
2942
@@ -3486,7 +3488,7 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
3486
3488
if (table_field->read_stats ->histogram_type_on_disk != INVALID_HISTOGRAM)
3487
3489
have_histograms= true ;
3488
3490
}
3489
- table_share->stats_cb .total_hist_size = have_histograms? 1 : 0 ; // total_hist_size
3491
+ table_share->stats_cb .have_histograms = have_histograms;
3490
3492
3491
3493
/* Read statistics from the statistical table index_stats */
3492
3494
stat_table= stat_tables[INDEX_STAT].table ;
@@ -3626,7 +3628,7 @@ int read_histograms_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables)
3626
3628
{
3627
3629
TABLE_STATISTICS_CB *stats_cb= &table->s ->stats_cb ;
3628
3630
DBUG_ENTER (" read_histograms_for_table" );
3629
-
3631
+
3630
3632
if (stats_cb->start_histograms_load ())
3631
3633
{
3632
3634
Column_stat column_stat (stat_tables[COLUMN_STAT].table , table);
@@ -4547,7 +4549,7 @@ double Histogram_binary::range_selectivity(Field *field,
4547
4549
}
4548
4550
4549
4551
/*
4550
- Check whether the table is one of the persistent statistical tables.
4552
+ Check whether the table is one of the persistent statistical tables.
4551
4553
*/
4552
4554
bool is_stat_table (const LEX_CSTRING *db, LEX_CSTRING *table)
4553
4555
{
0 commit comments