diff --git a/src/share/schema/ob_schema_service.cpp b/src/share/schema/ob_schema_service.cpp index 52370920f4..9defcb8e76 100644 --- a/src/share/schema/ob_schema_service.cpp +++ b/src/share/schema/ob_schema_service.cpp @@ -439,6 +439,7 @@ int AlterTableSchema::assign(const ObTableSchema &src_schema) aux_lob_meta_tid_ = src_schema.aux_lob_meta_tid_; aux_lob_piece_tid_ = src_schema.aux_lob_piece_tid_; + mlog_tid_ = src_schema.mlog_tid_; } if (OB_SUCC(ret)) { diff --git a/src/share/schema/ob_table_schema.cpp b/src/share/schema/ob_table_schema.cpp index 280f11444c..d2fbe105a3 100644 --- a/src/share/schema/ob_table_schema.cpp +++ b/src/share/schema/ob_table_schema.cpp @@ -1522,6 +1522,7 @@ int ObTableSchema::assign(const ObTableSchema &src_schema) lob_inrow_threshold_ = src_schema.lob_inrow_threshold_; is_column_store_supported_ = src_schema.is_column_store_supported_; max_used_column_group_id_ = src_schema.max_used_column_group_id_; + mlog_tid_ = src_schema.mlog_tid_; if (OB_FAIL(deep_copy_str(src_schema.tablegroup_name_, tablegroup_name_))) { LOG_WARN("Fail to deep copy tablegroup_name", K(ret)); } else if (OB_FAIL(deep_copy_str(src_schema.comment_, comment_))) { @@ -3340,6 +3341,7 @@ void ObTableSchema::reset() column_group_arr_ = NULL; cg_id_hash_arr_ = NULL; cg_name_hash_arr_ = NULL; + mlog_tid_ = OB_INVALID_ID; ObSimpleTableSchemaV2::reset(); } @@ -6195,7 +6197,8 @@ int64_t ObTableSchema::to_string(char *buf, const int64_t buf_len) const K_(is_column_store_supported), K_(max_used_column_group_id), K_(column_group_cnt), - "column_group_array", ObArrayWrap(column_group_arr_, column_group_cnt_)); + "column_group_array", ObArrayWrap(column_group_arr_, column_group_cnt_), + K_(mlog_tid)); J_OBJ_END(); return pos; @@ -6478,6 +6481,7 @@ OB_DEF_SERIALIZE(ObTableSchema) } }(); + OB_UNIS_ENCODE(mlog_tid_); return ret; } @@ -6907,6 +6911,7 @@ OB_DEF_DESERIALIZE(ObTableSchema) } }(); + OB_UNIS_DECODE(mlog_tid_); return ret; } @@ -7058,6 +7063,7 @@ OB_DEF_SERIALIZE_SIZE(ObTableSchema) } OB_UNIS_ADD_LEN(is_column_store_supported_); OB_UNIS_ADD_LEN(max_used_column_group_id_); + OB_UNIS_ADD_LEN(mlog_tid_); return len; } @@ -8687,7 +8693,8 @@ int64_t ObPrintableTableSchema::to_string(char *buf, const int64_t buf_len) cons K_(aux_lob_meta_tid), K_(aux_lob_piece_tid), K_(is_column_store_supported), - K_(max_used_column_group_id) + K_(max_used_column_group_id), + K_(mlog_tid) ); J_OBJ_END(); return pos; diff --git a/src/share/schema/ob_table_schema.h b/src/share/schema/ob_table_schema.h index 8942749944..f07e5a3275 100644 --- a/src/share/schema/ob_table_schema.h +++ b/src/share/schema/ob_table_schema.h @@ -1567,6 +1567,7 @@ public: uint64_t get_aux_lob_piece_tid() const { return aux_lob_piece_tid_; } bool has_lob_column() const; bool has_lob_aux_table() const { return (aux_lob_meta_tid_ != OB_INVALID_ID && aux_lob_piece_tid_ != OB_INVALID_ID); } + bool has_mlog_table() const { return (OB_INVALID_ID != mlog_tid_); } inline void add_table_flag(uint64_t flag) { table_flags_ |= flag; } inline void del_table_flag(uint64_t flag) { table_flags_ &= ~flag; } inline void add_or_del_table_flag(uint64_t flag, bool is_add) @@ -1593,6 +1594,8 @@ public: rls_group_ids_.reset(); rls_context_ids_.reset(); } + void set_mlog_tid(const uint64_t& table_id) { mlog_tid_ = table_id; } + uint64_t get_mlog_tid() const { return mlog_tid_; } DECLARE_VIRTUAL_TO_STRING; protected: @@ -1795,6 +1798,7 @@ protected: int64_t column_group_arr_capacity_; CgIdHashArray *cg_id_hash_arr_; CgNameHashArray *cg_name_hash_arr_; + uint64_t mlog_tid_; }; class ObPrintableTableSchema final : public ObTableSchema diff --git a/src/sql/das/ob_das_dml_ctx_define.h b/src/sql/das/ob_das_dml_ctx_define.h index 2bf7220cde..f32f6e61c7 100644 --- a/src/sql/das/ob_das_dml_ctx_define.h +++ b/src/sql/das/ob_das_dml_ctx_define.h @@ -76,7 +76,8 @@ public: uint64_t is_batch_stmt_ : 1; uint64_t is_insert_up_ : 1; uint64_t is_table_api_ : 1; - uint64_t reserved_ : 59; + uint64_t is_access_mlog_as_master_table_ : 1; + uint64_t reserved_ : 58; }; }; protected: