mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.0-galera' into 10.1
This commit is contained in:
@ -1003,11 +1003,13 @@ public:
|
||||
|
||||
switch (i) {
|
||||
case COLUMN_STAT_MIN_VALUE:
|
||||
table_field->read_stats->min_value->set_notnull();
|
||||
stat_field->val_str(&val);
|
||||
table_field->read_stats->min_value->store(val.ptr(), val.length(),
|
||||
&my_charset_bin);
|
||||
break;
|
||||
case COLUMN_STAT_MAX_VALUE:
|
||||
table_field->read_stats->max_value->set_notnull();
|
||||
stat_field->val_str(&val);
|
||||
table_field->read_stats->max_value->store(val.ptr(), val.length(),
|
||||
&my_charset_bin);
|
||||
@ -3659,17 +3661,8 @@ double get_column_range_cardinality(Field *field,
|
||||
{
|
||||
double avg_frequency= col_stats->get_avg_frequency();
|
||||
res= avg_frequency;
|
||||
/*
|
||||
psergey-todo: what does check for min_value, max_value mean?
|
||||
min/max_value are set to NULL in alloc_statistics_for_table() and
|
||||
alloc_statistics_for_table_share(). Both functions will immediately
|
||||
call create_min_max_statistical_fields_for_table and
|
||||
create_min_max_statistical_fields_for_table_share() respectively,
|
||||
which will set min/max_value to be valid pointers, unless OOM
|
||||
occurs.
|
||||
*/
|
||||
if (avg_frequency > 1.0 + 0.000001 &&
|
||||
col_stats->min_value && col_stats->max_value)
|
||||
col_stats->min_max_values_are_provided())
|
||||
{
|
||||
Histogram *hist= &col_stats->histogram;
|
||||
if (hist->is_available())
|
||||
@ -3692,7 +3685,7 @@ double get_column_range_cardinality(Field *field,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (col_stats->min_value && col_stats->max_value)
|
||||
if (col_stats->min_max_values_are_provided())
|
||||
{
|
||||
double sel, min_mp_pos, max_mp_pos;
|
||||
|
||||
|
Reference in New Issue
Block a user