1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

This commit is contained in:
Alexander Barkov
2017-10-18 14:11:55 +04:00
243 changed files with 10228 additions and 1301 deletions

View File

@ -843,7 +843,7 @@ public:
else
{
stat_field->set_notnull();
stat_field->store(table->collected_stats->cardinality);
stat_field->store(table->collected_stats->cardinality,true);
}
}
@ -1054,7 +1054,7 @@ public:
switch (i) {
case COLUMN_STAT_MIN_VALUE:
if (table_field->type() == MYSQL_TYPE_BIT)
stat_field->store(table_field->collected_stats->min_value->val_int());
stat_field->store(table_field->collected_stats->min_value->val_int(),true);
else
{
table_field->collected_stats->min_value->val_str(&val);
@ -1063,7 +1063,7 @@ public:
break;
case COLUMN_STAT_MAX_VALUE:
if (table_field->type() == MYSQL_TYPE_BIT)
stat_field->store(table_field->collected_stats->max_value->val_int());
stat_field->store(table_field->collected_stats->max_value->val_int(),true);
else
{
table_field->collected_stats->max_value->val_str(&val);
@ -1630,7 +1630,7 @@ public:
of the parameters to be passed to the constructor of the Unique object.
*/
Count_distinct_field(Field *field, uint max_heap_table_size)
Count_distinct_field(Field *field, size_t max_heap_table_size)
{
table_field= field;
tree_key_length= field->pack_length();
@ -1728,7 +1728,7 @@ class Count_distinct_field_bit: public Count_distinct_field
{
public:
Count_distinct_field_bit(Field *field, uint max_heap_table_size)
Count_distinct_field_bit(Field *field, size_t max_heap_table_size)
{
table_field= field;
tree_key_length= sizeof(ulonglong);
@ -1824,7 +1824,7 @@ public:
if ((calc_state=
(Prefix_calc_state *) thd->alloc(sizeof(Prefix_calc_state)*key_parts)))
{
uint keyno= key_info-table->key_info;
uint keyno= (uint)(key_info-table->key_info);
for (i= 0, state= calc_state; i < key_parts; i++, state++)
{
/*
@ -2438,7 +2438,7 @@ int alloc_histograms_for_table_share(THD* thd, TABLE_SHARE *table_share,
inline
void Column_statistics_collected::init(THD *thd, Field *table_field)
{
uint max_heap_table_size= thd->variables.max_heap_table_size;
size_t max_heap_table_size= (size_t)thd->variables.max_heap_table_size;
TABLE *table= table_field->table;
uint pk= table->s->primary_key;
@ -3719,14 +3719,14 @@ double get_column_avg_frequency(Field * field)
*/
if (!table->s->field)
{
res= table->stat_records();
res= (double)table->stat_records();
return res;
}
Column_statistics *col_stats= field->read_stats;
if (!col_stats)
res= table->stat_records();
res= (double)table->stat_records();
else
res= col_stats->get_avg_frequency();
return res;
@ -3765,7 +3765,7 @@ double get_column_range_cardinality(Field *field,
double res;
TABLE *table= field->table;
Column_statistics *col_stats= field->read_stats;
double tab_records= table->stat_records();
double tab_records= (double)table->stat_records();
if (!col_stats)
return tab_records;