Commit ee584137 authored by Eugene Kosov's avatar Eugene Kosov

fix clang compilation

parent 846174c5
...@@ -367,36 +367,37 @@ class Item_in_optimizer: public Item_bool_func ...@@ -367,36 +367,37 @@ class Item_in_optimizer: public Item_bool_func
Item_bool_func(thd, a, b), cache(0), expr_cache(0), Item_bool_func(thd, a, b), cache(0), expr_cache(0),
save_cache(0), result_for_null_param(UNKNOWN) save_cache(0), result_for_null_param(UNKNOWN)
{ m_with_subquery= true; } { m_with_subquery= true; }
bool fix_fields(THD *, Item **); bool fix_fields(THD *, Item **) override;
bool fix_left(THD *thd); bool fix_left(THD *thd);
table_map not_null_tables() const { return 0; } table_map not_null_tables() const override { return 0; }
bool is_null(); bool is_null() override;
longlong val_int(); longlong val_int() override;
void cleanup(); void cleanup() override;
enum Functype functype() const { return IN_OPTIMIZER_FUNC; } enum Functype functype() const override { return IN_OPTIMIZER_FUNC; }
const char *func_name() const { return "<in_optimizer>"; } const char *func_name() const override { return "<in_optimizer>"; }
Item_cache **get_cache() { return &cache; } Item_cache **get_cache() { return &cache; }
void keep_top_level_cache(); void keep_top_level_cache();
Item *transform(THD *thd, Item_transformer transformer, uchar *arg); Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
virtual Item *expr_cache_insert_transformer(THD *thd, uchar *unused); Item *expr_cache_insert_transformer(THD *thd, uchar *unused) override;
bool is_expensive_processor(void *arg); bool is_expensive_processor(void *arg) override;
bool is_expensive(); bool is_expensive() override;
void set_join_tab_idx(uint join_tab_idx_arg) void set_join_tab_idx(uint join_tab_idx_arg) override
{ args[1]->set_join_tab_idx(join_tab_idx_arg); } { args[1]->set_join_tab_idx(join_tab_idx_arg); }
virtual void get_cache_parameters(List<Item> &parameters); void get_cache_parameters(List<Item> &parameters) override;
bool is_top_level_item() const override; bool is_top_level_item() const override;
bool eval_not_null_tables(void *opt_arg); bool eval_not_null_tables(void *opt_arg) override;
bool find_not_null_fields(table_map allowed); bool find_not_null_fields(table_map allowed) override;
void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge); void fix_after_pullout(st_select_lex *new_parent, Item **ref,
bool merge) override;
bool invisible_mode(); bool invisible_mode();
void reset_cache() { cache= NULL; } void reset_cache() { cache= NULL; }
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
void restore_first_argument(); void restore_first_argument();
Item* get_wrapped_in_subselect_item() Item* get_wrapped_in_subselect_item()
{ return args[1]; } { return args[1]; }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_in_optimizer>(thd, this); } { return get_item_copy<Item_in_optimizer>(thd, this); }
enum precedence precedence() const { return args[1]->precedence(); } enum precedence precedence() const override { return args[1]->precedence(); }
}; };
...@@ -601,17 +602,17 @@ class Item_func_not :public Item_bool_func ...@@ -601,17 +602,17 @@ class Item_func_not :public Item_bool_func
public: public:
Item_func_not(THD *thd, Item *a): Item_func_not(THD *thd, Item *a):
Item_bool_func(thd, a), abort_on_null(FALSE) {} Item_bool_func(thd, a), abort_on_null(FALSE) {}
virtual void top_level_item() { abort_on_null= 1; } void top_level_item() override { abort_on_null= 1; }
bool is_top_level_item() const override { return abort_on_null; } bool is_top_level_item() const override { return abort_on_null; }
longlong val_int(); longlong val_int() override;
enum Functype functype() const { return NOT_FUNC; } enum Functype functype() const override { return NOT_FUNC; }
const char *func_name() const { return "not"; } const char *func_name() const override { return "not"; }
bool find_not_null_fields(table_map allowed) { return false; } bool find_not_null_fields(table_map allowed) override { return false; }
enum precedence precedence() const { return BANG_PRECEDENCE; } enum precedence precedence() const override { return BANG_PRECEDENCE; }
Item *neg_transformer(THD *thd); Item *neg_transformer(THD *thd) override;
bool fix_fields(THD *, Item **); bool fix_fields(THD *, Item **) override;
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_not>(thd, this); } { return get_item_copy<Item_func_not>(thd, this); }
}; };
...@@ -889,19 +890,22 @@ class Item_func_opt_neg :public Item_bool_func ...@@ -889,19 +890,22 @@ class Item_func_opt_neg :public Item_bool_func
Item_func_opt_neg(THD *thd, List<Item> &list): Item_func_opt_neg(THD *thd, List<Item> &list):
Item_bool_func(thd, list), negated(0), pred_level(0) {} Item_bool_func(thd, list), negated(0), pred_level(0) {}
public: public:
inline void top_level_item() { pred_level= 1; } void top_level_item() override { pred_level= 1; }
bool is_top_level_item() const override { return pred_level; } bool is_top_level_item() const override { return pred_level; }
Item *neg_transformer(THD *thd) Item *neg_transformer(THD *thd) override
{ {
negated= !negated; negated= !negated;
return this; return this;
} }
bool eq(const Item *item, bool binary_cmp) const; bool eq(const Item *item, bool binary_cmp) const override;
CHARSET_INFO *compare_collation() const { return cmp_collation.collation; } CHARSET_INFO *compare_collation() const override
Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) = 0; {
return cmp_collation.collation;
}
Item *propagate_equal_fields(THD *, const Context &,
COND_EQUAL *) override= 0;
}; };
class Item_func_between :public Item_func_opt_neg class Item_func_between :public Item_func_opt_neg
{ {
protected: protected:
......
...@@ -163,7 +163,7 @@ class Item_subselect :public Item_result_field, ...@@ -163,7 +163,7 @@ class Item_subselect :public Item_result_field,
select_result_interceptor *result); select_result_interceptor *result);
~Item_subselect(); ~Item_subselect();
void cleanup(); void cleanup() override;
virtual void reset() virtual void reset()
{ {
eliminated= FALSE; eliminated= FALSE;
...@@ -173,22 +173,23 @@ class Item_subselect :public Item_result_field, ...@@ -173,22 +173,23 @@ class Item_subselect :public Item_result_field,
Set the subquery result to a default value consistent with the semantics of Set the subquery result to a default value consistent with the semantics of
the result row produced for queries with implicit grouping. the result row produced for queries with implicit grouping.
*/ */
void no_rows_in_result()= 0; void no_rows_in_result() override= 0;
virtual bool select_transformer(JOIN *join); virtual bool select_transformer(JOIN *join);
bool assigned() { return value_assigned; } bool assigned() { return value_assigned; }
void assigned(bool a) { value_assigned= a; } void assigned(bool a) { value_assigned= a; }
enum Type type() const; enum Type type() const override;
bool is_null() bool is_null() override
{ {
update_null_value(); update_null_value();
return null_value; return null_value;
} }
bool fix_fields(THD *thd, Item **ref); bool fix_fields(THD *thd, Item **ref) override;
bool with_subquery() const { DBUG_ASSERT(fixed); return true; } bool with_subquery() const override { DBUG_ASSERT(fixed); return true; }
bool with_sum_func() const { return m_with_sum_func; } bool with_sum_func() const override { return m_with_sum_func; }
With_sum_func_cache* get_with_sum_func_cache() { return this; } With_sum_func_cache* get_with_sum_func_cache() override { return this; }
bool mark_as_dependent(THD *thd, st_select_lex *select, Item *item); bool mark_as_dependent(THD *thd, st_select_lex *select, Item *item);
void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge); void fix_after_pullout(st_select_lex *new_parent, Item **ref,
bool merge) override;
void recalc_used_tables(st_select_lex *new_parent, bool after_pullout); void recalc_used_tables(st_select_lex *new_parent, bool after_pullout);
virtual bool exec(); virtual bool exec();
/* /*
...@@ -202,13 +203,13 @@ class Item_subselect :public Item_result_field, ...@@ -202,13 +203,13 @@ class Item_subselect :public Item_result_field,
forced_const= TRUE; forced_const= TRUE;
} }
virtual bool fix_length_and_dec(); virtual bool fix_length_and_dec();
table_map used_tables() const; table_map used_tables() const override;
table_map not_null_tables() const { return 0; } table_map not_null_tables() const override { return 0; }
bool const_item() const; bool const_item() const override;
inline table_map get_used_tables_cache() { return used_tables_cache; } inline table_map get_used_tables_cache() { return used_tables_cache; }
Item *get_tmp_table_item(THD *thd); Item *get_tmp_table_item(THD *thd) override;
void update_used_tables(); void update_used_tables() override;
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
virtual bool have_guarded_conds() { return FALSE; } virtual bool have_guarded_conds() { return FALSE; }
bool change_engine(subselect_engine *eng) bool change_engine(subselect_engine *eng)
{ {
...@@ -223,7 +224,7 @@ class Item_subselect :public Item_result_field, ...@@ -223,7 +224,7 @@ class Item_subselect :public Item_result_field,
*/ */
bool is_evaluated() const; bool is_evaluated() const;
bool is_uncacheable() const; bool is_uncacheable() const;
bool is_expensive(); bool is_expensive() override;
/* /*
Used by max/min subquery to initialize value presence registration Used by max/min subquery to initialize value presence registration
...@@ -231,13 +232,13 @@ class Item_subselect :public Item_result_field, ...@@ -231,13 +232,13 @@ class Item_subselect :public Item_result_field,
*/ */
virtual void reset_value_registration() {} virtual void reset_value_registration() {}
enum_parsing_place place() { return parsing_place; } enum_parsing_place place() { return parsing_place; }
bool walk(Item_processor processor, bool walk_subquery, void *arg); bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
bool unknown_splocal_processor(void *arg); bool unknown_splocal_processor(void *arg) override;
bool mark_as_eliminated_processor(void *arg); bool mark_as_eliminated_processor(void *arg) override;
bool eliminate_subselect_processor(void *arg); bool eliminate_subselect_processor(void *arg) override;
bool set_fake_select_as_master_processor(void *arg); bool set_fake_select_as_master_processor(void *arg) override;
bool enumerate_field_refs_processor(void *arg); bool enumerate_field_refs_processor(void *arg) override;
bool check_vcol_func_processor(void *arg) bool check_vcol_func_processor(void *arg) override
{ {
return mark_unsupported_function("select ...", arg, VCOL_IMPOSSIBLE); return mark_unsupported_function("select ...", arg, VCOL_IMPOSSIBLE);
} }
...@@ -250,27 +251,27 @@ class Item_subselect :public Item_result_field, ...@@ -250,27 +251,27 @@ class Item_subselect :public Item_result_field,
@retval TRUE if the predicate is expensive @retval TRUE if the predicate is expensive
@retval FALSE otherwise @retval FALSE otherwise
*/ */
bool is_expensive_processor(void *arg) { return is_expensive(); } bool is_expensive_processor(void *arg) override { return is_expensive(); }
/** /**
Get the SELECT_LEX structure associated with this Item. Get the SELECT_LEX structure associated with this Item.
@return the SELECT_LEX structure associated with this Item @return the SELECT_LEX structure associated with this Item
*/ */
st_select_lex* get_select_lex(); st_select_lex* get_select_lex();
virtual bool expr_cache_is_needed(THD *); bool expr_cache_is_needed(THD *) override;
virtual void get_cache_parameters(List<Item> &parameters); void get_cache_parameters(List<Item> &parameters) override;
virtual bool is_subquery_processor (void *opt_arg) { return 1; } bool is_subquery_processor (void *opt_arg) override { return 1; }
bool exists2in_processor(void *opt_arg) { return 0; } bool exists2in_processor(void *opt_arg) override { return 0; }
bool limit_index_condition_pushdown_processor(void *opt_arg) bool limit_index_condition_pushdown_processor(void *opt_arg) override
{ {
return TRUE; return TRUE;
} }
void register_as_with_rec_ref(With_element *with_elem); void register_as_with_rec_ref(With_element *with_elem);
void init_expr_cache_tracker(THD *thd); void init_expr_cache_tracker(THD *thd);
Item* build_clone(THD *thd) { return 0; } Item* build_clone(THD *thd) override { return 0; }
Item* get_copy(THD *thd) { return 0; } Item* get_copy(THD *thd) override { return 0; }
bool wrap_tvc_into_select(THD *thd, st_select_lex *tvc_sl); bool wrap_tvc_into_select(THD *thd, st_select_lex *tvc_sl);
...@@ -393,37 +394,40 @@ class Item_exists_subselect :public Item_subselect ...@@ -393,37 +394,40 @@ class Item_exists_subselect :public Item_subselect
emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0) emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0)
{} {}
subs_type substype() { return EXISTS_SUBS; } subs_type substype() override { return EXISTS_SUBS; }
void reset() void reset() override
{ {
eliminated= FALSE; eliminated= FALSE;
value= 0; value= 0;
} }
void no_rows_in_result(); void no_rows_in_result() override;
const Type_handler *type_handler() const { return &type_handler_bool; } const Type_handler *type_handler() const override
longlong val_int(); {
double val_real(); return &type_handler_bool;
String *val_str(String*); }
my_decimal *val_decimal(my_decimal *); longlong val_int() override;
bool val_bool(); double val_real() override;
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) String *val_str(String*) override;
my_decimal *val_decimal(my_decimal *) override;
bool val_bool() override;
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{ return get_date_from_int(thd, ltime, fuzzydate); } { return get_date_from_int(thd, ltime, fuzzydate); }
bool fix_fields(THD *thd, Item **ref); bool fix_fields(THD *thd, Item **ref) override;
bool fix_length_and_dec(); bool fix_length_and_dec() override;
void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
bool select_transformer(JOIN *join); bool select_transformer(JOIN *join) override;
void top_level_item() { abort_on_null=1; } void top_level_item() override { abort_on_null=1; }
bool is_top_level_item() const override { return abort_on_null; } bool is_top_level_item() const override { return abort_on_null; }
bool exists2in_processor(void *opt_arg); bool exists2in_processor(void *opt_arg) override;
Item* expr_cache_insert_transformer(THD *thd, uchar *unused); Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override;
void mark_as_condition_AND_part(TABLE_LIST *embedding) void mark_as_condition_AND_part(TABLE_LIST *embedding) override
{ {
emb_on_expr_nest= embedding; emb_on_expr_nest= embedding;
} }
virtual void under_not(Item_func_not *upper) { upper_not= upper; }; void under_not(Item_func_not *upper) override { upper_not= upper; };
void set_exists_transformed() { exists_transformed= TRUE; } void set_exists_transformed() { exists_transformed= TRUE; }
...@@ -601,7 +605,7 @@ class Item_in_subselect :public Item_exists_subselect ...@@ -601,7 +605,7 @@ class Item_in_subselect :public Item_exists_subselect
if ( pushed_cond_guards) if ( pushed_cond_guards)
pushed_cond_guards[i]= v; pushed_cond_guards[i]= v;
} }
bool have_guarded_conds() { return MY_TEST(pushed_cond_guards); } bool have_guarded_conds() override { return MY_TEST(pushed_cond_guards); }
Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery
...@@ -611,41 +615,42 @@ class Item_in_subselect :public Item_exists_subselect ...@@ -611,41 +615,42 @@ class Item_in_subselect :public Item_exists_subselect
in_strategy(SUBS_NOT_TRANSFORMED), in_strategy(SUBS_NOT_TRANSFORMED),
pushed_cond_guards(NULL), func(NULL), do_not_convert_to_sj(FALSE), pushed_cond_guards(NULL), func(NULL), do_not_convert_to_sj(FALSE),
is_jtbm_merged(FALSE), is_jtbm_const_tab(FALSE), upper_item(0) {} is_jtbm_merged(FALSE), is_jtbm_const_tab(FALSE), upper_item(0) {}
void cleanup(); void cleanup() override;
subs_type substype() { return IN_SUBS; } subs_type substype() override { return IN_SUBS; }
void reset() void reset() override
{ {
eliminated= FALSE; eliminated= FALSE;
value= 0; value= 0;
null_value= 0; null_value= 0;
was_null= 0; was_null= 0;
} }
bool select_transformer(JOIN *join); bool select_transformer(JOIN *join) override;
bool create_in_to_exists_cond(JOIN *join_arg); bool create_in_to_exists_cond(JOIN *join_arg);
bool inject_in_to_exists_cond(JOIN *join_arg); bool inject_in_to_exists_cond(JOIN *join_arg);
virtual bool exec(); bool exec() override;
longlong val_int(); longlong val_int() override;
double val_real(); double val_real() override;
String *val_str(String*); String *val_str(String*) override;
my_decimal *val_decimal(my_decimal *); my_decimal *val_decimal(my_decimal *) override;
bool val_bool(); bool val_bool() override;
bool test_limit(st_select_lex_unit *unit); bool test_limit(st_select_lex_unit *unit);
void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
enum precedence precedence() const { return CMP_PRECEDENCE; } enum precedence precedence() const override { return CMP_PRECEDENCE; }
bool fix_fields(THD *thd, Item **ref); bool fix_fields(THD *thd, Item **ref) override;
bool fix_length_and_dec(); bool fix_length_and_dec() override;
void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge); void fix_after_pullout(st_select_lex *new_parent, Item **ref,
bool const_item() const bool merge) override;
bool const_item() const override
{ {
return Item_subselect::const_item() && left_expr->const_item(); return Item_subselect::const_item() && left_expr->const_item();
} }
void update_used_tables(); void update_used_tables() override;
bool setup_mat_engine(); bool setup_mat_engine();
bool init_left_expr_cache(); bool init_left_expr_cache();
/* Inform 'this' that it was computed, and contains a valid result. */ /* Inform 'this' that it was computed, and contains a valid result. */
void set_first_execution() { if (first_execution) first_execution= FALSE; } void set_first_execution() { if (first_execution) first_execution= FALSE; }
bool expr_cache_is_needed(THD *thd); bool expr_cache_is_needed(THD *thd) override;
inline bool left_expr_has_null(); inline bool left_expr_has_null();
void disable_cond_guard_for_const_null_left_expr(int i) void disable_cond_guard_for_const_null_left_expr(int i)
...@@ -737,13 +742,13 @@ class Item_in_subselect :public Item_exists_subselect ...@@ -737,13 +742,13 @@ class Item_in_subselect :public Item_exists_subselect
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
bool walk(Item_processor processor, bool walk_subquery, void *arg) bool walk(Item_processor processor, bool walk_subquery, void *arg) override
{ {
return left_expr->walk(processor, walk_subquery, arg) || return left_expr->walk(processor, walk_subquery, arg) ||
Item_subselect::walk(processor, walk_subquery, arg); Item_subselect::walk(processor, walk_subquery, arg);
} }
bool exists2in_processor(void *opt_arg __attribute__((unused))) bool exists2in_processor(void *opt_arg __attribute__((unused))) override
{ {
return 0; return 0;
}; };
......
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