MDEV-17542 10.3: gcc-8.0 produces lots of -Wclass-memaccess warnings in Table_scope_and_contents_source_st

This commit is contained in:
Alexander Barkov 2018-10-25 12:07:23 +04:00
parent 554ce5a0cc
commit 3e47b41a16
2 changed files with 37 additions and 12 deletions

View file

@ -6954,7 +6954,7 @@ bool Vers_parse_info::fix_implicit(THD *thd, Alter_info *alter_info)
return false;
}
bool Table_scope_and_contents_source_st::vers_native(THD *thd) const
bool Table_scope_and_contents_source_pod_st::vers_native(THD *thd) const
{
if (ha_check_storage_engine_flag(db_type, HTON_NATIVE_SYS_VERSIONING))
return true;

View file

@ -1906,6 +1906,8 @@ enum vers_sys_type_t
VERS_TRX_ID
};
extern const LEX_CSTRING null_clex_str;
struct Vers_parse_info
{
Vers_parse_info() :
@ -1914,6 +1916,15 @@ struct Vers_parse_info
unversioned_fields(false)
{}
void init() // Deep initialization
{
system_time= start_end_t(null_clex_str, null_clex_str);
as_row= start_end_t(null_clex_str, null_clex_str);
check_unit= VERS_UNDEFINED;
versioned_fields= false;
unversioned_fields= false;
}
struct start_end_t
{
start_end_t()
@ -1993,7 +2004,7 @@ public:
- [AS] SELECT ... // Copy structure from a subquery
*/
struct Table_scope_and_contents_source_st
struct Table_scope_and_contents_source_pod_st // For trivial members
{
CHARSET_INFO *table_charset;
LEX_CUSTRING tabledef_version;
@ -2019,7 +2030,6 @@ struct Table_scope_and_contents_source_st
uint options; /* OR of HA_CREATE_ options */
uint merge_insert_method;
uint extra_size; /* length of extra data segment */
SQL_I_List<TABLE_LIST> merge_list;
handlerton *db_type;
/**
Row type of the table definition.
@ -2053,15 +2063,6 @@ struct Table_scope_and_contents_source_st
bool table_was_deleted;
sequence_definition *seq_create_info;
Vers_parse_info vers_info;
bool vers_fix_system_fields(THD *thd, Alter_info *alter_info,
const TABLE_LIST &create_table,
bool create_select= false);
bool vers_check_system_fields(THD *thd, Alter_info *alter_info,
const TABLE_LIST &create_table);
bool vers_native(THD *thd) const;
void init()
@ -2082,6 +2083,30 @@ struct Table_scope_and_contents_source_st
};
struct Table_scope_and_contents_source_st:
public Table_scope_and_contents_source_pod_st
{
SQL_I_List<TABLE_LIST> merge_list;
Vers_parse_info vers_info;
void init()
{
Table_scope_and_contents_source_pod_st::init();
merge_list.empty();
vers_info.init();
}
bool vers_fix_system_fields(THD *thd, Alter_info *alter_info,
const TABLE_LIST &create_table,
bool create_select= false);
bool vers_check_system_fields(THD *thd, Alter_info *alter_info,
const TABLE_LIST &create_table);
};
/**
This struct is passed to handler table routines, e.g. ha_create().
It does not include the "OR REPLACE" and "IF NOT EXISTS" parts, as these