add schema mod for 4.1
This commit is contained in:
@ -372,6 +372,8 @@ static const char* ref_info_type_strs[] = {
|
|||||||
"DIS_TASK_SPLITER",
|
"DIS_TASK_SPLITER",
|
||||||
"DAS_CTX",
|
"DAS_CTX",
|
||||||
"SCHEMA_RECORDER",
|
"SCHEMA_RECORDER",
|
||||||
|
"SPI_RESULT_SET",
|
||||||
|
"PL_PREPARE_RESULT",
|
||||||
"MOD_MAX",
|
"MOD_MAX",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -23,13 +23,13 @@ namespace oceanbase
|
|||||||
class ObSchemaSlot
|
class ObSchemaSlot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObSchemaSlot(): tenant_id_(OB_INVALID_TENANT_ID), slot_id_(OB_INVALID_INDEX),
|
ObSchemaSlot(): tenant_id_(OB_INVALID_TENANT_ID), slot_id_(OB_INVALID_INDEX),
|
||||||
schema_version_(OB_INVALID_VERSION), schema_count_(OB_INVALID_COUNT),
|
schema_version_(OB_INVALID_VERSION), schema_count_(OB_INVALID_COUNT),
|
||||||
ref_cnt_(OB_INVALID_COUNT), mod_ref_infos_() {}
|
ref_cnt_(OB_INVALID_COUNT), mod_ref_infos_() {}
|
||||||
~ObSchemaSlot() {}
|
~ObSchemaSlot() {}
|
||||||
void reset();
|
void reset();
|
||||||
void init(const uint64_t &tenant_id, const int64_t &slot_id,
|
void init(const uint64_t &tenant_id, const int64_t &slot_id,
|
||||||
const int64_t &schema_version, const int64_t &schema_count,
|
const int64_t &schema_version, const int64_t &schema_count,
|
||||||
const int64_t &ref_cnt, const common::ObString &str);
|
const int64_t &ref_cnt, const common::ObString &str);
|
||||||
uint64_t get_tenant_id() const { return tenant_id_; }
|
uint64_t get_tenant_id() const { return tenant_id_; }
|
||||||
int64_t get_slot_id() const { return slot_id_; }
|
int64_t get_slot_id() const { return slot_id_; }
|
||||||
@ -37,7 +37,7 @@ public:
|
|||||||
int64_t get_schema_count() const { return schema_count_; }
|
int64_t get_schema_count() const { return schema_count_; }
|
||||||
int64_t get_ref_cnt() const { return ref_cnt_;}
|
int64_t get_ref_cnt() const { return ref_cnt_;}
|
||||||
const common::ObString& get_mod_ref_infos() const { return mod_ref_infos_; }
|
const common::ObString& get_mod_ref_infos() const { return mod_ref_infos_; }
|
||||||
TO_STRING_KV(K_(tenant_id), K_(slot_id), K_(schema_version),
|
TO_STRING_KV(K_(tenant_id), K_(slot_id), K_(schema_version),
|
||||||
K_(schema_count), K_(ref_cnt), K_(mod_ref_infos));
|
K_(schema_count), K_(ref_cnt), K_(mod_ref_infos));
|
||||||
private:
|
private:
|
||||||
uint64_t tenant_id_;
|
uint64_t tenant_id_;
|
||||||
@ -46,7 +46,7 @@ private:
|
|||||||
int64_t schema_count_;
|
int64_t schema_count_;
|
||||||
int64_t ref_cnt_;
|
int64_t ref_cnt_;
|
||||||
common::ObString mod_ref_infos_;
|
common::ObString mod_ref_infos_;
|
||||||
};
|
};
|
||||||
namespace common
|
namespace common
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -89,6 +89,8 @@ struct ObSchemaMgrItem
|
|||||||
MOD_DIS_TASK_SPLITER = 26,
|
MOD_DIS_TASK_SPLITER = 26,
|
||||||
MOD_DAS_CTX = 27,
|
MOD_DAS_CTX = 27,
|
||||||
MOD_SCHEMA_RECORDER = 28,
|
MOD_SCHEMA_RECORDER = 28,
|
||||||
|
MOD_SPI_RESULT_SET = 29,
|
||||||
|
MOD_PL_PREPARE_RESULT = 30,
|
||||||
MOD_MAX
|
MOD_MAX
|
||||||
};
|
};
|
||||||
ObSchemaMgrItem()
|
ObSchemaMgrItem()
|
||||||
@ -142,7 +144,7 @@ public:
|
|||||||
const ObSchemaMgr *&schema_mgr,
|
const ObSchemaMgr *&schema_mgr,
|
||||||
ObSchemaMgrHandle &handle);
|
ObSchemaMgrHandle &handle);
|
||||||
int get_recycle_schema_version(int64_t &schema_version) const;
|
int get_recycle_schema_version(int64_t &schema_version) const;
|
||||||
int get_slot_info(common::ObIAllocator &allocator,
|
int get_slot_info(common::ObIAllocator &allocator,
|
||||||
common::ObIArray<ObSchemaSlot> &tenant_slot_infos);
|
common::ObIArray<ObSchemaSlot> &tenant_slot_infos);
|
||||||
int put(ObSchemaMgr *schema_mgr,
|
int put(ObSchemaMgr *schema_mgr,
|
||||||
ObSchemaMgr *&eli_schema_mgr,
|
ObSchemaMgr *&eli_schema_mgr,
|
||||||
@ -157,7 +159,7 @@ private:
|
|||||||
// need process in wlock
|
// need process in wlock
|
||||||
int try_update_latest_schema_idx();
|
int try_update_latest_schema_idx();
|
||||||
int get_ref_info_type_str_(const int64_t &index, const char *&type_str);
|
int get_ref_info_type_str_(const int64_t &index, const char *&type_str);
|
||||||
int build_ref_mod_infos_(const int64_t *mod_ref, char *&buff,
|
int build_ref_mod_infos_(const int64_t *mod_ref, char *&buff,
|
||||||
const int64_t &buf_len, common::ObString &str);
|
const int64_t &buf_len, common::ObString &str);
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(ObSchemaMgrCache);
|
DISALLOW_COPY_AND_ASSIGN(ObSchemaMgrCache);
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public:
|
|||||||
allocator_(ObModIds::OB_PL_TEMP),
|
allocator_(ObModIds::OB_PL_TEMP),
|
||||||
result_set_(NULL),
|
result_set_(NULL),
|
||||||
sql_ctx_(),
|
sql_ctx_(),
|
||||||
schema_guard_(),
|
schema_guard_(share::schema::ObSchemaMgrItem::MOD_SPI_RESULT_SET),
|
||||||
orign_nested_count_(-1),
|
orign_nested_count_(-1),
|
||||||
cursor_nested_count_(-1),
|
cursor_nested_count_(-1),
|
||||||
orign_session_value_(NULL),
|
orign_session_value_(NULL),
|
||||||
@ -272,7 +272,7 @@ public:
|
|||||||
mem_context_(nullptr),
|
mem_context_(nullptr),
|
||||||
mem_context_destroy_guard_(mem_context_),
|
mem_context_destroy_guard_(mem_context_),
|
||||||
sql_ctx_(),
|
sql_ctx_(),
|
||||||
schema_guard_() {}
|
schema_guard_(share::schema::ObSchemaMgrItem::MOD_PL_PREPARE_RESULT) {}
|
||||||
~PLPrepareResult() { reset(); }
|
~PLPrepareResult() { reset(); }
|
||||||
int init(sql::ObSQLSessionInfo &session_info);
|
int init(sql::ObSQLSessionInfo &session_info);
|
||||||
void reset()
|
void reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user