Commit 2c8b096f authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru Committed by Vicențiu Ciorbaru

fixup

parent b481358a
...@@ -717,7 +717,7 @@ class Item_func_json_arrayagg : public Item_func_group_concat ...@@ -717,7 +717,7 @@ class Item_func_json_arrayagg : public Item_func_group_concat
String *get_str_from_item(Item *i, String *tmp) override; String *get_str_from_item(Item *i, String *tmp) override;
String *get_str_from_field(Item *i, Field *f, String *tmp, String *get_str_from_field(Item *i, Field *f, String *tmp,
const uchar *key, size_t offset) override; const uchar *key, size_t offset) override;
String *get_str_from_field(Item *i, Field *f, String *tmp); String *get_str_from_field(Item *i, Field *f, String *tmp) override;
void cut_max_length(String *result, void cut_max_length(String *result,
uint old_length, uint max_length) const override; uint old_length, uint max_length) const override;
public: public:
......
...@@ -2603,11 +2603,9 @@ void Column_statistics_collected::init(THD *thd, Field *table_field) ...@@ -2603,11 +2603,9 @@ void Column_statistics_collected::init(THD *thd, Field *table_field)
{ {
count_distinct= count_distinct=
table_field->type() == MYSQL_TYPE_BIT ? table_field->type() == MYSQL_TYPE_BIT ?
new (thd->mem_root) Count_distinct_field_bit(table_field, new (thd->mem_root) Count_distinct_field_bit(table_field) :
max_heap_table_size) : new (thd->mem_root) Count_distinct_field(table_field);
new (thd->mem_root) Count_distinct_field(table_field, if (count_distinct && !count_distinct->setup(thd, max_heap_table_size))
max_heap_table_size);
if (count_distinct && !count_distinct->exists())
{ {
/* Allocation failed */ /* Allocation failed */
delete count_distinct; delete count_distinct;
......
...@@ -309,7 +309,8 @@ static double get_merge_many_buffs_cost(THD *thd, ...@@ -309,7 +309,8 @@ static double get_merge_many_buffs_cost(THD *thd,
these will be random seeks. these will be random seeks.
*/ */
double Unique_impl::get_use_cost(uint *buffer, size_t nkeys, uint key_size, double Unique_impl::get_use_cost(THD *thd,
uint *buffer, size_t nkeys, uint key_size,
size_t max_in_memory_size, size_t max_in_memory_size,
double compare_factor, double compare_factor,
bool intersect_fl, bool *in_memory) bool intersect_fl, bool *in_memory)
......
...@@ -139,9 +139,9 @@ class Fixed_size_keys_descriptor : public Descriptor ...@@ -139,9 +139,9 @@ class Fixed_size_keys_descriptor : public Descriptor
Fixed_size_keys_descriptor(uint length); Fixed_size_keys_descriptor(uint length);
virtual ~Fixed_size_keys_descriptor() {} virtual ~Fixed_size_keys_descriptor() {}
uint get_length_of_key(uchar *ptr) override { return max_length; } uint get_length_of_key(uchar *ptr) override { return max_length; }
bool setup_for_field(THD *thd, Field *field); bool setup_for_field(THD *thd, Field *field) override;
bool setup_for_item(THD *thd, Item_sum *item, bool setup_for_item(THD *thd, Item_sum *item,
uint non_const_args, uint arg_count); uint non_const_args, uint arg_count) override;
virtual int compare_keys(uchar *a, uchar *b) override; virtual int compare_keys(uchar *a, uchar *b) override;
virtual bool is_single_arg() override { return true; } virtual bool is_single_arg() override { return true; }
}; };
...@@ -456,17 +456,17 @@ class Unique_impl : public Unique { ...@@ -456,17 +456,17 @@ class Unique_impl : public Unique {
uint size_arg, size_t max_in_memory_size_arg, uint size_arg, size_t max_in_memory_size_arg,
uint min_dupl_count_arg, Descriptor *desc); uint min_dupl_count_arg, Descriptor *desc);
~Unique_impl(); ~Unique_impl();
ulong elements_in_tree() { return tree.elements_in_tree; } ulong elements_in_tree() override { return tree.elements_in_tree; }
bool unique_add(void *ptr) override bool unique_add(void *ptr) override
{ {
return unique_add(ptr, m_descriptor->get_length_of_key((uchar*)ptr)); return unique_add(ptr, m_descriptor->get_length_of_key((uchar*)ptr));
} }
bool is_in_memory() { return (my_b_tell(&file) == 0); } bool is_in_memory() override { return (my_b_tell(&file) == 0); }
void close_for_expansion() { tree.flag= TREE_ONLY_DUPS; } void close_for_expansion() override { tree.flag= TREE_ONLY_DUPS; }
bool get(TABLE *table); bool get(TABLE *table) override;
/* Cost of searching for an element in the tree */ /* Cost of searching for an element in the tree */
inline static double get_search_cost(ulonglong tree_elems, inline static double get_search_cost(ulonglong tree_elems,
...@@ -490,11 +490,11 @@ class Unique_impl : public Unique { ...@@ -490,11 +490,11 @@ class Unique_impl : public Unique {
} }
void reset() override; void reset() override;
bool walk(TABLE *table, tree_walk_action action, void *walk_action_arg); bool walk(TABLE *table, tree_walk_action action, void *walk_action_arg) override;
uint get_size() const { return size; } uint get_size() const { return size; }
uint get_full_size() const { return full_size; } uint get_full_size() const { return full_size; }
size_t get_max_in_memory_size() const { return max_in_memory_size; } size_t get_max_in_memory_size() const override { return max_in_memory_size; }
bool is_count_stored() { return with_counters; } bool is_count_stored() { return with_counters; }
IO_CACHE *get_file () { return &file; } IO_CACHE *get_file () { return &file; }
int write_record_to_file(uchar *key); int write_record_to_file(uchar *key);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment