diff --git a/sql/handler.cc b/sql/handler.cc index 58253b90594..897d468f2ba 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -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; diff --git a/sql/handler.h b/sql/handler.h index 8f31f741eab..d2d49b4601c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -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 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 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