From eb7239f45526812b8f777f30f2cbbe3c3071c9fb Mon Sep 17 00:00:00 2001 From: skylhd Date: Wed, 20 Sep 2023 16:30:41 +0000 Subject: [PATCH] [CP][BUGFIX] fix table get lob aux table id --- src/rootserver/ob_ddl_operator.cpp | 4 ++-- src/rootserver/ob_ddl_service.cpp | 8 ++++---- src/share/schema/ob_multi_version_schema_service.cpp | 2 +- src/share/schema/ob_table_schema.cpp | 2 +- src/share/schema/ob_table_schema.h | 1 + 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/rootserver/ob_ddl_operator.cpp b/src/rootserver/ob_ddl_operator.cpp index cd7eb2a9d3..13f46b689b 100644 --- a/src/rootserver/ob_ddl_operator.cpp +++ b/src/rootserver/ob_ddl_operator.cpp @@ -3588,10 +3588,10 @@ int ObDDLOperator::update_aux_table( } } else if (table_type == AUX_LOB_META) { lob_meta_table_id = new_table_schema.get_aux_lob_meta_tid(); - N = new_table_schema.has_lob_column() ? 1 : 0; + N = new_table_schema.has_lob_aux_table() ? 1 : 0; } else if (table_type == AUX_LOB_PIECE) { lob_piece_table_id = new_table_schema.get_aux_lob_piece_tid(); - N = new_table_schema.has_lob_column() ? 1 : 0; + N = new_table_schema.has_lob_aux_table() ? 1 : 0; } else { ret = OB_ERR_UNEXPECTED; LOG_WARN("invalid table type", K(ret), K(table_type)); diff --git a/src/rootserver/ob_ddl_service.cpp b/src/rootserver/ob_ddl_service.cpp index aa1c9b26e8..5efbcd468e 100755 --- a/src/rootserver/ob_ddl_service.cpp +++ b/src/rootserver/ob_ddl_service.cpp @@ -14239,10 +14239,10 @@ int ObDDLService::drop_aux_table_in_truncate( } } else if (table_type == AUX_LOB_META) { lob_meta_table_id = orig_table_schema.get_aux_lob_meta_tid(); - N = orig_table_schema.has_lob_column() ? 1 : 0; + N = orig_table_schema.has_lob_aux_table() ? 1 : 0; } else if (table_type == AUX_LOB_PIECE) { lob_piece_table_id = orig_table_schema.get_aux_lob_piece_tid(); - N = orig_table_schema.has_lob_column() ? 1 : 0; + N = orig_table_schema.has_lob_aux_table() ? 1 : 0; } else { ret = OB_ERR_UNEXPECTED; LOG_WARN("table type is invalide", K(ret), K(table_type)); @@ -19371,10 +19371,10 @@ int ObDDLService::flashback_aux_table( } } else if (table_type == AUX_LOB_META) { lob_meta_table_id = table_schema.get_aux_lob_meta_tid(); - N = table_schema.has_lob_column() ? 1 : 0; + N = table_schema.has_lob_aux_table() ? 1 : 0; } else if (table_type == AUX_LOB_PIECE) { lob_piece_table_id = table_schema.get_aux_lob_piece_tid(); - N = table_schema.has_lob_column() ? 1 : 0; + N = table_schema.has_lob_aux_table() ? 1 : 0; } else { ret = OB_ERR_UNEXPECTED; LOG_WARN("Invalid table type.", K(ret), K(table_type)); diff --git a/src/share/schema/ob_multi_version_schema_service.cpp b/src/share/schema/ob_multi_version_schema_service.cpp index 0753ceb540..7a3715e3ce 100644 --- a/src/share/schema/ob_multi_version_schema_service.cpp +++ b/src/share/schema/ob_multi_version_schema_service.cpp @@ -4801,7 +4801,7 @@ int ObMultiVersionSchemaService::cal_purge_table_timeout_( } } // get lob table id - if (OB_SUCC(ret) && orig_table_schema->has_lob_column()) { + if (OB_SUCC(ret) && orig_table_schema->has_lob_aux_table()) { uint64_t mtid = orig_table_schema->get_aux_lob_meta_tid(); uint64_t ptid = orig_table_schema->get_aux_lob_piece_tid(); if (OB_INVALID_ID == mtid || OB_INVALID_ID == ptid) { diff --git a/src/share/schema/ob_table_schema.cpp b/src/share/schema/ob_table_schema.cpp index 070e5cbb78..b32c64dd3b 100644 --- a/src/share/schema/ob_table_schema.cpp +++ b/src/share/schema/ob_table_schema.cpp @@ -6329,7 +6329,7 @@ bool ObTableSchema::has_lob_column() const { bool bool_ret = false; - bool_ret = (aux_lob_meta_tid_ != OB_INVALID_ID && aux_lob_piece_tid_ != OB_INVALID_ID); + bool_ret = has_lob_aux_table(); for (int64_t i = 0; !bool_ret && i < column_cnt_; ++i) { ObColumnSchemaV2& col = *column_array_[i]; if (is_lob_storage(col.get_data_type())) { diff --git a/src/share/schema/ob_table_schema.h b/src/share/schema/ob_table_schema.h index 0c3e11c247..2930317e78 100644 --- a/src/share/schema/ob_table_schema.h +++ b/src/share/schema/ob_table_schema.h @@ -1444,6 +1444,7 @@ public: uint64_t get_aux_lob_meta_tid() const { return aux_lob_meta_tid_; } 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); } 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)