Skip to content
Permalink
Browse files
Fix GCC 10.2.0 -Og -fsanitize=undefined -Wmaybe-uninitialized
For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
to the compilation flags will cause even more warnings to be emitted.
The warnings do look bogus, but the code can be simplified.
  • Loading branch information
dr-m committed Sep 23, 2020
1 parent 0448558 commit af40a2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
@@ -1,5 +1,5 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
Copyright (c) 2011, 2016, MariaDB
Copyright (c) 2011, 2020, 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
@@ -456,16 +456,18 @@ String *Item_func_boundary::val_str(String *str_value)
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);

if ((null_value= args[0]->null_value))
DBUG_RETURN(0);

Geometry_buffer buffer;
Geometry *g;
uint32 srid= 0;
Transporter trn(&res_receiver);

if ((null_value=
args[0]->null_value ||
!(g= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))

Geometry *g= Geometry::construct(&buffer, swkb->ptr(), swkb->length());
if (!g)
DBUG_RETURN(0);

if (g->store_shapes(&trn))
goto mem_error;

@@ -1,5 +1,5 @@
/*
Copyright (c) 2010, 2019, MariaDB
Copyright (c) 2010, 2020, 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
@@ -2634,16 +2634,11 @@ bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables)
do
{
uint key= keyuse->key;
KEY *keyinfo;
key_part_map bound_parts= 0;
bool is_excluded_key= keyuse->is_for_hash_join();
if (!is_excluded_key)
{
keyinfo= table->key_info + key;
is_excluded_key= !MY_TEST(keyinfo->flags & HA_NOSAME);
}
if (!is_excluded_key)
if (!keyuse->is_for_hash_join() &&
(table->key_info[key].flags & HA_NOSAME))
{
KEY *keyinfo= table->key_info + key;
do /* For all equalities on all key parts */
{
/*
@@ -1731,7 +1731,6 @@ btr_search_update_hash_node_on_insert(btr_cur_t* cursor)
void
btr_search_update_hash_on_insert(btr_cur_t* cursor)
{
hash_table_t* table;
buf_block_t* block;
dict_index_t* index;
const rec_t* rec;
@@ -1798,6 +1797,7 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
}

rw_lock_t* const latch = btr_get_search_latch(index);
hash_table_t* const table = btr_get_search_table(index);
bool locked = false;

if (!page_rec_is_infimum(rec)) {
@@ -1814,7 +1814,6 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
goto function_exit;
}

table = btr_get_search_table(index);
ha_insert_for_fold(table, ins_fold, block, ins_rec);
}

@@ -1830,7 +1829,6 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
if (!btr_search_enabled || !block->index) {
goto function_exit;
}
table = btr_get_search_table(index);
}

if (!left_side) {
@@ -1851,7 +1849,6 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
if (!btr_search_enabled || !block->index) {
goto function_exit;
}
table = btr_get_search_table(index);
}

ha_insert_for_fold(table, ins_fold, block, ins_rec);
@@ -1868,7 +1865,6 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor)
if (!btr_search_enabled || !block->index) {
goto function_exit;
}
table = btr_get_search_table(index);
}

if (!left_side) {

0 comments on commit af40a2b

Please sign in to comment.