diff options
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 1155 |
1 files changed, 587 insertions, 568 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index fed0266f62a..53c236bbce7 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1,7 +1,7 @@ #ifndef ITEM_FUNC_INCLUDED #define ITEM_FUNC_INCLUDED /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. - Copyright (c) 2009, 2020, MariaDB + Copyright (c) 2009, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -93,7 +93,7 @@ public: DBUG_ASSERT(0); return SCALAR_CMP_EQ; } - enum Type type() const { return FUNC_ITEM; } + enum Type type() const override { return FUNC_ITEM; } virtual enum Functype functype() const { return UNKNOWN_FUNC; } Item_func(THD *thd): Item_func_or_sum(thd) { @@ -135,8 +135,8 @@ public: Item_func_or_sum(thd, item), not_null_tables_cache(item->not_null_tables_cache) { } - bool fix_fields(THD *, Item **ref); - void cleanup() + bool fix_fields(THD *, Item **ref) override; + void cleanup() override { Item_func_or_sum::cleanup(); used_tables_and_const_cache_init(); @@ -152,13 +152,13 @@ public: } COND *build_equal_items(THD *thd, COND_EQUAL *inherited, bool link_item_fields, - COND_EQUAL **cond_equal_ref); - SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) + COND_EQUAL **cond_equal_ref) override; + SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override { DBUG_ENTER("Item_func::get_mm_tree"); DBUG_RETURN(const_item() ? get_mm_tree_for_const(param) : NULL); } - bool eq(const Item *item, bool binary_cmp) const; + bool eq(const Item *item, bool binary_cmp) const override; virtual Item *key_item() const { return args[0]; } void set_arguments(THD *thd, List<Item> &list) { @@ -167,11 +167,12 @@ public: list.empty(); // Fields are used } void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, - List<Item> &fields, uint flags); + List<Item> &fields, uint flags) override; void print(String *str, enum_query_type query_type) override; void print_op(String *str, enum_query_type query_type); void print_args(String *str, uint from, enum_query_type query_type); - bool is_null() { + bool is_null() override + { update_null_value(); return null_value; } @@ -179,9 +180,9 @@ public: void signal_divide_by_null(); friend class udf_handler; - Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) + Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override { return tmp_table_field_from_field_type(root, table); } - Item *get_tmp_table_item(THD *thd); + Item *get_tmp_table_item(THD *thd) override; void fix_char_length_ulonglong(ulonglong max_char_length_arg) { @@ -195,13 +196,13 @@ public: else max_length= (uint32) max_result_length; } - Item *transform(THD *thd, Item_transformer transformer, uchar *arg); + Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override; Item* compile(THD *thd, Item_analyzer analyzer, uchar **arg_p, - Item_transformer transformer, uchar *arg_t); + Item_transformer transformer, uchar *arg_t) override; void traverse_cond(Cond_traverser traverser, - void * arg, traverse_order order); - bool eval_not_null_tables(void *opt_arg); - bool find_not_null_fields(table_map allowed); + void * arg, traverse_order order) override; + bool eval_not_null_tables(void *opt_arg) override; + bool find_not_null_fields(table_map allowed) override; // bool is_expensive_processor(void *arg); // virtual bool is_expensive() { return 0; } inline void raise_numeric_overflow(const char *type_name) @@ -307,6 +308,7 @@ public: } Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) + override { /* By default only substitution for a field whose two different values @@ -322,7 +324,7 @@ public: return used_tables() & RAND_TABLE_BIT; } - bool excl_dep_on_table(table_map tab_map) + bool excl_dep_on_table(table_map tab_map) override { if (used_tables() & OUTER_REF_TABLE_BIT) return false; @@ -330,14 +332,14 @@ public: Item_args::excl_dep_on_table(tab_map); } - bool excl_dep_on_grouping_fields(st_select_lex *sel) + bool excl_dep_on_grouping_fields(st_select_lex *sel) override { if (has_rand_bit() || with_subquery()) return false; return Item_args::excl_dep_on_grouping_fields(sel); } - bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) + bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override { return Item_args::excl_dep_on_in_subq_left_part(subq_pred); } @@ -350,24 +352,24 @@ public: representation of a TIMESTAMP argument verbatim, and thus does not depend on the timezone. */ - virtual bool check_valid_arguments_processor(void *bool_arg) + bool check_valid_arguments_processor(void *bool_arg) override { return has_timestamp_args(); } - virtual bool find_function_processor (void *arg) + bool find_function_processor (void *arg) override { return functype() == *(Functype *) arg; } - void no_rows_in_result() + void no_rows_in_result() override { for (uint i= 0; i < arg_count; i++) { args[i]->no_rows_in_result(); } } - void restore_to_before_no_rows_in_result() + void restore_to_before_no_rows_in_result() override { for (uint i= 0; i < arg_count; i++) { @@ -384,8 +386,8 @@ public: - or replaced to an Item_int_with_ref */ bool setup_args_and_comparator(THD *thd, Arg_comparator *cmp); - Item_func *get_item_func() { return this; } - bool is_simplified_cond_processor(void *arg) + Item_func *get_item_func() override { return this; } + bool is_simplified_cond_processor(void *arg) override { return const_item() && !val_int(); } }; @@ -400,17 +402,18 @@ public: { collation= DTCollation_numeric(); } Item_real_func(THD *thd, List<Item> &list): Item_func(thd, list) { collation= DTCollation_numeric(); } - String *val_str(String*str); - my_decimal *val_decimal(my_decimal *decimal_value); - longlong val_int() + String *val_str(String*str) override; + my_decimal *val_decimal(my_decimal *decimal_value) override; + longlong val_int() override { DBUG_ASSERT(fixed()); return Converter_double_to_longlong(val_real(), unsigned_flag).result(); } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return get_date_from_real(thd, ltime, fuzzydate); } - const Type_handler *type_handler() const { return &type_handler_double; } - bool fix_length_and_dec() + const Type_handler *type_handler() const override + { return &type_handler_double; } + bool fix_length_and_dec() override { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); @@ -436,7 +439,7 @@ public: Item_hybrid_func(THD *thd, List<Item> &list): Item_func(thd, list) { } Item_hybrid_func(THD *thd, Item_hybrid_func *item) :Item_func(thd, item), Type_handler_hybrid_field_type(item) { } - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { return Type_handler_hybrid_field_type::type_handler(); } void fix_length_and_dec_long_or_longlong(uint char_length, bool unsigned_arg) { @@ -750,11 +753,11 @@ public: { m_func_handler= handler; } - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { return m_func_handler->return_type_handler(this); } - Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) + Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override { DBUG_ASSERT(fixed()); const Type_handler *h= m_func_handler->type_handler_for_create_select(this); @@ -762,31 +765,31 @@ public: Record_addr(maybe_null()), *this, table); } - String *val_str(String *to) + String *val_str(String *to) override { return m_func_handler->val_str(this, to); } - String *val_str_ascii(String *to) + String *val_str_ascii(String *to) override { return m_func_handler->val_str_ascii(this, to); } - double val_real() + double val_real() override { return m_func_handler->val_real(this); } - longlong val_int() + longlong val_int() override { return m_func_handler->val_int(this); } - my_decimal *val_decimal(my_decimal *to) + my_decimal *val_decimal(my_decimal *to) override { return m_func_handler->val_decimal(this, to); } - bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate) override { return m_func_handler->get_date(thd, this, to, fuzzydate); } - bool val_native(THD *thd, Native *to) + bool val_native(THD *thd, Native *to) override { return m_func_handler->val_native(thd, this, to); } @@ -889,25 +892,25 @@ public: Item_hybrid_func(thd, list) { collation= DTCollation_numeric(); } - double val_real() + double val_real() override { DBUG_ASSERT(fixed()); return Item_func_hybrid_field_type::type_handler()-> Item_func_hybrid_field_type_val_real(this); } - longlong val_int() + longlong val_int() override { DBUG_ASSERT(fixed()); return Item_func_hybrid_field_type::type_handler()-> Item_func_hybrid_field_type_val_int(this); } - my_decimal *val_decimal(my_decimal *dec) + my_decimal *val_decimal(my_decimal *dec) override { DBUG_ASSERT(fixed()); return Item_func_hybrid_field_type::type_handler()-> Item_func_hybrid_field_type_val_decimal(this, dec); } - String *val_str(String*str) + String *val_str(String*str) override { DBUG_ASSERT(fixed()); String *res= Item_func_hybrid_field_type::type_handler()-> @@ -915,14 +918,14 @@ public: DBUG_ASSERT(null_value == (res == NULL)); return res; } - bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) + bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override { DBUG_ASSERT(fixed()); return Item_func_hybrid_field_type::type_handler()-> Item_func_hybrid_field_type_get_date_with_warn(thd, this, to, mode); } - bool val_native(THD *thd, Native *to) + bool val_native(THD *thd, Native *to) override { DBUG_ASSERT(fixed()); return native_op(thd, to); @@ -1090,7 +1093,7 @@ public: class Item_num_op :public Item_func_numhybrid { protected: - bool check_arguments() const + bool check_arguments() const override { return false; // Checked by aggregate_for_num_op() } @@ -1098,7 +1101,7 @@ public: Item_num_op(THD *thd, Item *a, Item *b): Item_func_numhybrid(thd, a, b) {} virtual void result_precision()= 0; - virtual inline void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) override { print_op(str, query_type); } @@ -1128,7 +1131,7 @@ public: if (decimals == 0 && downcast_decimal_to_int) set_handler(type_handler_long_or_longlong()); } - bool need_parentheses_in_default() { return true; } + bool need_parentheses_in_default() override { return true; } }; @@ -1156,16 +1159,16 @@ public: { collation= DTCollation_numeric(); fix_char_length(21); } Item_int_func(THD *thd, Item_int_func *item) :Item_func(thd, item) { collation= DTCollation_numeric(); } - double val_real(); - String *val_str(String*str); - my_decimal *val_decimal(my_decimal *decimal_value) + double val_real() override; + String *val_str(String*str) override; + my_decimal *val_decimal(my_decimal *decimal_value) override { return val_decimal_from_int(decimal_value); } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return get_date_from_int(thd, ltime, fuzzydate); } - const Type_handler *type_handler() const= 0; - bool fix_length_and_dec() { return FALSE; } + const Type_handler *type_handler() const override= 0; + bool fix_length_and_dec() override { return FALSE; } }; @@ -1178,13 +1181,13 @@ public: Item_long_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {} Item_long_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { } Item_long_func(THD *thd, Item_long_func *item) :Item_int_func(thd, item) {} - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { if (unsigned_flag) return &type_handler_ulong; return &type_handler_slong; } - bool fix_length_and_dec() { max_length= 11; return FALSE; } + bool fix_length_and_dec() override { max_length= 11; return FALSE; } }; @@ -1193,10 +1196,11 @@ class Item_func_hash: public Item_int_func public: Item_func_hash(THD *thd, List<Item> &item): Item_int_func(thd, item) {} - longlong val_int(); - bool fix_length_and_dec(); - const Type_handler *type_handler() const { return &type_handler_slong; } - Item *get_copy(THD *thd) + longlong val_int() override; + bool fix_length_and_dec() override; + const Type_handler *type_handler() const override + { return &type_handler_slong; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_hash>(thd, this); } LEX_CSTRING func_name_cstring() const override { @@ -1216,7 +1220,7 @@ public: Item_int_func(thd, a, b, c, d) {} Item_longlong_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { } Item_longlong_func(THD *thd, Item_longlong_func *item) :Item_int_func(thd, item) {} - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { if (unsigned_flag) return &type_handler_ulonglong; @@ -1253,16 +1257,16 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("%ROWCOUNT") }; return name; } - longlong val_int(); - bool check_vcol_func_processor(void *arg) + longlong val_int() override; + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), arg, VCOL_SESSION_FUNC); } - void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) override { return Cursor_ref::print_func(str, func_name_cstring()); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_cursor_rowcount>(thd, this); } }; @@ -1279,15 +1283,15 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("connection_id") }; return name; } - bool fix_length_and_dec(); - bool fix_fields(THD *thd, Item **ref); - longlong val_int() { DBUG_ASSERT(fixed()); return value; } - bool check_vcol_func_processor(void *arg) + bool fix_length_and_dec() override; + bool fix_fields(THD *thd, Item **ref) override; + longlong val_int() override { DBUG_ASSERT(fixed()); return value; } + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_connection_id>(thd, this); } }; @@ -1304,12 +1308,12 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_signed") }; return name; } - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { return Type_handler::type_handler_long_or_longlong(max_char_length(), false); } - longlong val_int() + longlong val_int() override { longlong value= args[0]->val_int_signed_typecast(); null_value= args[0]->null_value; @@ -1344,14 +1348,15 @@ public: set_if_bigger(char_length, 1U + (unsigned_flag ? 0 : 1)); fix_char_length(char_length); } - bool fix_length_and_dec() + bool fix_length_and_dec() override { return args[0]->type_handler()->Item_func_signed_fix_length_and_dec(this); } - virtual void print(String *str, enum_query_type query_type); - uint decimal_precision() const { return args[0]->decimal_precision(); } - bool need_parentheses_in_default() { return true; } - Item *get_copy(THD *thd) + void print(String *str, enum_query_type query_type) override; + uint decimal_precision() const override + { return args[0]->decimal_precision(); } + bool need_parentheses_in_default() override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_signed>(thd, this); } }; @@ -1368,25 +1373,25 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_unsigned") }; return name; } - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { if (max_char_length() <= MY_INT32_NUM_DECIMAL_DIGITS - 1) return &type_handler_ulong; return &type_handler_ulonglong; } - longlong val_int() + longlong val_int() override { longlong value= args[0]->val_int_unsigned_typecast(); null_value= args[0]->null_value; return value; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { return args[0]->type_handler()->Item_func_unsigned_fix_length_and_dec(this); } - uint decimal_precision() const { return max_length; } - virtual void print(String *str, enum_query_type query_type); - Item *get_copy(THD *thd) + uint decimal_precision() const override { return max_length; } + void print(String *str, enum_query_type query_type) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_unsigned>(thd, this); } }; @@ -1403,18 +1408,19 @@ public: fix_char_length(my_decimal_precision_to_length_no_truncation(len, dec, unsigned_flag)); } - String *val_str(String *str) { return VDec(this).to_string(str); } - double val_real() { return VDec(this).to_double(); } - longlong val_int() { return VDec(this).to_longlong(unsigned_flag); } - my_decimal *val_decimal(my_decimal*); - bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) + String *val_str(String *str) override { return VDec(this).to_string(str); } + double val_real() override { return VDec(this).to_double(); } + longlong val_int() override { return VDec(this).to_longlong(unsigned_flag); } + my_decimal *val_decimal(my_decimal*) override; + bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override { return decimal_to_datetime_with_warn(thd, VDec(this).ptr(), to, mode, NULL, NULL); } - const Type_handler *type_handler() const { return &type_handler_newdecimal; } + const Type_handler *type_handler() const override + { return &type_handler_newdecimal; } void fix_length_and_dec_generic() {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { return args[0]->type_handler()->Item_decimal_typecast_fix_length_and_dec(this); @@ -1424,9 +1430,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("decimal_typecast") }; return name; } - virtual void print(String *str, enum_query_type query_type); - bool need_parentheses_in_default() { return true; } - Item *get_copy(THD *thd) + void print(String *str, enum_query_type query_type) override; + bool need_parentheses_in_default() override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_decimal_typecast>(thd, this); } }; @@ -1457,8 +1463,9 @@ public: Item_float_typecast(THD *thd, Item *a) :Item_real_typecast(thd, a, MAX_FLOAT_STR_LENGTH, NOT_FIXED_DEC) { } - const Type_handler *type_handler() const { return &type_handler_float; } - bool fix_length_and_dec() + const Type_handler *type_handler() const override + { return &type_handler_float; } + bool fix_length_and_dec() override { return args[0]->type_handler()->Item_float_typecast_fix_length_and_dec(this); @@ -1468,11 +1475,11 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("float_typecast") }; return name; } - double val_real() + double val_real() override { return (double) (float) val_real_with_truncate(FLT_MAX); } - String *val_str(String*str) + String *val_str(String*str) override { Float nr(Item_float_typecast::val_real()); if (null_value) @@ -1480,7 +1487,7 @@ public: nr.to_string(str, decimals); return str; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_float_typecast>(thd, this); } }; @@ -1491,7 +1498,7 @@ public: Item_double_typecast(THD *thd, Item *a, uint len, uint dec): Item_real_typecast(thd, a, len, dec) { } - bool fix_length_and_dec() + bool fix_length_and_dec() override { return args[0]->type_handler()->Item_double_typecast_fix_length_and_dec(this); @@ -1501,8 +1508,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("double_typecast") }; return name; } - double val_real() { return val_real_with_truncate(DBL_MAX); } - Item *get_copy(THD *thd) + double val_real() override { return val_real_with_truncate(DBL_MAX); } + Item *get_copy(THD *thd) override { return get_item_copy<Item_double_typecast>(thd, this); } }; @@ -1527,12 +1534,12 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("+") }; return name; } - enum precedence precedence() const { return ADD_PRECEDENCE; } - bool fix_length_and_dec(); - longlong int_op(); - double real_op(); - my_decimal *decimal_op(my_decimal *); - Item *get_copy(THD *thd) + enum precedence precedence() const override { return ADD_PRECEDENCE; } + bool fix_length_and_dec() override; + longlong int_op() override; + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_plus>(thd, this); } }; @@ -1549,12 +1556,12 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("-") }; return name; } - enum precedence precedence() const { return ADD_PRECEDENCE; } - Sql_mode_dependency value_depends_on_sql_mode() const; - longlong int_op(); - double real_op(); - my_decimal *decimal_op(my_decimal *); - bool fix_length_and_dec(); + enum precedence precedence() const override { return ADD_PRECEDENCE; } + Sql_mode_dependency value_depends_on_sql_mode() const override; + longlong int_op() override; + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; + bool fix_length_and_dec() override; void fix_unsigned_flag(); void fix_length_and_dec_double() { @@ -1571,7 +1578,7 @@ public: Item_func_additive_op::fix_length_and_dec_int(); fix_unsigned_flag(); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_minus>(thd, this); } }; @@ -1586,15 +1593,15 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("*") }; return name; } - enum precedence precedence() const { return MUL_PRECEDENCE; } - longlong int_op(); - double real_op(); - my_decimal *decimal_op(my_decimal *); - void result_precision(); - bool fix_length_and_dec(); - bool check_partition_func_processor(void *int_arg) {return FALSE;} - bool check_vcol_func_processor(void *arg) { return FALSE;} - Item *get_copy(THD *thd) + enum precedence precedence() const override { return MUL_PRECEDENCE; } + longlong int_op() override; + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; + void result_precision() override; + bool fix_length_and_dec() override; + bool check_partition_func_processor(void *int_arg) override {return FALSE;} + bool check_vcol_func_processor(void *arg) override { return FALSE;} + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_mul>(thd, this); } }; @@ -1604,20 +1611,20 @@ class Item_func_div :public Item_num_op public: uint prec_increment; Item_func_div(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {} - longlong int_op() { DBUG_ASSERT(0); return 0; } - double real_op(); - my_decimal *decimal_op(my_decimal *); + longlong int_op() override { DBUG_ASSERT(0); return 0; } + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("/") }; return name; } - enum precedence precedence() const { return MUL_PRECEDENCE; } - bool fix_length_and_dec(); + enum precedence precedence() const override { return MUL_PRECEDENCE; } + bool fix_length_and_dec() override; void fix_length_and_dec_double(); void fix_length_and_dec_int(); - void result_precision(); - Item *get_copy(THD *thd) + void result_precision() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_div>(thd, this); } }; @@ -1627,25 +1634,25 @@ class Item_func_int_div :public Item_int_func public: Item_func_int_div(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("DIV") }; return name; } - enum precedence precedence() const { return MUL_PRECEDENCE; } - const Type_handler *type_handler() const + enum precedence precedence() const override { return MUL_PRECEDENCE; } + const Type_handler *type_handler() const override { return type_handler_long_or_longlong(); } - bool fix_length_and_dec(); - void print(String *str, enum_query_type query_type) + bool fix_length_and_dec() override; + void print(String *str, enum_query_type query_type) override { print_op(str, query_type); } - bool check_partition_func_processor(void *int_arg) {return FALSE;} - bool check_vcol_func_processor(void *arg) { return FALSE;} - bool need_parentheses_in_default() { return true; } - Item *get_copy(THD *thd) + bool check_partition_func_processor(void *int_arg) override {return FALSE;} + bool check_vcol_func_processor(void *arg) override { return FALSE;} + bool need_parentheses_in_default() override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_int_div>(thd, this); } }; @@ -1654,17 +1661,17 @@ class Item_func_mod :public Item_num_op { public: Item_func_mod(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {} - longlong int_op(); - double real_op(); - my_decimal *decimal_op(my_decimal *); + longlong int_op() override; + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("MOD") }; return name; } - enum precedence precedence() const { return MUL_PRECEDENCE; } - void result_precision(); - bool fix_length_and_dec(); + enum precedence precedence() const override { return MUL_PRECEDENCE; } + void result_precision() override; + bool fix_length_and_dec() override; void fix_length_and_dec_double() { Item_num_op::fix_length_and_dec_double(); @@ -1681,9 +1688,9 @@ public: DBUG_ASSERT(decimals == 0); set_handler(type_handler_long_or_longlong()); } - bool check_partition_func_processor(void *int_arg) {return FALSE;} - bool check_vcol_func_processor(void *arg) { return FALSE;} - Item *get_copy(THD *thd) + bool check_partition_func_processor(void *int_arg) override {return FALSE;} + bool check_vcol_func_processor(void *arg) override { return FALSE;} + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_mod>(thd, this); } }; @@ -1692,17 +1699,17 @@ class Item_func_neg :public Item_func_num1 { public: Item_func_neg(THD *thd, Item *a): Item_func_num1(thd, a) {} - double real_op(); - longlong int_op(); - my_decimal *decimal_op(my_decimal *); + double real_op() override; + longlong int_op() override; + my_decimal *decimal_op(my_decimal *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("-") }; return name; } - enum Functype functype() const { return NEG_FUNC; } - enum precedence precedence() const { return NEG_PRECEDENCE; } - void print(String *str, enum_query_type query_type) + enum Functype functype() const override { return NEG_FUNC; } + enum precedence precedence() const override { return NEG_PRECEDENCE; } + void print(String *str, enum_query_type query_type) override { str->append(func_name_cstring()); args[0]->print_parenthesised(str, query_type, precedence()); @@ -1710,10 +1717,11 @@ public: void fix_length_and_dec_int(); void fix_length_and_dec_double(); void fix_length_and_dec_decimal(); - bool fix_length_and_dec(); - uint decimal_precision() const { return args[0]->decimal_precision(); } - bool need_parentheses_in_default() { return true; } - Item *get_copy(THD *thd) + bool fix_length_and_dec() override; + uint decimal_precision() const override + { return args[0]->decimal_precision(); } + bool need_parentheses_in_default() override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_neg>(thd, this); } }; @@ -1722,9 +1730,9 @@ class Item_func_abs :public Item_func_num1 { public: Item_func_abs(THD *thd, Item *a): Item_func_num1(thd, a) {} - double real_op(); - longlong int_op(); - my_decimal *decimal_op(my_decimal *); + double real_op() override; + longlong int_op() override; + my_decimal *decimal_op(my_decimal *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("abs") }; @@ -1733,8 +1741,8 @@ public: void fix_length_and_dec_int(); void fix_length_and_dec_double(); void fix_length_and_dec_decimal(); - bool fix_length_and_dec(); - Item *get_copy(THD *thd) + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_abs>(thd, this); } }; @@ -1742,12 +1750,12 @@ public: class Item_dec_func :public Item_real_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_real(0, arg_count); } public: Item_dec_func(THD *thd, Item *a): Item_real_func(thd, a) {} Item_dec_func(THD *thd, Item *a, Item *b): Item_real_func(thd, a, b) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); @@ -1760,13 +1768,13 @@ class Item_func_exp :public Item_dec_func { public: Item_func_exp(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("exp") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_exp>(thd, this); } }; @@ -1775,13 +1783,13 @@ class Item_func_ln :public Item_dec_func { public: Item_func_ln(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("ln") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_ln>(thd, this); } }; @@ -1791,13 +1799,13 @@ class Item_func_log :public Item_dec_func public: Item_func_log(THD *thd, Item *a): Item_dec_func(thd, a) {} Item_func_log(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("log") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_log>(thd, this); } }; @@ -1806,13 +1814,13 @@ class Item_func_log2 :public Item_dec_func { public: Item_func_log2(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("log2") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_log2>(thd, this); } }; @@ -1821,13 +1829,13 @@ class Item_func_log10 :public Item_dec_func { public: Item_func_log10(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("log10") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_log10>(thd, this); } }; @@ -1836,13 +1844,13 @@ class Item_func_sqrt :public Item_dec_func { public: Item_func_sqrt(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("sqrt") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sqrt>(thd, this); } }; @@ -1851,13 +1859,13 @@ class Item_func_pow :public Item_dec_func { public: Item_func_pow(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("pow") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_pow>(thd, this); } }; @@ -1866,13 +1874,13 @@ class Item_func_acos :public Item_dec_func { public: Item_func_acos(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("acos") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_acos>(thd, this); } }; @@ -1880,13 +1888,13 @@ class Item_func_asin :public Item_dec_func { public: Item_func_asin(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("asin") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_asin>(thd, this); } }; @@ -1895,13 +1903,13 @@ class Item_func_atan :public Item_dec_func public: Item_func_atan(THD *thd, Item *a): Item_dec_func(thd, a) {} Item_func_atan(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("atan") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_atan>(thd, this); } }; @@ -1909,13 +1917,13 @@ class Item_func_cos :public Item_dec_func { public: Item_func_cos(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("cos") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_cos>(thd, this); } }; @@ -1923,13 +1931,13 @@ class Item_func_sin :public Item_dec_func { public: Item_func_sin(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("sin") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sin>(thd, this); } }; @@ -1937,13 +1945,13 @@ class Item_func_tan :public Item_dec_func { public: Item_func_tan(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("tan") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_tan>(thd, this); } }; @@ -1951,13 +1959,13 @@ class Item_func_cot :public Item_dec_func { public: Item_func_cot(THD *thd, Item *a): Item_dec_func(thd, a) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("cot") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_cot>(thd, this); } }; @@ -1966,8 +1974,8 @@ class Item_func_int_val :public Item_func_hybrid_field_type { public: Item_func_int_val(THD *thd, Item *a): Item_func_hybrid_field_type(thd, a) {} - bool check_partition_func_processor(void *int_arg) { return FALSE; } - bool check_vcol_func_processor(void *arg) { return FALSE; } + bool check_partition_func_processor(void *int_arg) override { return FALSE; } + bool check_vcol_func_processor(void *arg) override { return FALSE; } virtual decimal_round_mode round_mode() const= 0; void fix_length_and_dec_double(); void fix_length_and_dec_int_or_decimal(); @@ -1983,9 +1991,9 @@ public: // Thinks like CEILING(TIMESTAMP'0000-01-01 23:59:59.9') returns NULL set_maybe_null(); } - bool fix_length_and_dec(); - String *str_op(String *str) { DBUG_ASSERT(0); return 0; } - bool native_op(THD *thd, Native *to) + bool fix_length_and_dec() override; + String *str_op(String *str) override { DBUG_ASSERT(0); return 0; } + bool native_op(THD *thd, Native *to) override { DBUG_ASSERT(0); return true; @@ -2002,13 +2010,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("ceiling") }; return name; } - decimal_round_mode round_mode() const { return CEILING; } - longlong int_op(); - double real_op(); - my_decimal *decimal_op(my_decimal *); - bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); - bool time_op(THD *thd, MYSQL_TIME *ltime); - Item *get_copy(THD *thd) + decimal_round_mode round_mode() const override { return CEILING; } + longlong int_op() override; + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; + bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override; + bool time_op(THD *thd, MYSQL_TIME *ltime) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_ceiling>(thd, this); } }; @@ -2022,13 +2030,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("floor") }; return name; } - decimal_round_mode round_mode() const { return FLOOR; } - longlong int_op(); - double real_op(); - my_decimal *decimal_op(my_decimal *); - bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); - bool time_op(THD *thd, MYSQL_TIME *ltime); - Item *get_copy(THD *thd) + decimal_round_mode round_mode() const override { return FLOOR; } + longlong int_op() override; + double real_op() override; + my_decimal *decimal_op(my_decimal *) override; + bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override; + bool time_op(THD *thd, MYSQL_TIME *ltime) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_floor>(thd, this); } }; @@ -2049,17 +2057,17 @@ public: static LEX_CSTRING round_name= {STRING_WITH_LEN("round") }; return truncate ? truncate_name : round_name; } - double real_op(); - longlong int_op(); - my_decimal *decimal_op(my_decimal *); - bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); - bool time_op(THD *thd, MYSQL_TIME *ltime); - bool native_op(THD *thd, Native *to) + double real_op() override; + longlong int_op() override; + my_decimal *decimal_op(my_decimal *) override; + bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override; + bool time_op(THD *thd, MYSQL_TIME *ltime) override; + bool native_op(THD *thd, Native *to) override { DBUG_ASSERT(0); return true; } - String *str_op(String *str) + String *str_op(String *str) override { DBUG_ASSERT(0); return NULL; @@ -2073,7 +2081,7 @@ public: void fix_arg_time(); void fix_arg_datetime(); void fix_arg_temporal(const Type_handler *h, uint int_part_length); - bool fix_length_and_dec() + bool fix_length_and_dec() override { /* We don't want to translate ENUM/SET to CHAR here. @@ -2081,7 +2089,7 @@ public: */ return args[0]->real_type_handler()->Item_func_round_fix_length_and_dec(this); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_round>(thd, this); } }; @@ -2090,36 +2098,36 @@ class Item_func_rand :public Item_real_func { struct my_rnd_struct *rand; bool first_eval; // TRUE if val_real() is called 1st time - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_int(0, arg_count); } void seed_random (Item * val); public: Item_func_rand(THD *thd, Item *a): Item_real_func(thd, a), rand(0), first_eval(TRUE) {} Item_func_rand(THD *thd): Item_real_func(thd) {} - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("rand") }; return name; } - bool const_item() const { return 0; } - void update_used_tables(); - bool fix_fields(THD *thd, Item **ref); - void cleanup() { first_eval= TRUE; Item_real_func::cleanup(); } - bool check_vcol_func_processor(void *arg) + bool const_item() const override { return 0; } + void update_used_tables() override; + bool fix_fields(THD *thd, Item **ref) override; + void cleanup() override { first_eval= TRUE; Item_real_func::cleanup(); } + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_rand>(thd, this); } }; class Item_func_sign :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_real(func_name_cstring()); } public: Item_func_sign(THD *thd, Item *a): Item_long_func(thd, a) {} @@ -2128,10 +2136,10 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("sign") }; return name; } - uint decimal_precision() const { return 1; } - bool fix_length_and_dec() { fix_char_length(2); return FALSE; } - longlong val_int(); - Item *get_copy(THD *thd) + uint decimal_precision() const override { return 1; } + bool fix_length_and_dec() override { fix_char_length(2); return FALSE; } + longlong val_int() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sign>(thd, this); } }; @@ -2140,7 +2148,7 @@ class Item_func_units :public Item_real_func { LEX_CSTRING name; double mul,add; - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_real(0, arg_count); } public: Item_func_units(THD *thd, char *name_arg, Item *a, double mul_arg, @@ -2150,15 +2158,15 @@ public: name.str= name_arg; name.length= strlen(name_arg); } - double val_real(); + double val_real() override; LEX_CSTRING func_name_cstring() const override { return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_units>(thd, this); } }; @@ -2179,7 +2187,7 @@ class Item_func_min_max :public Item_hybrid_func String tmp_value; int cmp_sign; protected: - bool check_arguments() const + bool check_arguments() const override { return false; // Checked by aggregate_for_min_max() } @@ -2195,37 +2203,37 @@ public: bool get_date_native(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate); bool get_time_native(THD *thd, MYSQL_TIME *res); - double val_real() + double val_real() override { DBUG_ASSERT(fixed()); return Item_func_min_max::type_handler()-> Item_func_min_max_val_real(this); } - longlong val_int() + longlong val_int() override { DBUG_ASSERT(fixed()); return Item_func_min_max::type_handler()-> Item_func_min_max_val_int(this); } - String *val_str(String *str) + String *val_str(String *str) override { DBUG_ASSERT(fixed()); return Item_func_min_max::type_handler()-> Item_func_min_max_val_str(this, str); } - my_decimal *val_decimal(my_decimal *dec) + my_decimal *val_decimal(my_decimal *dec) override { DBUG_ASSERT(fixed()); return Item_func_min_max::type_handler()-> Item_func_min_max_val_decimal(this, dec); } - bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override { DBUG_ASSERT(fixed()); return Item_func_min_max::type_handler()-> Item_func_min_max_get_date(thd, this, res, fuzzydate); } - bool val_native(THD *thd, Native *to); + bool val_native(THD *thd, Native *to) override; void aggregate_attributes_real(Item **items, uint nitems) { /* @@ -2246,7 +2254,7 @@ public: Item_func::aggregate_attributes_real(items, nitems); max_length= float_length(decimals); } - bool fix_length_and_dec() + bool fix_length_and_dec() override { if (aggregate_for_min_max(func_name_cstring(), args, arg_count)) return true; @@ -2264,7 +2272,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("least") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_min>(thd, this); } }; @@ -2277,7 +2285,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("greatest") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_max>(thd, this); } }; @@ -2294,39 +2302,41 @@ public: { name= a->name; } - double val_real() { return val_real_from_item(args[0]); } - longlong val_int() { return val_int_from_item(args[0]); } - String *val_str(String *str) { return val_str_from_item(args[0], str); } - bool val_native(THD *thd, Native *to) - { return val_native_from_item(thd, args[0], to); } - my_decimal *val_decimal(my_decimal *dec) + double val_real() override { return val_real_from_item(args[0]); } + longlong val_int() override { return val_int_from_item(args[0]); } + String *val_str(String *str) override + { return val_str_from_item(args[0], str); } + bool val_native(THD *thd, Native *to) override + { return val_native_from_item(thd, args[0], to); } + my_decimal *val_decimal(my_decimal *dec) override { return val_decimal_from_item(args[0], dec); } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return get_date_from_item(thd, args[0], ltime, fuzzydate); } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("rollup_const") }; return name; } - bool const_item() const { return 0; } - const Type_handler *type_handler() const { return args[0]->type_handler(); } - bool fix_length_and_dec() + bool const_item() const override { return 0; } + const Type_handler *type_handler() const override + { return args[0]->type_handler(); } + bool fix_length_and_dec() override { Type_std_attributes::set(*args[0]); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_rollup_const>(thd, this); } }; class Item_long_func_length: public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_str(func_name_cstring()); } public: Item_long_func_length(THD *thd, Item *a): Item_long_func(thd, a) {} - bool fix_length_and_dec() { max_length=10; return FALSE; } + bool fix_length_and_dec() override { max_length=10; return FALSE; } }; @@ -2335,13 +2345,13 @@ class Item_func_octet_length :public Item_long_func_length String value; public: Item_func_octet_length(THD *thd, Item *a): Item_long_func_length(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("octet_length") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_octet_length>(thd, this); } }; @@ -2350,18 +2360,18 @@ class Item_func_bit_length :public Item_longlong_func String value; public: Item_func_bit_length(THD *thd, Item *a): Item_longlong_func(thd, a) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= 11; // 0x100000000*8 = 34,359,738,368 return FALSE; } - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("bit_length") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_bit_length>(thd, this); } }; @@ -2370,47 +2380,48 @@ class Item_func_char_length :public Item_long_func_length String value; public: Item_func_char_length(THD *thd, Item *a): Item_long_func_length(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("char_length") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_char_length>(thd, this); } }; class Item_func_coercibility :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_str(func_name_cstring()); } public: Item_func_coercibility(THD *thd, Item *a): Item_long_func(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("coercibility") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length=10; base_flags&= ~item_base_t::MAYBE_NULL; return FALSE; } - bool eval_not_null_tables(void *) + bool eval_not_null_tables(void *) override { not_null_tables_cache= 0; return false; } - bool find_not_null_fields(table_map allowed) + bool find_not_null_fields(table_map allowed) override { return false; } Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) + override { return this; } - bool const_item() const { return true; } - Item *get_copy(THD *thd) + bool const_item() const override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_coercibility>(thd, this); } }; @@ -2423,7 +2434,7 @@ public: */ class Item_func_locate :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_str(0, 2) || (arg_count > 2 && args[2]->check_type_can_return_int(func_name_cstring())); @@ -2440,14 +2451,14 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("locate") }; return name; } - longlong val_int(); - bool fix_length_and_dec() + longlong val_int() override; + bool fix_length_and_dec() override { max_length= MY_INT32_NUM_DECIMAL_DIGITS; return agg_arg_charsets_for_comparison(cmp_collation, args, 2); } - virtual void print(String *str, enum_query_type query_type); - Item *get_copy(THD *thd) + void print(String *str, enum_query_type query_type) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_locate>(thd, this); } }; @@ -2459,57 +2470,57 @@ class Item_func_field :public Item_long_func DTCollation cmp_collation; public: Item_func_field(THD *thd, List<Item> &list): Item_long_func(thd, list) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("field") }; return name; } - bool fix_length_and_dec(); - Item *get_copy(THD *thd) + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_field>(thd, this); } }; class Item_func_ascii :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_str(0, arg_count); } String value; public: Item_func_ascii(THD *thd, Item *a): Item_long_func(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("ascii") }; return name; } - bool fix_length_and_dec() { max_length=3; return FALSE; } - Item *get_copy(THD *thd) + bool fix_length_and_dec() override { max_length=3; return FALSE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_ascii>(thd, this); } }; class Item_func_ord :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_str(func_name_cstring()); } String value; public: Item_func_ord(THD *thd, Item *a): Item_long_func(thd, a) {} - bool fix_length_and_dec() { fix_char_length(7); return FALSE; } - longlong val_int(); + bool fix_length_and_dec() override { fix_char_length(7); return FALSE; } + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("ord") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_ord>(thd, this); } }; class Item_func_find_in_set :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_str(0, 2); } String value,value2; uint enum_value; @@ -2518,14 +2529,14 @@ class Item_func_find_in_set :public Item_long_func public: Item_func_find_in_set(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b), enum_value(0) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("find_in_set") }; return name; } - bool fix_length_and_dec(); - Item *get_copy(THD *thd) + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_find_in_set>(thd, this); } }; @@ -2533,7 +2544,7 @@ public: class Item_func_bit_operator: public Item_handled_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_int(0, arg_count); } protected: bool fix_length_and_dec_op1_std(const Handler *ha_int, const Handler *ha_dec) @@ -2552,11 +2563,11 @@ public: :Item_handled_func(thd, a) {} Item_func_bit_operator(THD *thd, Item *a, Item *b) :Item_handled_func(thd, a, b) {} - void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) override { print_op(str, query_type); } - bool need_parentheses_in_default() { return true; } + bool need_parentheses_in_default() override { return true; } }; class Item_func_bit_or :public Item_func_bit_operator @@ -2564,14 +2575,14 @@ class Item_func_bit_or :public Item_func_bit_operator public: Item_func_bit_or(THD *thd, Item *a, Item *b) :Item_func_bit_operator(thd, a, b) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("|") }; return name; } - enum precedence precedence() const { return BITOR_PRECEDENCE; } - Item *get_copy(THD *thd) + enum precedence precedence() const override { return BITOR_PRECEDENCE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_bit_or>(thd, this); } }; @@ -2580,20 +2591,20 @@ class Item_func_bit_and :public Item_func_bit_operator public: Item_func_bit_and(THD *thd, Item *a, Item *b) :Item_func_bit_operator(thd, a, b) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("&") }; return name; } - enum precedence precedence() const { return BITAND_PRECEDENCE; } - Item *get_copy(THD *thd) + enum precedence precedence() const override { return BITAND_PRECEDENCE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_bit_and>(thd, this); } }; class Item_func_bit_count :public Item_handled_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_int(func_name_cstring()); } public: Item_func_bit_count(THD *thd, Item *a): Item_handled_func(thd, a) {} @@ -2602,8 +2613,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("bit_count") }; return name; } - bool fix_length_and_dec(); - Item *get_copy(THD *thd) + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_bit_count>(thd, this); } }; @@ -2612,14 +2623,14 @@ class Item_func_shift_left :public Item_func_bit_operator public: Item_func_shift_left(THD *thd, Item *a, Item *b) :Item_func_bit_operator(thd, a, b) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("<<") }; return name; } - enum precedence precedence() const { return SHIFT_PRECEDENCE; } - Item *get_copy(THD *thd) + enum precedence precedence() const override { return SHIFT_PRECEDENCE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_shift_left>(thd, this); } }; @@ -2628,14 +2639,14 @@ class Item_func_shift_right :public Item_func_bit_operator public: Item_func_shift_right(THD *thd, Item *a, Item *b) :Item_func_bit_operator(thd, a, b) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN(">>") }; return name; } - enum precedence precedence() const { return SHIFT_PRECEDENCE; } - Item *get_copy(THD *thd) + enum precedence precedence() const override { return SHIFT_PRECEDENCE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_shift_right>(thd, this); } }; @@ -2643,56 +2654,56 @@ class Item_func_bit_neg :public Item_func_bit_operator { public: Item_func_bit_neg(THD *thd, Item *a): Item_func_bit_operator(thd, a) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("~") }; return name; } - enum precedence precedence() const { return NEG_PRECEDENCE; } - void print(String *str, enum_query_type query_type) + enum precedence precedence() const override { return NEG_PRECEDENCE; } + void print(String *str, enum_query_type query_type) override { str->append(func_name_cstring()); args[0]->print_parenthesised(str, query_type, precedence()); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_bit_neg>(thd, this); } }; class Item_func_last_insert_id :public Item_longlong_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_int(0, arg_count); } public: Item_func_last_insert_id(THD *thd): Item_longlong_func(thd) {} Item_func_last_insert_id(THD *thd, Item *a): Item_longlong_func(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("last_insert_id") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { unsigned_flag= true; if (arg_count) max_length= args[0]->max_length; return FALSE; } - bool fix_fields(THD *thd, Item **ref); - bool check_vcol_func_processor(void *arg) + bool fix_fields(THD *thd, Item **ref) override; + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_last_insert_id>(thd, this); } }; class Item_func_benchmark :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_int(func_name_cstring()) || args[1]->check_type_scalar(func_name_cstring()); @@ -2701,24 +2712,24 @@ public: Item_func_benchmark(THD *thd, Item *count_expr, Item *expr): Item_long_func(thd, count_expr, expr) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("benchmark") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length=1; base_flags&= ~item_base_t::MAYBE_NULL; return FALSE; } - virtual void print(String *str, enum_query_type query_type); - bool check_vcol_func_processor(void *arg) + void print(String *str, enum_query_type query_type) override; + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_benchmark>(thd, this); } }; @@ -2728,28 +2739,28 @@ void item_func_sleep_free(void); class Item_func_sleep :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_can_return_real(func_name_cstring()); } public: Item_func_sleep(THD *thd, Item *a): Item_long_func(thd, a) {} - bool fix_length_and_dec() { fix_char_length(1); return FALSE; } - bool const_item() const { return 0; } + bool fix_length_and_dec() override { fix_char_length(1); return FALSE; } + bool const_item() const override { return 0; } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("sleep") }; return name; } - table_map used_tables() const + table_map used_tables() const override { return used_tables_cache | RAND_TABLE_BIT; } - bool is_expensive() { return 1; } - longlong val_int(); - bool check_vcol_func_processor(void *arg) + bool is_expensive() override { return 1; } + longlong val_int() override; + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sleep>(thd, this); } }; @@ -2770,7 +2781,7 @@ class Item_udf_func :public Item_func } protected: udf_handler udf; - bool is_expensive_processor(void *arg) { return TRUE; } + bool is_expensive_processor(void *arg) override { return TRUE; } class VDec_udf: public Dec_ptr_and_buffer { @@ -2794,8 +2805,8 @@ public: const char *tmp= udf.name(); return { tmp, strlen(tmp) }; } - enum Functype functype() const { return UDF_FUNC; } - bool fix_fields(THD *thd, Item **ref) + enum Functype functype() const override { return UDF_FUNC; } + bool fix_fields(THD *thd, Item **ref) override { DBUG_ASSERT(fixed() == 0); bool res= udf.fix_fields(thd, this, arg_count, args); @@ -2804,7 +2815,7 @@ public: return res; } void fix_num_length_and_dec(); - void update_used_tables() + void update_used_tables() override { /* TODO: Make a member in UDF_INIT and return if a UDF is deterministic or @@ -2853,28 +2864,28 @@ public: set_non_deterministic_if_needed(); } } - void cleanup(); - bool eval_not_null_tables(void *opt_arg) + void cleanup() override; + bool eval_not_null_tables(void *opt_arg) override { not_null_tables_cache= 0; return 0; } - bool find_not_null_fields(table_map allowed) + bool find_not_null_fields(table_map allowed) override { return false; } - bool is_expensive() { return 1; } - virtual void print(String *str, enum_query_type query_type); - bool check_vcol_func_processor(void *arg) + bool is_expensive() override { return 1; } + void print(String *str, enum_query_type query_type) override; + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate); } - bool excl_dep_on_grouping_fields(st_select_lex *sel) + bool excl_dep_on_grouping_fields(st_select_lex *sel) override { return false; } }; @@ -2887,13 +2898,13 @@ class Item_func_udf_float :public Item_udf_func Item_func_udf_float(THD *thd, udf_func *udf_arg, List<Item> &list): Item_udf_func(thd, udf_arg, list) {} - longlong val_int() + longlong val_int() override { DBUG_ASSERT(fixed()); return Converter_double_to_longlong(Item_func_udf_float::val_real(), unsigned_flag).result(); } - my_decimal *val_decimal(my_decimal *dec_buf) + my_decimal *val_decimal(my_decimal *dec_buf) override { double res=val_real(); if (null_value) @@ -2901,11 +2912,12 @@ class Item_func_udf_float :public Item_udf_func double2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf); return dec_buf; } - double val_real(); - String *val_str(String *str); - const Type_handler *type_handler() const { return &type_handler_double; } - bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; } - Item *get_copy(THD *thd) + double val_real() override; + String *val_str(String *str) override; + const Type_handler *type_handler() const override + { return &type_handler_double; } + bool fix_length_and_dec() override { fix_num_length_and_dec(); return FALSE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_udf_float>(thd, this); } }; @@ -2918,21 +2930,21 @@ public: Item_func_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list): Item_udf_func(thd, udf_arg, list) {} - longlong val_int(); - double val_real() { return (double) Item_func_udf_int::val_int(); } - my_decimal *val_decimal(my_decimal *decimal_value) + longlong val_int() override; + double val_real() override { return (double) Item_func_udf_int::val_int(); } + my_decimal *val_decimal(my_decimal *decimal_value) override { return val_decimal_from_int(decimal_value); } - String *val_str(String *str); - const Type_handler *type_handler() const + String *val_str(String *str) override; + const Type_handler *type_handler() const override { if (unsigned_flag) return &type_handler_ulonglong; return &type_handler_slonglong; } - bool fix_length_and_dec() { decimals= 0; max_length= 21; return FALSE; } - Item *get_copy(THD *thd) + bool fix_length_and_dec() override { decimals= 0; max_length= 21; return FALSE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_udf_int>(thd, this); } }; @@ -2944,22 +2956,23 @@ public: Item_udf_func(thd, udf_arg) {} Item_func_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list): Item_udf_func(thd, udf_arg, list) {} - longlong val_int() + longlong val_int() override { return VDec_udf(this, &udf).to_longlong(unsigned_flag); } - double val_real() + double val_real() override { return VDec_udf(this, &udf).to_double(); } - my_decimal *val_decimal(my_decimal *); - String *val_str(String *str) + my_decimal *val_decimal(my_decimal *) override; + String *val_str(String *str) override { return VDec_udf(this, &udf).to_string_round(str, decimals); } - const Type_handler *type_handler() const { return &type_handler_newdecimal; } - bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; } - Item *get_copy(THD *thd) + const Type_handler *type_handler() const override + { return &type_handler_newdecimal; } + bool fix_length_and_dec() override { fix_num_length_and_dec(); return FALSE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_udf_decimal>(thd, this); } }; @@ -2971,8 +2984,8 @@ public: Item_udf_func(thd, udf_arg) {} Item_func_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list): Item_udf_func(thd, udf_arg, list) {} - String *val_str(String *); - double val_real() + String *val_str(String *) override; + double val_real() override { int err_not_used; char *end_not_used; @@ -2981,14 +2994,14 @@ public: return res ? res->charset()->strntod((char*) res->ptr(), res->length(), &end_not_used, &err_not_used) : 0.0; } - longlong val_int() + longlong val_int() override { int err_not_used; String *res; res=val_str(&str_value); return res ? res->charset()->strntoll(res->ptr(),res->length(),10, (char**) 0, &err_not_used) : (longlong) 0; } - my_decimal *val_decimal(my_decimal *dec_buf) + my_decimal *val_decimal(my_decimal *dec_buf) override { String *res=val_str(&str_value); if (!res) @@ -2996,9 +3009,10 @@ public: string2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf); return dec_buf; } - const Type_handler *type_handler() const { return string_type_handler(); } - bool fix_length_and_dec(); - Item *get_copy(THD *thd) + const Type_handler *type_handler() const override + { return string_type_handler(); } + bool fix_length_and_dec() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_udf_str>(thd, this); } }; @@ -3022,7 +3036,8 @@ public: Item_int_func(thd) {} Item_func_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list): Item_int_func(thd, list) {} - const Type_handler *type_handler() const { return &type_handler_slonglong; } + const Type_handler *type_handler() const override + { return &type_handler_slonglong; } longlong val_int() { DBUG_ASSERT(fixed()); return 0; } }; @@ -3034,7 +3049,8 @@ public: Item_int_func(thd) {} Item_func_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list): Item_int_func(thd, list) {} - const Type_handler *type_handler() const { return &type_handler_slonglong; } + const Type_handler *type_handler() const override + { return &type_handler_slonglong; } my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed()); return 0; } }; @@ -3066,13 +3082,13 @@ class Item_func_lock :public Item_long_func Item_func_lock(THD *thd): Item_long_func(thd) { } Item_func_lock(THD *thd, Item *a): Item_long_func(thd, a) {} Item_func_lock(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {} - table_map used_tables() const + table_map used_tables() const override { return used_tables_cache | RAND_TABLE_BIT; } - bool const_item() const { return 0; } - bool is_expensive() { return 1; } - bool check_vcol_func_processor(void *arg) + bool const_item() const override { return 0; } + bool is_expensive() override { return 1; } + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } @@ -3081,7 +3097,7 @@ class Item_func_lock :public Item_long_func class Item_func_get_lock final :public Item_func_lock { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_general_purpose_string(func_name_cstring()) || args[1]->check_type_can_return_real(func_name_cstring()); @@ -3095,7 +3111,7 @@ class Item_func_get_lock final :public Item_func_lock static LEX_CSTRING name= {STRING_WITH_LEN("get_lock") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= 1; set_maybe_null(); @@ -3124,7 +3140,7 @@ public: class Item_func_release_lock final :public Item_func_lock { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_general_purpose_string(func_name_cstring()); } String value; public: @@ -3135,7 +3151,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("release_lock") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= 1; set_maybe_null(); @@ -3150,7 +3166,7 @@ public: class Item_master_pos_wait :public Item_longlong_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_general_purpose_string(func_name_cstring()) || @@ -3166,30 +3182,30 @@ public: Item_longlong_func(thd, a, b, c) {} Item_master_pos_wait(THD *thd, Item *a, Item *b, Item *c, Item *d): Item_longlong_func(thd, a, b, c, d) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("master_pos_wait") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length=21; set_maybe_null(); return FALSE; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_master_pos_wait>(thd, this); } }; class Item_master_gtid_wait :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_general_purpose_string(func_name_cstring()) || (arg_count > 1 && args[1]->check_type_can_return_real(func_name_cstring())); @@ -3200,18 +3216,18 @@ public: :Item_long_func(thd, a) {} Item_master_gtid_wait(THD *thd, Item *a, Item *b) :Item_long_func(thd, a, b) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("master_gtid_wait") }; return name; } - bool fix_length_and_dec() { max_length=2; return FALSE; } - bool check_vcol_func_processor(void *arg) + bool fix_length_and_dec() override { max_length=2; return FALSE; } + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_master_gtid_wait>(thd, this); } }; @@ -3290,28 +3306,28 @@ public: null_item(item->null_item), save_result(item->save_result) {} - enum Functype functype() const { return SUSERVAR_FUNC; } - double val_real(); - longlong val_int(); - String *val_str(String *str); - my_decimal *val_decimal(my_decimal *); - double val_result(); - longlong val_int_result(); - bool val_bool_result(); - String *str_result(String *str); - my_decimal *val_decimal_result(my_decimal *); - bool is_null_result(); + enum Functype functype() const override { return SUSERVAR_FUNC; } + double val_real() override; + longlong val_int() override; + String *val_str(String *str) override; + my_decimal *val_decimal(my_decimal *) override; + double val_result() override; + longlong val_int_result() override; + bool val_bool_result() override; + String *str_result(String *str) override; + my_decimal *val_decimal_result(my_decimal *) override; + bool is_null_result() override; bool update_hash(void *ptr, size_t length, enum Item_result type, CHARSET_INFO *cs, bool unsigned_arg); - bool send(Protocol *protocol, st_value *buffer); - void make_send_field(THD *thd, Send_field *tmp_field); + bool send(Protocol *protocol, st_value *buffer) override; + void make_send_field(THD *thd, Send_field *tmp_field) override; bool check(bool use_result_field); void save_item_result(Item *item); bool update(); - bool fix_fields(THD *thd, Item **ref); - bool fix_length_and_dec(); - void print(String *str, enum_query_type query_type); - enum precedence precedence() const { return ASSIGN_PRECEDENCE; } + bool fix_fields(THD *thd, Item **ref) override; + bool fix_length_and_dec() override; + void print(String *str, enum_query_type query_type) override; + enum precedence precedence() const override { return ASSIGN_PRECEDENCE; } void print_as_stmt(String *str, enum_query_type query_type); LEX_CSTRING func_name_cstring() const override { @@ -3320,20 +3336,21 @@ public: } int save_in_field(Field *field, bool no_conversions, bool can_use_result_field); - int save_in_field(Field *field, bool no_conversions) + int save_in_field(Field *field, bool no_conversions) override { return save_in_field(field, no_conversions, 1); } void save_org_in_field(Field *field, fast_field_copier data __attribute__ ((__unused__))) - { (void)save_in_field(field, 1, 0); } - bool register_field_in_read_map(void *arg); - bool register_field_in_bitmap(void *arg); + override + { (void) save_in_field(field, 1, 0); } + bool register_field_in_read_map(void *arg) override; + bool register_field_in_bitmap(void *arg) override; bool set_entry(THD *thd, bool create_if_not_exists); - void cleanup(); - Item *get_copy(THD *thd) + void cleanup() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_set_user_var>(thd, this); } - bool excl_dep_on_table(table_map tab_map) { return false; } + bool excl_dep_on_table(table_map tab_map) override { return false; } }; @@ -3343,14 +3360,14 @@ class Item_func_get_user_var :public Item_func_user_var, public: Item_func_get_user_var(THD *thd, const LEX_CSTRING *a): Item_func_user_var(thd, a) {} - enum Functype functype() const { return GUSERVAR_FUNC; } + enum Functype functype() const override { return GUSERVAR_FUNC; } LEX_CSTRING get_name() { return name; } - double val_real(); - longlong val_int(); - my_decimal *val_decimal(my_decimal*); - String *val_str(String* str); - bool fix_length_and_dec(); - virtual void print(String *str, enum_query_type query_type); + double val_real() override; + longlong val_int() override; + my_decimal *val_decimal(my_decimal*) override; + String *val_str(String* str) override; + bool fix_length_and_dec() override; + void print(String *str, enum_query_type query_type) override; /* We must always return variables as strings to guard against selects of type select @t1:=1,@t1,@t:="hello",@t from foo where (@t1:= t2.b) @@ -3360,17 +3377,17 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("get_user_var") }; return name; } - bool const_item() const; - table_map used_tables() const + bool const_item() const override; + table_map used_tables() const override { return const_item() ? 0 : RAND_TABLE_BIT; } - bool eq(const Item *item, bool binary_cmp) const; - Item *get_copy(THD *thd) + bool eq(const Item *item, bool binary_cmp) const override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_get_user_var>(thd, this); } private: - bool set_value(THD *thd, sp_rcontext *ctx, Item **it); + bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override; public: - Settable_routine_parameter *get_settable_routine_parameter() + Settable_routine_parameter *get_settable_routine_parameter() override { return this; } @@ -3399,54 +3416,55 @@ public: org_name= *a; set_name(thd, a->str, a->length, system_charset_info); } - Load_data_outvar *get_load_data_outvar() + Load_data_outvar *get_load_data_outvar() override { return this; } - bool load_data_set_null(THD *thd, const Load_data_param *param) + bool load_data_set_null(THD *thd, const Load_data_param *param) override { set_null_value(param->charset()); return false; } - bool load_data_set_no_data(THD *thd, const Load_data_param *param) + bool load_data_set_no_data(THD *thd, const Load_data_param *param) override { set_null_value(param->charset()); return false; } bool load_data_set_value(THD *thd, const char *pos, uint length, - const Load_data_param *param) + const Load_data_param *param) override { set_value(pos, length, param->charset()); return false; } - void load_data_print_for_log_event(THD *thd, String *to) const; - bool load_data_add_outvar(THD *thd, Load_data_param *param) const + void load_data_print_for_log_event(THD *thd, String *to) const override; + bool load_data_add_outvar(THD *thd, Load_data_param *param) const override { return param->add_outvar_user_var(thd); } - uint load_data_fixed_length() const + uint load_data_fixed_length() const override { return 0; } Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, - const Tmp_field_param *param) + const Tmp_field_param *param) override { DBUG_ASSERT(0); return NULL; } /* We should return something different from FIELD_ITEM here */ - enum Type type() const { return CONST_ITEM;} - double val_real(); - longlong val_int(); - String *val_str(String *str); - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); - my_decimal *val_decimal(my_decimal *decimal_buffer); + enum Type type() const override { return CONST_ITEM;} + double val_real() override; + longlong val_int() override; + String *val_str(String *str) override; + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override; + my_decimal *val_decimal(my_decimal *decimal_buffer) override; /* fix_fields() binds variable name with its entry structure */ - bool fix_fields(THD *thd, Item **ref); + bool fix_fields(THD *thd, Item **ref) override; void set_null_value(CHARSET_INFO* cs); void set_value(const char *str, uint length, CHARSET_INFO* cs); - const Type_handler *type_handler() const { return &type_handler_double; } - Item *get_copy(THD *thd) + const Type_handler *type_handler() const override + { return &type_handler_double; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_user_var_as_out_param>(thd, this); } }; @@ -3474,19 +3492,19 @@ public: enum_var_type var_type_arg, LEX_CSTRING *component_arg, const char *name_arg, size_t name_len_arg); - enum Functype functype() const { return GSYSVAR_FUNC; } - void update_null_value(); - bool fix_length_and_dec(); - void print(String *str, enum_query_type query_type); - bool const_item() const { return true; } - table_map used_tables() const { return 0; } - const Type_handler *type_handler() const; - double val_real(); - longlong val_int(); - String* val_str(String*); - my_decimal *val_decimal(my_decimal *dec_buf) + enum Functype functype() const override { return GSYSVAR_FUNC; } + void update_null_value() override; + bool fix_length_and_dec() override; + void print(String *str, enum_query_type query_type) override; + bool const_item() const override { return true; } + table_map used_tables() const override { return 0; } + const Type_handler *type_handler() const override; + double val_real() override; + longlong val_int() override; + String* val_str(String*) override; + my_decimal *val_decimal(my_decimal *dec_buf) override { return val_decimal_from_real(dec_buf); } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate); } @@ -3505,11 +3523,11 @@ public: @return true if the variable is written to the binlog, false otherwise. */ bool is_written_to_binlog(); - bool eq(const Item *item, bool binary_cmp) const; + bool eq(const Item *item, bool binary_cmp) const override; - void cleanup(); - bool check_vcol_func_processor(void *arg); - Item *get_copy(THD *thd) + void cleanup() override; + bool check_vcol_func_processor(void *arg) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_get_system_var>(thd, this); } }; @@ -3532,7 +3550,7 @@ public: Item_func_match(THD *thd, List<Item> &a, uint b): Item_real_func(thd, a), key(0), match_flags(b), join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { } - void cleanup() + void cleanup() override { DBUG_ENTER("Item_func_match::cleanup"); Item_real_func::cleanup(); @@ -3543,38 +3561,38 @@ public: table= 0; // required by Item_func_match::eq() DBUG_VOID_RETURN; } - bool is_expensive_processor(void *arg) { return TRUE; } - enum Functype functype() const { return FT_FUNC; } + bool is_expensive_processor(void *arg) override { return TRUE; } + enum Functype functype() const override { return FT_FUNC; } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("match") }; return name; } - bool eval_not_null_tables(void *opt_arg) + bool eval_not_null_tables(void *opt_arg) override { not_null_tables_cache= 0; return 0; } - bool find_not_null_fields(table_map allowed) + bool find_not_null_fields(table_map allowed) override { return false; } - bool fix_fields(THD *thd, Item **ref); - bool eq(const Item *, bool binary_cmp) const; + bool fix_fields(THD *thd, Item **ref) override; + bool eq(const Item *, bool binary_cmp) const override; /* The following should be safe, even if we compare doubles */ - longlong val_int() { DBUG_ASSERT(fixed()); return val_real() != 0.0; } - double val_real(); + longlong val_int() override { DBUG_ASSERT(fixed()); return val_real() != 0.0; } + double val_real() override; void print(String *str, enum_query_type query_type) override; bool fix_index(); bool init_search(THD *thd, bool no_order); - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function("match ... against()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_match>(thd, this); } - Item *build_clone(THD *thd) { return 0; } + Item *build_clone(THD *thd) override { return 0; } private: /** Check whether storage engine for given table, @@ -3617,69 +3635,69 @@ class Item_func_bit_xor : public Item_func_bit_operator public: Item_func_bit_xor(THD *thd, Item *a, Item *b) :Item_func_bit_operator(thd, a, b) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("^") }; return name; } - enum precedence precedence() const { return BITXOR_PRECEDENCE; } - Item *get_copy(THD *thd) + enum precedence precedence() const override { return BITXOR_PRECEDENCE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_bit_xor>(thd, this); } }; class Item_func_is_free_lock :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_general_purpose_string(func_name_cstring()); } String value; public: Item_func_is_free_lock(THD *thd, Item *a): Item_long_func(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("is_free_lock") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals=0; max_length=1; set_maybe_null(); return FALSE; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_is_free_lock>(thd, this); } }; class Item_func_is_used_lock :public Item_long_func { - bool check_arguments() const + bool check_arguments() const override { return args[0]->check_type_general_purpose_string(func_name_cstring()); } String value; public: Item_func_is_used_lock(THD *thd, Item *a): Item_long_func(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("is_used_lock") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals=0; max_length=10; set_maybe_null(); return FALSE; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_is_used_lock>(thd, this); } }; @@ -3724,23 +3742,23 @@ class Item_func_row_count :public Item_longlong_func { public: Item_func_row_count(THD *thd): Item_longlong_func(thd) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("row_count") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= 0; base_flags&= ~item_base_t::MAYBE_NULL; return FALSE; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_row_count>(thd, this); } }; @@ -3760,10 +3778,10 @@ private: bool execute(); protected: - bool is_expensive_processor(void *arg) + bool is_expensive_processor(void *arg) override { return is_expensive(); } - bool check_arguments() const + bool check_arguments() const override { // sp_prepare_func_item() checks that the number of columns is correct return false; @@ -3779,53 +3797,53 @@ public: virtual ~Item_func_sp() {} - void update_used_tables(); + void update_used_tables() override; - void cleanup(); + void cleanup() override; LEX_CSTRING func_name_cstring() const override; - const Type_handler *type_handler() const; + const Type_handler *type_handler() const override; Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, - const Tmp_field_param *param); - Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) + const Tmp_field_param *param) override; + Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override { return result_type() != STRING_RESULT ? sp_result_field : create_table_field_from_handler(root, table); } - void make_send_field(THD *thd, Send_field *tmp_field); + void make_send_field(THD *thd, Send_field *tmp_field) override; - longlong val_int() + longlong val_int() override { if (execute()) return (longlong) 0; return sp_result_field->val_int(); } - double val_real() + double val_real() override { if (execute()) return 0.0; return sp_result_field->val_real(); } - my_decimal *val_decimal(my_decimal *dec_buf) + my_decimal *val_decimal(my_decimal *dec_buf) override { if (execute()) return NULL; return sp_result_field->val_decimal(dec_buf); } - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { if (execute()) return true; return sp_result_field->get_date(ltime, fuzzydate); } - String *val_str(String *str) + String *val_str(String *str) override { String buf; char buff[20]; @@ -3844,26 +3862,26 @@ public: return str; } - bool val_native(THD *thd, Native *to) + bool val_native(THD *thd, Native *to) override { if (execute()) return true; return (null_value= sp_result_field->val_native(to)); } - void update_null_value() + void update_null_value() override { execute(); } - virtual bool change_context_processor(void *cntx) - { context= (Name_resolution_context *)cntx; return FALSE; } + bool change_context_processor(void *cntx) override + { context= (Name_resolution_context *)cntx; return FALSE; } - virtual enum Functype functype() const { return FUNC_SP; } + enum Functype functype() const override { return FUNC_SP; } - bool fix_fields(THD *thd, Item **ref); - bool fix_length_and_dec(void); - bool is_expensive(); + bool fix_fields(THD *thd, Item **ref) override; + bool fix_length_and_dec(void) override; + bool is_expensive() override; inline Field *get_sp_result_field() { @@ -3874,20 +3892,20 @@ public: return m_name; } - bool check_vcol_func_processor(void *arg); - bool limit_index_condition_pushdown_processor(void *opt_arg) + bool check_vcol_func_processor(void *arg) override; + bool limit_index_condition_pushdown_processor(void *opt_arg) override { return TRUE; } - Item *get_copy(THD *) { return 0; } - bool eval_not_null_tables(void *opt_arg) + Item *get_copy(THD *) override { return 0; } + bool eval_not_null_tables(void *opt_arg) override { not_null_tables_cache= 0; return 0; } - bool excl_dep_on_grouping_fields(st_select_lex *sel) + bool excl_dep_on_grouping_fields(st_select_lex *sel) override { return false; } - bool find_not_null_fields(table_map allowed) + bool find_not_null_fields(table_map allowed) override { return false; } @@ -3898,23 +3916,23 @@ class Item_func_found_rows :public Item_longlong_func { public: Item_func_found_rows(THD *thd): Item_longlong_func(thd) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("found_rows") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= 0; base_flags&= ~item_base_t::MAYBE_NULL; return FALSE; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_found_rows>(thd, this); } }; @@ -3923,21 +3941,21 @@ class Item_func_oracle_sql_rowcount :public Item_longlong_func { public: Item_func_oracle_sql_rowcount(THD *thd): Item_longlong_func(thd) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("SQL%ROWCOUNT") }; return name; } - void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) override { str->append(func_name_cstring()); } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_oracle_sql_rowcount>(thd, this); } }; @@ -3946,28 +3964,28 @@ class Item_func_sqlcode: public Item_long_func { public: Item_func_sqlcode(THD *thd): Item_long_func(thd) { } - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("SQLCODE") }; return name; } - void print(String *str, enum_query_type query_type) + void print(String *str, enum_query_type query_type) override { str->append(func_name_cstring()); } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); } - bool fix_length_and_dec() + bool fix_length_and_dec() override { base_flags&= ~item_base_t::MAYBE_NULL; null_value= false; max_length= 11; return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sqlcode>(thd, this); } }; @@ -3983,17 +4001,17 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("uuid_short") }; return name; } - longlong val_int(); - bool const_item() const { return false; } - bool fix_length_and_dec() + longlong val_int() override; + bool const_item() const override { return false; } + bool fix_length_and_dec() override { max_length= 21; unsigned_flag=1; return FALSE; } - table_map used_tables() const { return RAND_TABLE_BIT; } - bool check_vcol_func_processor(void *arg) + table_map used_tables() const override { return RAND_TABLE_BIT; } + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_uuid_short>(thd, this); } }; @@ -4004,36 +4022,37 @@ protected: Item *last_value; public: Item_func_last_value(THD *thd, List<Item> &list): Item_func(thd, list) {} - double val_real(); - longlong val_int(); - String *val_str(String *); - my_decimal *val_decimal(my_decimal *); - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); - bool val_native(THD *thd, Native *); - bool fix_length_and_dec(); + double val_real() override; + longlong val_int() override; + String *val_str(String *) override; + my_decimal *val_decimal(my_decimal *) override; + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override; + bool val_native(THD *thd, Native *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("last_value") }; return name; } - const Type_handler *type_handler() const { return last_value->type_handler(); } - bool eval_not_null_tables(void *) + const Type_handler *type_handler() const override + { return last_value->type_handler(); } + bool eval_not_null_tables(void *) override { not_null_tables_cache= 0; return 0; } - bool find_not_null_fields(table_map allowed) + bool find_not_null_fields(table_map allowed) override { return false; } - bool const_item() const { return 0; } + bool const_item() const override { return 0; } void evaluate_sideeffects(); - void update_used_tables() + void update_used_tables() override { Item_func::update_used_tables(); copy_flags(last_value, item_base_t::MAYBE_NULL); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_last_value>(thd, this); } }; @@ -4048,13 +4067,13 @@ protected: public: Item_func_nextval(THD *thd, TABLE_LIST *table_list_arg): Item_longlong_func(thd), table_list(table_list_arg) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("nextval") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { unsigned_flag= 0; max_length= MAX_BIGINT_WIDTH; @@ -4077,11 +4096,11 @@ public: table= table_list->next_local->table; } } - bool const_item() const { return 0; } - Item *get_copy(THD *thd) + bool const_item() const override { return 0; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_nextval>(thd, this); } - void print(String *str, enum_query_type query_type); - bool check_vcol_func_processor(void *arg) + void print(String *str, enum_query_type query_type) override; + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), "()", arg, (VCOL_NON_DETERMINISTIC | @@ -4097,13 +4116,13 @@ class Item_func_lastval :public Item_func_nextval public: Item_func_lastval(THD *thd, TABLE_LIST *table_list_arg): Item_func_nextval(thd, table_list_arg) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("lastval") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_lastval>(thd, this); } }; @@ -4121,14 +4140,14 @@ public: : Item_func_nextval(thd, table_list_arg), nextval(nextval_arg), round(round_arg), is_used(is_used_arg) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("setval") }; return name; } - void print(String *str, enum_query_type query_type); - Item *get_copy(THD *thd) + void print(String *str, enum_query_type query_type) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_setval>(thd, this); } }; |