From 72f677d3027bc538d3d8ed9fab5721cce3696224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 5 Aug 2020 19:58:26 +0300 Subject: [PATCH] fixup 58e759a9393f76e558c016a3f84656401b9de1ce: clang -Winconsistent-missing-override --- sql/item.cc | 2 +- sql/item_sum.h | 31 +++++++-------- sql/protocol.h | 83 ++++++++++++++++++++-------------------- storage/maria/ha_maria.h | 2 +- 4 files changed, 60 insertions(+), 58 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index c1d51903f6b..dbf20f31d7a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2164,7 +2164,7 @@ public: else Item_ident::print(str, query_type); } - virtual Ref_Type ref_type() { return AGGREGATE_REF; } + Ref_Type ref_type() override final { return AGGREGATE_REF; } }; diff --git a/sql/item_sum.h b/sql/item_sum.h index 961cb884c4f..118f78ec5c1 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -1019,7 +1019,7 @@ public: class Item_sum_variance :public Item_sum_double { Stddev m_stddev; - bool fix_length_and_dec(); + bool fix_length_and_dec() override; public: uint sample; @@ -1030,26 +1030,27 @@ public: sample(sample_arg) {} Item_sum_variance(THD *thd, Item_sum_variance *item); - enum Sumfunctype sum_func () const { return VARIANCE_FUNC; } + Sumfunctype sum_func () const override { return VARIANCE_FUNC; } void fix_length_and_dec_double(); void fix_length_and_dec_decimal(); void clear() override final; bool add() override final; - double val_real(); + double val_real() override; void reset_field() override final; void update_field() override final; - Item *result_item(THD *thd, Field *field); + Item *result_item(THD *thd, Field *field) override; void no_rows_in_result() override final {} - const char *func_name() const + const char *func_name() const override { return sample ? "var_samp(" : "variance("; } - Item *copy_or_same(THD* thd); - Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table); - void cleanup() + Item *copy_or_same(THD* thd) override; + Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override + final; + void cleanup() override final { m_stddev= Stddev(); Item_sum_double::cleanup(); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy(thd, this); } }; @@ -1065,12 +1066,12 @@ class Item_sum_std final :public Item_sum_variance Item_sum_std(THD *thd, Item_sum_std *item) :Item_sum_variance(thd, item) {} - enum Sumfunctype sum_func () const { return STD_FUNC; } - double val_real(); - Item *result_item(THD *thd, Field *field); - const char *func_name() const { return "std("; } - Item *copy_or_same(THD* thd); - Item *get_copy(THD *thd) + enum Sumfunctype sum_func () const override final { return STD_FUNC; } + double val_real() override final; + Item *result_item(THD *thd, Field *field) override final; + const char *func_name() const override final { return "std("; } + Item *copy_or_same(THD* thd) override final; + Item *get_copy(THD *thd) override final { return get_item_copy(thd, this); } }; diff --git a/sql/protocol.h b/sql/protocol.h index 8464b7f530b..4560fddd193 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -2,6 +2,7 @@ #define PROTOCOL_INCLUDED /* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2020, MariaDB Corporation. 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 @@ -214,27 +215,27 @@ public: if (prealloc) packet->alloc(prealloc); } - virtual void prepare_for_resend(); - virtual bool store_null(); - virtual bool store_tiny(longlong from); - virtual bool store_short(longlong from); - virtual bool store_long(longlong from); - virtual bool store_longlong(longlong from, bool unsigned_flag); - virtual bool store_decimal(const my_decimal *); - virtual bool store_str(const char *from, size_t length, - CHARSET_INFO *fromcs, - my_repertoire_t from_repertoire, - CHARSET_INFO *tocs); - virtual bool store(MYSQL_TIME *time, int decimals); - virtual bool store_date(MYSQL_TIME *time); - virtual bool store_time(MYSQL_TIME *time, int decimals); - virtual bool store(float nr, uint32 decimals, String *buffer); - virtual bool store(double from, uint32 decimals, String *buffer); - virtual bool store(Field *field); + void prepare_for_resend() override; + bool store_null() override; + bool store_tiny(longlong from) override; + bool store_short(longlong from) override; + bool store_long(longlong from) override; + bool store_longlong(longlong from, bool unsigned_flag) override; + bool store_decimal(const my_decimal *) override; + bool store_str(const char *from, size_t length, + CHARSET_INFO *fromcs, + my_repertoire_t from_repertoire, + CHARSET_INFO *tocs) override; + bool store(MYSQL_TIME *time, int decimals) override; + bool store_date(MYSQL_TIME *time) override; + bool store_time(MYSQL_TIME *time, int decimals) override; + bool store(float nr, uint32 decimals, String *buffer) override; + bool store(double from, uint32 decimals, String *buffer) override; + bool store(Field *field) override; - virtual bool send_out_parameters(List *sp_params); + bool send_out_parameters(List *sp_params) override; #ifdef EMBEDDED_LIBRARY - void remove_last_row(); + void remove_last_row() override; #endif bool store_field_metadata(const THD *thd, const Send_field &field, CHARSET_INFO *charset_for_protocol, @@ -253,32 +254,32 @@ private: uint bit_fields; public: Protocol_binary(THD *thd_arg) :Protocol(thd_arg) {} - virtual bool prepare_for_send(uint num_columns); - virtual void prepare_for_resend(); + bool prepare_for_send(uint num_columns) override; + void prepare_for_resend() override; #ifdef EMBEDDED_LIBRARY - virtual bool write(); - bool net_store_data(const uchar *from, size_t length); + bool write() override; + bool net_store_data(const uchar *from, size_t length) override; bool net_store_data_cs(const uchar *from, size_t length, - CHARSET_INFO *fromcs, CHARSET_INFO *tocs); + CHARSET_INFO *fromcs, CHARSET_INFO *tocs) override; #endif - virtual bool store_null(); - virtual bool store_tiny(longlong from); - virtual bool store_short(longlong from); - virtual bool store_long(longlong from); - virtual bool store_longlong(longlong from, bool unsigned_flag); - virtual bool store_decimal(const my_decimal *); - virtual bool store_str(const char *from, size_t length, - CHARSET_INFO *fromcs, - my_repertoire_t from_repertoire, - CHARSET_INFO *tocs); - virtual bool store(MYSQL_TIME *time, int decimals); - virtual bool store_date(MYSQL_TIME *time); - virtual bool store_time(MYSQL_TIME *time, int decimals); - virtual bool store(float nr, uint32 decimals, String *buffer); - virtual bool store(double from, uint32 decimals, String *buffer); - virtual bool store(Field *field); + bool store_null() override; + bool store_tiny(longlong from) override; + bool store_short(longlong from) override; + bool store_long(longlong from) override; + bool store_longlong(longlong from, bool unsigned_flag) override; + bool store_decimal(const my_decimal *) override; + bool store_str(const char *from, size_t length, + CHARSET_INFO *fromcs, + my_repertoire_t from_repertoire, + CHARSET_INFO *tocs) override; + bool store(MYSQL_TIME *time, int decimals) override; + bool store_date(MYSQL_TIME *time) override; + bool store_time(MYSQL_TIME *time, int decimals) override; + bool store(float nr, uint32 decimals, String *buffer) override; + bool store(double from, uint32 decimals, String *buffer) override; + bool store(Field *field) override; - virtual bool send_out_parameters(List *sp_params); + bool send_out_parameters(List *sp_params) override; enum enum_protocol_type type() override { return PROTOCOL_BINARY; }; }; diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 83f5a059a41..b2c664a072d 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -65,7 +65,7 @@ private: public: ha_maria(handlerton *hton, TABLE_SHARE * table_arg); ~ha_maria() {} - handler *clone(const char *name, MEM_ROOT *mem_root); + handler *clone(const char *name, MEM_ROOT *mem_root) override final; const char *index_type(uint key_number) override final; ulonglong table_flags() const override final { return int_table_flags; }