diff options
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 615 |
1 files changed, 313 insertions, 302 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index bc77edfd095..84d2c07e119 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -64,14 +64,15 @@ public: Item_func(thd, a, b, c, d, e) { decimals=NOT_FIXED_DEC; } Item_str_func(THD *thd, List<Item> &list): Item_func(thd, list) { decimals=NOT_FIXED_DEC; } - longlong val_int(); - double val_real(); - my_decimal *val_decimal(my_decimal *); - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) + longlong val_int() override; + double val_real() override; + my_decimal *val_decimal(my_decimal *) override; + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override { return get_date_from_string(thd, ltime, fuzzydate); } - const Type_handler *type_handler() const { return string_type_handler(); } + const Type_handler *type_handler() const override + { return string_type_handler(); } void left_right_max_length(); - bool fix_fields(THD *thd, Item **ref); + bool fix_fields(THD *thd, Item **ref) override; }; @@ -88,11 +89,11 @@ public: Item_str_ascii_func(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} Item_str_ascii_func(THD *thd, Item *a, Item *b, Item *c): Item_str_func(thd, a, b, c) {} - String *val_str(String *str) + String *val_str(String *str) override { return val_str_from_val_str_ascii(str, &ascii_buf); } - String *val_str_ascii(String *)= 0; + String *val_str_ascii(String *) override= 0; }; @@ -143,8 +144,8 @@ class Item_func_md5 :public Item_str_ascii_checksum_func { public: Item_func_md5(THD *thd, Item *a): Item_str_ascii_checksum_func(thd, a) {} - String *val_str_ascii(String *); - bool fix_length_and_dec() + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override { fix_length_and_charset(32, default_charset()); return FALSE; @@ -154,7 +155,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("md5") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_md5>(thd, this); } }; @@ -163,14 +164,14 @@ class Item_func_sha :public Item_str_ascii_checksum_func { public: Item_func_sha(THD *thd, Item *a): Item_str_ascii_checksum_func(thd, a) {} - String *val_str_ascii(String *); - bool fix_length_and_dec(); + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("sha") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sha>(thd, this); } }; @@ -179,14 +180,14 @@ class Item_func_sha2 :public Item_str_ascii_checksum_func public: Item_func_sha2(THD *thd, Item *a, Item *b) :Item_str_ascii_checksum_func(thd, a, b) {} - String *val_str_ascii(String *); - bool fix_length_and_dec(); + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("sha2") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sha2>(thd, this); } }; @@ -196,14 +197,14 @@ class Item_func_to_base64 :public Item_str_ascii_checksum_func public: Item_func_to_base64(THD *thd, Item *a) :Item_str_ascii_checksum_func(thd, a) {} - String *val_str_ascii(String *); - bool fix_length_and_dec(); + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("to_base64") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_to_base64>(thd, this); } }; @@ -213,14 +214,14 @@ class Item_func_from_base64 :public Item_str_binary_checksum_func public: Item_func_from_base64(THD *thd, Item *a) :Item_str_binary_checksum_func(thd, a) { } - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("from_base64") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_from_base64>(thd, this); } }; @@ -245,13 +246,13 @@ class Item_func_aes_encrypt :public Item_aes_crypt public: Item_func_aes_encrypt(THD *thd, Item *a, Item *b) :Item_aes_crypt(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("aes_encrypt") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_aes_encrypt>(thd, this); } }; @@ -260,13 +261,13 @@ class Item_func_aes_decrypt :public Item_aes_crypt public: Item_func_aes_decrypt(THD *thd, Item *a, Item *b): Item_aes_crypt(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("aes_decrypt") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_aes_decrypt>(thd, this); } }; @@ -287,14 +288,14 @@ protected: public: Item_func_concat(THD *thd, List<Item> &list): Item_str_func(thd, list) {} Item_func_concat(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("concat") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_concat>(thd, this); } }; @@ -312,13 +313,13 @@ public: Item_func_concat_operator_oracle(THD *thd, Item *a, Item *b) :Item_func_concat(thd, a, b) { } - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("concat_operator_oracle") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_concat_operator_oracle>(thd, this); } @@ -330,8 +331,8 @@ class Item_func_decode_histogram :public Item_str_func public: Item_func_decode_histogram(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { collation.set(system_charset_info); max_length= MAX_BLOB_WIDTH; @@ -343,7 +344,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("decode_histogram") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_decode_histogram>(thd, this); } }; @@ -352,15 +353,15 @@ class Item_func_concat_ws :public Item_str_func String tmp_value; public: Item_func_concat_ws(THD *thd, List<Item> &list): Item_str_func(thd, list) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("concat_ws") }; return name; } - table_map not_null_tables() const { return 0; } - Item *get_copy(THD *thd) + table_map not_null_tables() const override { return 0; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_concat_ws>(thd, this); } }; @@ -369,14 +370,14 @@ class Item_func_reverse :public Item_str_func String tmp_value; public: Item_func_reverse(THD *thd, Item *a): Item_str_func(thd, a) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("reverse") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_reverse>(thd, this); } }; @@ -387,15 +388,15 @@ class Item_func_replace :public Item_str_func public: Item_func_replace(THD *thd, Item *org, Item *find, Item *replace): Item_str_func(thd, org, find, replace) {} - String *val_str(String *to) { return val_str_internal(to, NULL); }; - bool fix_length_and_dec(); + String *val_str(String *to) override { return val_str_internal(to, NULL); }; + bool fix_length_and_dec() override; String *val_str_internal(String *str, String *empty_string_for_null); LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("replace") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_replace>(thd, this); } }; @@ -406,13 +407,14 @@ class Item_func_replace_oracle :public Item_func_replace public: Item_func_replace_oracle(THD *thd, Item *org, Item *find, Item *replace): Item_func_replace(thd, org, find, replace) {} - String *val_str(String *to) { return val_str_internal(to, &tmp_emtpystr); }; + String *val_str(String *to) override + { return val_str_internal(to, &tmp_emtpystr); }; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("replace_oracle") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_replace_oracle>(thd, this); } }; @@ -427,21 +429,21 @@ public: Item_func_regexp_replace(THD *thd, Item *a, Item *b, Item *c): Item_str_func(thd, a, b, c) {} - void cleanup() + void cleanup() override { DBUG_ENTER("Item_func_regexp_replace::cleanup"); Item_str_func::cleanup(); re.cleanup(); DBUG_VOID_RETURN; } - String *val_str(String *str); - bool fix_length_and_dec(); + String *val_str(String *str) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("regexp_replace") }; return name; } - Item *get_copy(THD *thd) { return 0;} + Item *get_copy(THD *thd) override { return 0;} }; @@ -452,21 +454,21 @@ public: Item_func_regexp_substr(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} - void cleanup() + void cleanup() override { DBUG_ENTER("Item_func_regexp_substr::cleanup"); Item_str_func::cleanup(); re.cleanup(); DBUG_VOID_RETURN; } - String *val_str(String *str); - bool fix_length_and_dec(); + String *val_str(String *str) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("regexp_substr") }; return name; } - Item *get_copy(THD *thd) { return 0; } + Item *get_copy(THD *thd) override { return 0; } }; @@ -477,14 +479,14 @@ public: Item_func_insert(THD *thd, Item *org, Item *start, Item *length, Item *new_str): Item_str_func(thd, org, start, length, new_str) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("insert") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_insert>(thd, this); } }; @@ -497,7 +499,7 @@ protected: String tmp_value; public: Item_str_conv(THD *thd, Item *item): Item_str_func(thd, item) {} - String *val_str(String *); + String *val_str(String *) override; }; @@ -510,8 +512,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("lcase") }; 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_lcase>(thd, this); } }; @@ -524,8 +526,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("ucase") }; 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_ucase>(thd, this); } }; @@ -535,14 +537,14 @@ class Item_func_left :public Item_str_func String tmp_value; public: Item_func_left(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("left") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_left>(thd, this); } }; @@ -552,14 +554,14 @@ class Item_func_right :public Item_str_func String tmp_value; public: Item_func_right(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("right") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_right>(thd, this); } }; @@ -573,30 +575,30 @@ public: Item_func_substr(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} Item_func_substr(THD *thd, Item *a, Item *b, Item *c): Item_str_func(thd, a, b, c) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("substr") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_substr>(thd, this); } }; class Item_func_substr_oracle :public Item_func_substr { protected: - longlong get_position() + longlong get_position() override { longlong pos= args[1]->val_int(); return pos == 0 ? 1 : pos; } - String *make_empty_result() + String *make_empty_result() override { null_value= 1; return NULL; } public: Item_func_substr_oracle(THD *thd, Item *a, Item *b): Item_func_substr(thd, a, b) {} Item_func_substr_oracle(THD *thd, Item *a, Item *b, Item *c): Item_func_substr(thd, a, b, c) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { bool res= Item_func_substr::fix_length_and_dec(); set_maybe_null(); @@ -607,7 +609,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("substr_oracle") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_substr_oracle>(thd, this); } }; @@ -617,14 +619,14 @@ class Item_func_substr_index :public Item_str_func public: Item_func_substr_index(THD *thd, Item *a,Item *b,Item *c): Item_str_func(thd, a, b, c) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("substring_index") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_substr_index>(thd, this); } }; @@ -661,17 +663,17 @@ protected: public: Item_func_trim(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {} Item_func_trim(THD *thd, Item *a): Item_str_func(thd, a) {} - Sql_mode_dependency value_depends_on_sql_mode() const; - String *val_str(String *); - bool fix_length_and_dec(); + Sql_mode_dependency value_depends_on_sql_mode() const override; + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("trim") }; return name; } - void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type) override; virtual LEX_CSTRING mode_name() const { return { "both", 4}; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_trim>(thd, this); } }; @@ -679,7 +681,7 @@ public: class Item_func_trim_oracle :public Item_func_trim { protected: - String *make_empty_result() + String *make_empty_result() override { null_value= 1; return NULL; } LEX_CSTRING func_name_ext() const override { @@ -695,13 +697,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("trim_oracle") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { bool res= Item_func_trim::fix_length_and_dec(); set_maybe_null(); return res; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_trim_oracle>(thd, this); } }; @@ -711,11 +713,11 @@ class Item_func_ltrim :public Item_func_trim public: Item_func_ltrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {} Item_func_ltrim(THD *thd, Item *a): Item_func_trim(thd, a) {} - Sql_mode_dependency value_depends_on_sql_mode() const + Sql_mode_dependency value_depends_on_sql_mode() const override { return Item_func::value_depends_on_sql_mode(); } - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("ltrim") }; @@ -723,7 +725,7 @@ public: } LEX_CSTRING mode_name() const override { return { STRING_WITH_LEN("leading") }; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_ltrim>(thd, this); } }; @@ -731,7 +733,7 @@ public: class Item_func_ltrim_oracle :public Item_func_ltrim { protected: - String *make_empty_result() + String *make_empty_result() override { null_value= 1; return NULL; } LEX_CSTRING func_name_ext() const override { @@ -747,13 +749,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("ltrim_oracle") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { bool res= Item_func_ltrim::fix_length_and_dec(); set_maybe_null(); return res; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_ltrim_oracle>(thd, this); } }; @@ -763,7 +765,7 @@ class Item_func_rtrim :public Item_func_trim public: Item_func_rtrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {} Item_func_rtrim(THD *thd, Item *a): Item_func_trim(thd, a) {} - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("rtrim") }; @@ -771,7 +773,7 @@ public: } LEX_CSTRING mode_name() const override { return { STRING_WITH_LEN("trailing") }; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_rtrim>(thd, this); } }; @@ -779,7 +781,7 @@ public: class Item_func_rtrim_oracle :public Item_func_rtrim { protected: - String *make_empty_result() + String *make_empty_result() override { null_value= 1; return NULL; } LEX_CSTRING func_name_ext() const override { @@ -795,13 +797,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("rtrim_oracle") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { bool res= Item_func_rtrim::fix_length_and_dec(); set_maybe_null(); return res; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_rtrim_oracle>(thd, this); } }; @@ -826,9 +828,9 @@ public: Item_str_ascii_checksum_func(thd, a), alg(NEW), deflt(1) {} Item_func_password(THD *thd, Item *a, PW_Alg al): Item_str_ascii_checksum_func(thd, a), alg(al), deflt(0) {} - String *val_str_ascii(String *str); - bool fix_fields(THD *thd, Item **ref); - bool fix_length_and_dec() + String *val_str_ascii(String *str) override; + bool fix_fields(THD *thd, Item **ref) override; + bool fix_length_and_dec() override { fix_length_and_charset((alg == 1 ? SCRAMBLED_PASSWORD_CHAR_LENGTH : @@ -844,7 +846,7 @@ public: } static char *alloc(THD *thd, const char *password, size_t pass_len, enum PW_Alg al); - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_password>(thd, this); } }; @@ -858,8 +860,8 @@ public: :Item_str_binary_checksum_func(thd, a) {} Item_func_des_encrypt(THD *thd, Item *a, Item *b) :Item_str_binary_checksum_func(thd, a, b) {} - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { set_maybe_null(); /* 9 = MAX ((8- (arg_len % 8)) + 1) */ @@ -871,7 +873,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("des_encrypt") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_des_encrypt>(thd, this); } }; @@ -883,8 +885,8 @@ public: :Item_str_binary_checksum_func(thd, a) {} Item_func_des_decrypt(THD *thd, Item *a, Item *b) :Item_str_binary_checksum_func(thd, a, b) {} - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { set_maybe_null(); /* 9 = MAX ((8- (arg_len % 8)) + 1) */ @@ -898,7 +900,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("des_decrypt") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_des_decrypt>(thd, this); } }; @@ -927,8 +929,8 @@ public: { constructor_helper(); } - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { set_maybe_null(); max_length = 13; @@ -939,11 +941,11 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("encrypt") }; return name; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_encrypt>(thd, this); } }; @@ -960,14 +962,14 @@ protected: public: Item_func_encode(THD *thd, Item *a, Item *seed_arg): Item_str_binary_checksum_func(thd, a, seed_arg) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("encode") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_encode>(thd, this); } protected: virtual void crypto_transform(String *); @@ -986,10 +988,10 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("decode") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_decode>(thd, this); } protected: - void crypto_transform(String *); + void crypto_transform(String *) override; }; @@ -1018,8 +1020,8 @@ class Item_func_database :public Item_func_sysconst { public: Item_func_database(THD *thd): Item_func_sysconst(thd) {} - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen; set_maybe_null(); @@ -1030,8 +1032,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("database") }; return name; } - const char *fully_qualified_func_name() const { return "database()"; } - Item *get_copy(THD *thd) + const char *fully_qualified_func_name() const override + { return "database()"; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_database>(thd, this); } }; @@ -1040,25 +1043,26 @@ class Item_func_sqlerrm :public Item_func_sysconst { public: Item_func_sqlerrm(THD *thd): Item_func_sysconst(thd) {} - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("SQLERRM") }; return name; } - const char *fully_qualified_func_name() const { return "SQLERRM"; } - void print(String *str, enum_query_type query_type) + const char *fully_qualified_func_name() const override + { return "SQLERRM"; } + void print(String *str, enum_query_type query_type) override { str->append(func_name_cstring()); } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= 512 * system_charset_info->mbmaxlen; null_value= false; base_flags&= ~item_base_t::MAYBE_NULL; return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sqlerrm>(thd, this); } }; @@ -1073,13 +1077,13 @@ public: { str_value.set("", 0, system_charset_info); } - String *val_str(String *) + String *val_str(String *) override { DBUG_ASSERT(fixed()); return (null_value ? 0 : &str_value); } - bool fix_fields(THD *thd, Item **ref); - bool fix_length_and_dec() + bool fix_fields(THD *thd, Item **ref) override; + bool fix_length_and_dec() override { max_length= (uint32) (username_char_length + HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN; @@ -1090,12 +1094,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("user") }; return name; } - const char *fully_qualified_func_name() const { return "user()"; } - int save_in_field(Field *field, bool no_conversions) + const char *fully_qualified_func_name() const override + { return "user()"; } + int save_in_field(Field *field, bool no_conversions) override { return save_str_value_in_field(field, &str_value); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_user>(thd, this); } }; @@ -1107,14 +1112,15 @@ class Item_func_current_user :public Item_func_user public: Item_func_current_user(THD *thd, Name_resolution_context *context_arg): Item_func_user(thd), context(context_arg) {} - bool fix_fields(THD *thd, Item **ref); + bool fix_fields(THD *thd, Item **ref) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("current_user") }; return name; } - const char *fully_qualified_func_name() const { return "current_user()"; } - bool check_vcol_func_processor(void *arg) + const char *fully_qualified_func_name() const override + { return "current_user()"; } + bool check_vcol_func_processor(void *arg) override { context= 0; return mark_unsupported_function(fully_qualified_func_name(), arg, @@ -1130,32 +1136,33 @@ class Item_func_current_role :public Item_func_sysconst public: Item_func_current_role(THD *thd, Name_resolution_context *context_arg): Item_func_sysconst(thd), context(context_arg) {} - bool fix_fields(THD *thd, Item **ref); - bool fix_length_and_dec() + bool fix_fields(THD *thd, Item **ref) override; + bool fix_length_and_dec() override { max_length= (uint32) username_char_length * SYSTEM_CHARSET_MBMAXLEN; return FALSE; } - int save_in_field(Field *field, bool no_conversions) + int save_in_field(Field *field, bool no_conversions) override { return save_str_value_in_field(field, &str_value); } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("current_role") }; return name; } - const char *fully_qualified_func_name() const { return "current_role()"; } - String *val_str(String *) + const char *fully_qualified_func_name() const override + { return "current_role()"; } + String *val_str(String *) override { DBUG_ASSERT(fixed()); return null_value ? NULL : &str_value; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { context= 0; return mark_unsupported_function(fully_qualified_func_name(), arg, VCOL_SESSION_FUNC); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_current_role>(thd, this); } }; @@ -1165,14 +1172,14 @@ class Item_func_soundex :public Item_str_func String tmp_value; public: Item_func_soundex(THD *thd, Item *a): Item_str_func(thd, a) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("soundex") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_soundex>(thd, this); } }; @@ -1181,16 +1188,16 @@ class Item_func_elt :public Item_str_func { public: Item_func_elt(THD *thd, List<Item> &list): Item_str_func(thd, list) {} - double val_real(); - longlong val_int(); - String *val_str(String *str); - bool fix_length_and_dec(); + double val_real() override; + longlong val_int() override; + String *val_str(String *str) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("elt") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_elt>(thd, this); } }; @@ -1201,14 +1208,14 @@ class Item_func_make_set :public Item_str_func public: Item_func_make_set(THD *thd, List<Item> &list): Item_str_func(thd, list) {} - String *val_str(String *str); - bool fix_length_and_dec(); + String *val_str(String *str) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("make_set") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_make_set>(thd, this); } }; @@ -1222,14 +1229,14 @@ public: Item_func_format(THD *thd, Item *org, Item *dec, Item *lang): Item_str_ascii_func(thd, org, dec, lang) {} - String *val_str_ascii(String *); - bool fix_length_and_dec(); + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("format") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_format>(thd, this); } }; @@ -1245,9 +1252,9 @@ public: Item_func_char(THD *thd, Item *arg1, CHARSET_INFO *cs): Item_str_func(thd, arg1) { collation.set(cs); } - String *val_str(String *); + String *val_str(String *) override; void append_char(String * str, int32 num); - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= arg_count * 4; return FALSE; @@ -1257,8 +1264,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("char") }; 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_char>(thd, this); } }; @@ -1267,8 +1274,8 @@ class Item_func_chr :public Item_func_char public: Item_func_chr(THD *thd, Item *arg1, CHARSET_INFO *cs): Item_func_char(thd, arg1, cs) {} - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { max_length= 4; return FALSE; @@ -1278,7 +1285,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("chr") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_chr>(thd, this); } }; @@ -1288,14 +1295,14 @@ class Item_func_repeat :public Item_str_func public: Item_func_repeat(THD *thd, Item *arg1, Item *arg2): Item_str_func(thd, arg1, arg2) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("repeat") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_repeat>(thd, this); } }; @@ -1304,14 +1311,14 @@ class Item_func_space :public Item_str_func { public: Item_func_space(THD *thd, Item *arg1): Item_str_func(thd, arg1) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("space") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_space>(thd, this); } }; @@ -1321,18 +1328,18 @@ class Item_func_binlog_gtid_pos :public Item_str_func public: Item_func_binlog_gtid_pos(THD *thd, Item *arg1, Item *arg2): Item_str_func(thd, arg1, arg2) {} - String *val_str(String *); - bool fix_length_and_dec(); + String *val_str(String *) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("binlog_gtid_pos") }; return name; } - 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_binlog_gtid_pos>(thd, this); } }; @@ -1346,7 +1353,7 @@ public: Item_str_func(thd, arg1, arg2, arg3) {} Item_func_pad(THD *thd, Item *arg1, Item *arg2): Item_str_func(thd, arg1, arg2) {} - bool fix_length_and_dec(); + bool fix_length_and_dec() override; }; @@ -1357,28 +1364,28 @@ public: Item_func_pad(thd, arg1, arg2, arg3) {} Item_func_rpad(THD *thd, Item *arg1, Item *arg2): Item_func_pad(thd, arg1, arg2) {} - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("rpad") }; return name; } - Sql_mode_dependency value_depends_on_sql_mode() const; - Item *get_copy(THD *thd) + Sql_mode_dependency value_depends_on_sql_mode() const override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_rpad>(thd, this); } }; class Item_func_rpad_oracle :public Item_func_rpad { - String *make_empty_result() + String *make_empty_result() override { null_value= 1; return NULL; } public: Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3): Item_func_rpad(thd, arg1, arg2, arg3) {} Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2): Item_func_rpad(thd, arg1, arg2) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { bool res= Item_func_rpad::fix_length_and_dec(); set_maybe_null(); @@ -1389,7 +1396,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("rpad_oracle") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_rpad_oracle>(thd, this); } }; @@ -1401,27 +1408,27 @@ public: Item_func_pad(thd, arg1, arg2, arg3) {} Item_func_lpad(THD *thd, Item *arg1, Item *arg2): Item_func_pad(thd, arg1, arg2) {} - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("lpad") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_lpad>(thd, this); } }; class Item_func_lpad_oracle :public Item_func_lpad { - String *make_empty_result() + String *make_empty_result() override { null_value= 1; return NULL; } public: Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3): Item_func_lpad(thd, arg1, arg2, arg3) {} Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2): Item_func_lpad(thd, arg1, arg2) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { bool res= Item_func_lpad::fix_length_and_dec(); set_maybe_null(); @@ -1432,7 +1439,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("lpad_oracle") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_lpad_oracle>(thd, this); } }; @@ -1447,15 +1454,15 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("conv") }; return name; } - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { collation.set(default_charset()); fix_char_length(64); set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_conv>(thd, this); } }; @@ -1482,12 +1489,12 @@ public: String *val_str_ascii_from_val_int(String *str); String *val_str_ascii_from_val_real(String *str); String *val_str_ascii_from_val_str(String *str); - String *val_str_ascii(String *str) + String *val_str_ascii(String *str) override { DBUG_ASSERT(fixed()); return m_arg0_type_handler->Item_func_hex_val_str_ascii(this, str); } - bool fix_length_and_dec() + bool fix_length_and_dec() override { collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); decimals=0; @@ -1495,7 +1502,7 @@ public: m_arg0_type_handler= args[0]->type_handler(); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_hex>(thd, this); } }; @@ -1513,15 +1520,15 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("unhex") }; return name; } - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { collation.set(&my_charset_bin); decimals=0; max_length=(1+args[0]->max_length)/2; return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_unhex>(thd, this); } }; @@ -1539,8 +1546,8 @@ public: { set_maybe_null(); } - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { collation.set(args[0]->collation); decimals=0; @@ -1560,7 +1567,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("like_range_min") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_like_range_min>(thd, this); } }; @@ -1575,7 +1582,7 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("like_range_max") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_like_range_max>(thd, this); } }; #endif @@ -1585,7 +1592,7 @@ class Item_func_binary :public Item_str_func { public: Item_func_binary(THD *thd, Item *a): Item_str_func(thd, a) {} - String *val_str(String *a) + String *val_str(String *a) override { DBUG_ASSERT(fixed()); String *tmp=args[0]->val_str(a); @@ -1594,20 +1601,20 @@ public: tmp->set_charset(&my_charset_bin); return tmp; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { collation.set(&my_charset_bin); max_length=args[0]->max_length; return FALSE; } - void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_binary") }; return name; } - bool need_parentheses_in_default() { return true; } - Item *get_copy(THD *thd) + bool need_parentheses_in_default() override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_binary>(thd, this); } }; @@ -1617,24 +1624,24 @@ class Item_load_file :public Item_str_func String tmp_value; public: Item_load_file(THD *thd, Item *a): Item_str_func(thd, a) {} - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("load_file") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { collation.set(&my_charset_bin, DERIVATION_COERCIBLE); set_maybe_null(); max_length=MAX_BLOB_WIDTH; 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_load_file>(thd, this); } }; @@ -1648,14 +1655,14 @@ class Item_func_export_set: public Item_str_func Item_str_func(thd, a, b, c, d) {} Item_func_export_set(THD *thd, Item *a, Item *b, Item* c, Item* d, Item* e): Item_str_func(thd, a, b, c, d, e) {} - String *val_str(String *str); - bool fix_length_and_dec(); + String *val_str(String *str) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("export_set") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_export_set>(thd, this); } }; @@ -1670,8 +1677,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("quote") }; return name; } - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { collation.set(args[0]->collation); ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 + @@ -1679,7 +1686,7 @@ public: max_length= (uint32) MY_MIN(max_result_length, MAX_BLOB_WIDTH); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_quote>(thd, this); } }; @@ -1731,9 +1738,9 @@ public: (cs->mbmaxlen > 1 || !(cs->state & MY_CS_NONASCII)))); } } - bool is_json_type() { return args[0]->is_json_type(); } - String *val_str(String *); - longlong val_int() + bool is_json_type() override { return args[0]->is_json_type(); } + String *val_str(String *) override; + longlong val_int() override { if (args[0]->result_type() == STRING_RESULT) return Item_str_func::val_int(); @@ -1742,7 +1749,7 @@ public: return 0; return res; } - double val_real() + double val_real() override { if (args[0]->result_type() == STRING_RESULT) return Item_str_func::val_real(); @@ -1751,7 +1758,7 @@ public: return 0; return res; } - my_decimal *val_decimal(my_decimal *d) + my_decimal *val_decimal(my_decimal *d) override { if (args[0]->result_type() == STRING_RESULT) return Item_str_func::val_decimal(d); @@ -1760,7 +1767,7 @@ public: return NULL; return res; } - 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 (args[0]->result_type() == STRING_RESULT) return Item_str_func::get_date(thd, ltime, fuzzydate); @@ -1769,14 +1776,14 @@ public: return 1; return res; } - 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("convert") }; 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_conv_charset>(thd, this); } }; @@ -1786,24 +1793,24 @@ class Item_func_set_collation :public Item_str_func public: Item_func_set_collation(THD *thd, Item *a, CHARSET_INFO *set_collation): Item_str_func(thd, a), m_set_collation(set_collation) {} - String *val_str(String *); - bool fix_length_and_dec(); - bool eq(const Item *item, bool binary_cmp) const; + String *val_str(String *) override; + bool fix_length_and_dec() override; + bool eq(const Item *item, bool binary_cmp) const override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("collate") }; return name; } - enum precedence precedence() const { return COLLATE_PRECEDENCE; } - enum Functype functype() const { return COLLATE_FUNC; } - void print(String *str, enum_query_type query_type); - Item_field *field_for_view_update() + enum precedence precedence() const override { return COLLATE_PRECEDENCE; } + enum Functype functype() const override { return COLLATE_FUNC; } + void print(String *str, enum_query_type query_type) override; + Item_field *field_for_view_update() override { /* this function is transparent for view updating */ return args[0]->field_for_view_update(); } - bool need_parentheses_in_default() { return true; } - Item *get_copy(THD *thd) + bool need_parentheses_in_default() override { return true; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_set_collation>(thd, this); } }; @@ -1812,17 +1819,18 @@ class Item_func_expr_str_metadata :public Item_str_func { public: Item_func_expr_str_metadata(THD *thd, Item *a): Item_str_func(thd, a) { } - bool fix_length_and_dec() + bool fix_length_and_dec() override { collation.set(system_charset_info); max_length= 64 * collation.collation->mbmaxlen; // should be enough base_flags&= ~item_base_t::MAYBE_NULL; return FALSE; }; - table_map not_null_tables() const { return 0; } + table_map not_null_tables() const override { return 0; } Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) + override { return this; } - bool const_item() const { return true; } + bool const_item() const override { return true; } }; @@ -1831,13 +1839,13 @@ class Item_func_charset :public Item_func_expr_str_metadata public: Item_func_charset(THD *thd, Item *a) :Item_func_expr_str_metadata(thd, a) { } - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("charset") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_charset>(thd, this); } }; @@ -1847,13 +1855,13 @@ class Item_func_collation :public Item_func_expr_str_metadata public: Item_func_collation(THD *thd, Item *a) :Item_func_expr_str_metadata(thd, a) {} - String *val_str(String *); + String *val_str(String *) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("collation") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_collation>(thd, this); } }; @@ -1878,9 +1886,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("weight_string") }; return name; } - String *val_str(String *); - bool fix_length_and_dec(); - bool eq(const Item *item, bool binary_cmp) const + String *val_str(String *) override; + bool fix_length_and_dec() override; + bool eq(const Item *item, bool binary_cmp) const override { if (!Item_str_func::eq(item, binary_cmp)) return false; @@ -1890,15 +1898,16 @@ public: this->result_length == that->result_length; } Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) + override { return this; } - 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_weight_string>(thd, this); } }; class Item_func_crc32 :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: @@ -1909,9 +1918,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("crc32") }; return name; } - bool fix_length_and_dec() { max_length=10; return FALSE; } - longlong val_int(); - Item *get_copy(THD *thd) + bool fix_length_and_dec() override { max_length=10; return FALSE; } + longlong val_int() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_crc32>(thd, this); } }; @@ -1926,13 +1935,13 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("uncompressed_length") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length=10; set_maybe_null(); return FALSE; } - longlong val_int(); - Item *get_copy(THD *thd) + longlong val_int() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_uncompressed_length>(thd, this); } }; @@ -1948,7 +1957,7 @@ class Item_func_compress: public Item_str_binary_checksum_func public: Item_func_compress(THD *thd, Item *a) :Item_str_binary_checksum_func(thd, a) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= (args[0]->max_length * 120) / 100 + 12; return FALSE; @@ -1958,8 +1967,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("compress") }; return name; } - String *val_str(String *) ZLIB_DEPENDED_FUNCTION - Item *get_copy(THD *thd) + String *val_str(String *) override ZLIB_DEPENDED_FUNCTION + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_compress>(thd, this); } }; @@ -1969,7 +1978,7 @@ class Item_func_uncompress: public Item_str_binary_checksum_func public: Item_func_uncompress(THD *thd, Item *a) :Item_str_binary_checksum_func(thd, a) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { set_maybe_null(); max_length= MAX_BLOB_WIDTH; @@ -1980,8 +1989,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("uncompress") }; return name; } - String *val_str(String *) ZLIB_DEPENDED_FUNCTION - Item *get_copy(THD *thd) + String *val_str(String *) override ZLIB_DEPENDED_FUNCTION + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_uncompress>(thd, this); } }; @@ -1990,26 +1999,26 @@ class Item_func_uuid: public Item_str_func { public: Item_func_uuid(THD *thd): Item_str_func(thd) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { collation.set(DTCollation_numeric()); fix_char_length(MY_UUID_STRING_LENGTH); return FALSE; } - bool const_item() const { return false; } - table_map used_tables() const { return RAND_TABLE_BIT; } + bool const_item() const override { return false; } + table_map used_tables() const override { return RAND_TABLE_BIT; } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("uuid") }; return name; } - String *val_str(String *); - bool check_vcol_func_processor(void *arg) + String *val_str(String *) override; + 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>(thd, this); } }; @@ -2026,17 +2035,17 @@ protected: void print_arguments(String *str, enum_query_type query_type); public: Item_func_dyncol_create(THD *thd, List<Item> &args, DYNCALL_CREATE_DEF *dfs); - bool fix_fields(THD *thd, Item **ref); - bool fix_length_and_dec(); + bool fix_fields(THD *thd, Item **ref) override; + bool fix_length_and_dec() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("column_create") }; return name; } - String *val_str(String *); - void print(String *str, enum_query_type query_type); - enum Functype functype() const { return DYNCOL_FUNC; } - Item *get_copy(THD *thd) + String *val_str(String *) override; + void print(String *str, enum_query_type query_type) override; + enum Functype functype() const override { return DYNCOL_FUNC; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_dyncol_create>(thd, this); } }; @@ -2052,9 +2061,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("column_add") }; return name; } - String *val_str(String *); - void print(String *str, enum_query_type query_type); - Item *get_copy(THD *thd) + String *val_str(String *) override; + void print(String *str, enum_query_type query_type) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_dyncol_add>(thd, this); } }; @@ -2068,15 +2077,15 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("column_json") }; return name; } - String *val_str(String *); - bool fix_length_and_dec() + String *val_str(String *) override; + bool fix_length_and_dec() override { max_length= MAX_BLOB_WIDTH; set_maybe_null(); decimals= 0; return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_dyncol_json>(thd, this); } }; @@ -2089,23 +2098,23 @@ class Item_dyncol_get: public Item_str_func public: Item_dyncol_get(THD *thd, Item *str, Item *num): Item_str_func(thd, str, num) {} - bool fix_length_and_dec() + bool fix_length_and_dec() override { set_maybe_null(); max_length= MAX_BLOB_WIDTH; return FALSE; } /* Mark that collation can change between calls */ - bool dynamic_result() { return 1; } + bool dynamic_result() override { return 1; } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("column_get") }; return name; } - String *val_str(String *); - longlong val_int(); - longlong val_int_signed_typecast() + String *val_str(String *) override; + longlong val_int() override; + longlong val_int_signed_typecast() override { unsigned_flag= false; // Mark that we want to have a signed value longlong value= val_int(); // val_int() can change unsigned_flag @@ -2113,7 +2122,7 @@ public: push_note_converted_to_negative_complement(current_thd); return value; } - longlong val_int_unsigned_typecast() + longlong val_int_unsigned_typecast() override { unsigned_flag= true; // Mark that we want to have an unsigned value longlong value= val_int(); // val_int() can change unsigned_flag @@ -2121,12 +2130,12 @@ public: push_note_converted_to_positive_complement(current_thd); return value; } - double val_real(); - my_decimal *val_decimal(my_decimal *); + double val_real() override; + my_decimal *val_decimal(my_decimal *) override; bool get_dyn_value(THD *thd, DYNAMIC_COLUMN_VALUE *val, String *tmp); - bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate); - void print(String *str, enum_query_type query_type); - Item *get_copy(THD *thd) + bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override; + void print(String *str, enum_query_type query_type) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_dyncol_get>(thd, this); } }; @@ -2136,7 +2145,7 @@ class Item_func_dyncol_list: public Item_str_func public: Item_func_dyncol_list(THD *thd, Item *str): Item_str_func(thd, str) {collation.set(DYNCOL_UTF);} - bool fix_length_and_dec() + bool fix_length_and_dec() override { set_maybe_null(); max_length= MAX_BLOB_WIDTH; @@ -2147,8 +2156,8 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("column_list") }; return name; } - String *val_str(String *); - Item *get_copy(THD *thd) + String *val_str(String *) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_dyncol_list>(thd, this); } }; @@ -2162,18 +2171,19 @@ class Item_temptable_rowid :public Item_str_func public: TABLE *table; Item_temptable_rowid(TABLE *table_arg); - const Type_handler *type_handler() const { return &type_handler_string; } + const Type_handler *type_handler() const override + { return &type_handler_string; } Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) { return create_table_field_from_handler(root, table); } - String *val_str(String *str); - enum Functype functype() const { return TEMPTABLE_ROWID; } + String *val_str(String *str) override; + enum Functype functype() const override { return TEMPTABLE_ROWID; } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("<rowid>") }; 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_temptable_rowid>(thd, this); } }; #ifdef WITH_WSREP @@ -2190,14 +2200,14 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_last_written_gtid") }; return name; } - String *val_str_ascii(String *); - bool fix_length_and_dec() + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override { max_length= WSREP_GTID_STR_LEN; set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_wsrep_last_written_gtid>(thd, this); } }; @@ -2211,14 +2221,14 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_last_seen_gtid") }; return name; } - String *val_str_ascii(String *); - bool fix_length_and_dec() + String *val_str_ascii(String *) override; + bool fix_length_and_dec() override { max_length= WSREP_GTID_STR_LEN; set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_wsrep_last_seen_gtid>(thd, this); } }; @@ -2228,14 +2238,15 @@ class Item_func_wsrep_sync_wait_upto: public Item_int_func public: Item_func_wsrep_sync_wait_upto(THD *thd, Item *a): Item_int_func(thd, a) {} Item_func_wsrep_sync_wait_upto(THD *thd, Item *a, Item* b): Item_int_func(thd, a, b) {} - const Type_handler *type_handler() const { return &type_handler_string; } + const Type_handler *type_handler() const override + { return &type_handler_string; } LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_sync_wait_upto_gtid") }; return name; } - longlong val_int(); - Item *get_copy(THD *thd) + longlong val_int() override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_wsrep_sync_wait_upto>(thd, this); } }; #endif /* WITH_WSREP */ |