1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-9988 - Insert cast to suppress -Wdynamic-class-memaccess

Clang warns on this code because it is memsetting over a vtable contained in a
struct in the best_positions array. The diagnostic text is:

mariadb/sql/sql_select.cc:24462:10: error: destination for this 'memset' call is
a pointer to class containing a dynamic class 'Duplicate_weedout_picker'; vtable
pointer will be overwritten [-Werror,-Wdynamic-class-memaccess]
  memset(best_positions, 0, sizeof(POSITION) * (table_count + 1));
  ~~~~~~ ^

Patch contributed by David Gow.
This commit is contained in:
Sergey Vojtovich
2016-04-28 21:59:23 +04:00
parent e5810727a9
commit 94bad73dd1
2 changed files with 6 additions and 5 deletions

View File

@@ -24672,7 +24672,7 @@ void JOIN::save_query_plan(Join_plan_state *save_to)
}
memcpy((uchar*) save_to->best_positions, (uchar*) best_positions,
sizeof(POSITION) * (table_count + 1));
memset(best_positions, 0, sizeof(POSITION) * (table_count + 1));
memset((uchar*) best_positions, 0, sizeof(POSITION) * (table_count + 1));
/* Save SJM nests */
List_iterator<TABLE_LIST> it(select_lex->sj_nests);