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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user