1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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.
This commit is contained in:
Marko Mäkelä
2020-09-23 12:27:56 +03:00
parent 0448558a0d
commit af40a2b43e
3 changed files with 14 additions and 21 deletions

View File

@@ -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 */
{
/*