Skip to content

Commit 88bb6b1

Browse files
committed
Fix recently introduced Clang build warnings:
-Winconsistent-missing-override -Winconsistent-missing-destructor-override -Wconditional-uninitialized Change-Id: Ia5fa42acfcc219360a5f3b3e93bf6bf230a31dfd
1 parent 219928b commit 88bb6b1

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

sql/binlog.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ bool normalize_binlog_name(char *to, const char *from, bool is_relay_log) {
243243
*/
244244
class MYSQL_BIN_LOG::Binlog_ofile : public Basic_ostream {
245245
public:
246-
~Binlog_ofile() {
246+
~Binlog_ofile() override {
247247
DBUG_ENTER("Binlog_ofile::~Binlog_ofile");
248248
close();
249249
DBUG_VOID_RETURN;
@@ -7411,7 +7411,7 @@ int MYSQL_BIN_LOG::open_binlog(const char *opt_name) {
74117411
Log_event *ev = 0;
74127412
char log_name[FN_REFLEN];
74137413
my_off_t valid_pos = 0;
7414-
my_off_t binlog_size;
7414+
my_off_t binlog_size = 0;
74157415

74167416
do {
74177417
strmake(log_name, log_info.log_file_name, sizeof(log_name) - 1);

sql/binlog_istream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Binlog_read_error {
108108
*/
109109
class Binlog_encryption_istream : public Basic_seekable_istream {
110110
public:
111-
virtual ~Binlog_encryption_istream();
111+
~Binlog_encryption_istream() override;
112112

113113
/**
114114
Initialize the context used in the decryption stream.

sql/binlog_ostream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class Binlog_cache_storage : public Basic_ostream {
207207
*/
208208
class Binlog_encryption_ostream : public Truncatable_ostream {
209209
public:
210-
~Binlog_encryption_ostream();
210+
~Binlog_encryption_ostream() override;
211211

212212
/**
213213
Initialize the context used in the encryption stream and write encryption

sql/item.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -3655,7 +3655,7 @@ class Item_param final : public Item, private Settable_routine_parameter {
36553655
/** Item is a argument to a limit clause. */
36563656
bool limit_clause_param;
36573657
void set_param_type_and_swap_value(Item_param *from);
3658-
bool is_non_const_over_literals(uchar *) { return true; }
3658+
bool is_non_const_over_literals(uchar *) override { return true; }
36593659
/**
36603660
This should be called after any modification done to this Item, to
36613661
propagate the said modification to all its clones.
@@ -4636,7 +4636,7 @@ class Item_ref : public Item_ident {
46364636

46374637
bool repoint_const_outer_ref(uchar *arg) override;
46384638
bool contains_alias_of_expr(uchar *arg) override;
4639-
bool is_non_const_over_literals(uchar *) { return true; }
4639+
bool is_non_const_over_literals(uchar *) override { return true; }
46404640
bool check_function_as_value_generator(uchar *args) override {
46414641
Check_function_as_value_generator_parameters *func_arg =
46424642
pointer_cast<Check_function_as_value_generator_parameters *>(args);
@@ -5586,7 +5586,7 @@ class Item_cache : public Item_basic_constant {
55865586
bool is_null() override {
55875587
return value_cached ? null_value : example->is_null();
55885588
}
5589-
bool is_non_const_over_literals(uchar *) { return true; }
5589+
bool is_non_const_over_literals(uchar *) override { return true; }
55905590
bool check_function_as_value_generator(uchar *args) override {
55915591
Check_function_as_value_generator_parameters *func_arg =
55925592
pointer_cast<Check_function_as_value_generator_parameters *>(args);

sql/item_func.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class Item_func : public Item_result_field {
606606
@return true if the function item can have named parameters
607607
*/
608608
virtual bool may_have_named_parameters() const { return false; }
609-
virtual bool is_non_const_over_literals(uchar *) { return false; }
609+
virtual bool is_non_const_over_literals(uchar *) override { return false; }
610610

611611
bool check_function_as_value_generator(uchar *args) override {
612612
if (is_deprecated()) {
@@ -2041,7 +2041,7 @@ class Item_func_get_lock final : public Item_int_func {
20412041
maybe_null = true;
20422042
return false;
20432043
}
2044-
bool is_non_const_over_literals(uchar *) { return true; }
2044+
bool is_non_const_over_literals(uchar *) override { return true; }
20452045
bool check_function_as_value_generator(uchar *args) override {
20462046
Check_function_as_value_generator_parameters *func_arg =
20472047
pointer_cast<Check_function_as_value_generator_parameters *>(args);
@@ -2067,7 +2067,7 @@ class Item_func_release_lock final : public Item_int_func {
20672067
maybe_null = true;
20682068
return false;
20692069
}
2070-
bool is_non_const_over_literals(uchar *) { return true; }
2070+
bool is_non_const_over_literals(uchar *) override { return true; }
20712071
bool check_function_as_value_generator(uchar *args) override {
20722072
Check_function_as_value_generator_parameters *func_arg =
20732073
pointer_cast<Check_function_as_value_generator_parameters *>(args);
@@ -2090,7 +2090,7 @@ class Item_func_release_all_locks final : public Item_int_func {
20902090
unsigned_flag = true;
20912091
return false;
20922092
}
2093-
bool is_non_const_over_literals(uchar *) { return true; }
2093+
bool is_non_const_over_literals(uchar *) override { return true; }
20942094
bool check_function_as_value_generator(uchar *args) override {
20952095
Check_function_as_value_generator_parameters *func_arg =
20962096
pointer_cast<Check_function_as_value_generator_parameters *>(args);
@@ -3043,7 +3043,7 @@ class Item_func_get_user_var : public Item_var_func,
30433043
select @t1:=1,@t1,@t:="hello",@t from foo where (@t1:= t2.b)
30443044
*/
30453045
const char *func_name() const override { return "get_user_var"; }
3046-
bool is_non_const_over_literals(uchar *) { return true; }
3046+
bool is_non_const_over_literals(uchar *) override { return true; }
30473047
bool eq(const Item *item, bool binary_cmp) const override;
30483048

30493049
private:
@@ -3158,7 +3158,7 @@ class Item_func_get_system_var final : public Item_var_func {
31583158
bool resolve_type(THD *) override;
31593159
void print(String *str, enum_query_type query_type) override;
31603160
table_map used_tables() const override { return 0; }
3161-
bool is_non_const_over_literals(uchar *) { return true; }
3161+
bool is_non_const_over_literals(uchar *) override { return true; }
31623162
enum Item_result result_type() const override;
31633163
double val_real() override;
31643164
longlong val_int() override;
@@ -3467,7 +3467,7 @@ class Item_func_is_free_lock final : public Item_int_func {
34673467
maybe_null = true;
34683468
return false;
34693469
}
3470-
bool is_non_const_over_literals(uchar *) { return true; }
3470+
bool is_non_const_over_literals(uchar *) override { return true; }
34713471
bool check_function_as_value_generator(uchar *args) override {
34723472
Check_function_as_value_generator_parameters *func_arg =
34733473
pointer_cast<Check_function_as_value_generator_parameters *>(args);
@@ -3492,7 +3492,7 @@ class Item_func_is_used_lock final : public Item_int_func {
34923492
maybe_null = true;
34933493
return false;
34943494
}
3495-
bool is_non_const_over_literals(uchar *) { return true; }
3495+
bool is_non_const_over_literals(uchar *) override { return true; }
34963496
bool check_function_as_value_generator(uchar *args) override {
34973497
Check_function_as_value_generator_parameters *func_arg =
34983498
pointer_cast<Check_function_as_value_generator_parameters *>(args);

sql/rpl_log_encryption.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ extern Rpl_encryption rpl_encryption;
480480
*/
481481
class Rpl_cipher {
482482
public:
483-
virtual ~Rpl_cipher(){};
483+
virtual ~Rpl_cipher() {}
484484

485485
/**
486486
Open the cipher with given password.
@@ -805,7 +805,7 @@ class Rpl_encryption_header_v1 : public Rpl_encryption_header {
805805

806806
Rpl_encryption_header_v1() = default;
807807

808-
virtual ~Rpl_encryption_header_v1();
808+
~Rpl_encryption_header_v1() override;
809809

810810
bool serialize(Basic_ostream *ostream) override;
811811
bool deserialize(Basic_istream *istream) override;
@@ -867,7 +867,7 @@ class Aes_ctr_cipher : public Rpl_cipher {
867867
static const int AES_BLOCK_SIZE = 16;
868868
static const int FILE_KEY_LENGTH = 32;
869869

870-
virtual ~Aes_ctr_cipher();
870+
~Aes_ctr_cipher() override;
871871

872872
bool open(const Key_string &password, int header_size) override;
873873
void close() override;

0 commit comments

Comments
 (0)