[FEAT MERGE]Query Interface Enhancement
Co-authored-by: chinaxing <chen.yack@gmail.com>
This commit is contained in:
@ -437,6 +437,7 @@ public:
|
||||
int create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var);
|
||||
int create_all_sys_vars();
|
||||
int free_sys_var(ObBasicSysVar *sys_var, int64_t sys_var_idx);
|
||||
static int create_sys_var(ObIAllocator &allocator_, ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var_ptr);
|
||||
static int calc_sys_var_store_idx(ObSysVarClassType sys_var_id, int64_t &store_idx);
|
||||
static int calc_sys_var_store_idx_by_name(const common::ObString &sys_var_name, int64_t &store_idx);
|
||||
static bool is_valid_sys_var_store_idx(int64_t store_idx);
|
||||
@ -869,26 +870,10 @@ int ObSysVarFactory::create_all_sys_vars()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var)
|
||||
int ObSysVarFactory::create_sys_var(ObIAllocator &allocator_, ObSysVarClassType sys_var_id,
|
||||
ObBasicSysVar *&sys_var_ptr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t store_idx = -1;
|
||||
ObBasicSysVar *sys_var_ptr = NULL;
|
||||
if (OB_FAIL(calc_sys_var_store_idx(sys_var_id, store_idx))) {
|
||||
LOG_WARN("fail to calc sys var store idx", K(ret), K(sys_var_id));
|
||||
} else if (store_idx < 0 || store_idx >= ALL_SYS_VARS_COUNT) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected store idx", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else if (OB_NOT_NULL(store_[store_idx])) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("store ptr shoule be null", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else {
|
||||
if (OB_NOT_NULL(store_buf_[store_idx])) {
|
||||
sys_var_ptr = store_buf_[store_idx];
|
||||
store_buf_[store_idx] = nullptr;
|
||||
}
|
||||
}
|
||||
if (OB_ISNULL(sys_var_ptr)) {
|
||||
switch(sys_var_id) {
|
||||
""")
|
||||
for (name, attributes) in list_sorted_by_id:
|
||||
@ -914,6 +899,32 @@ int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t store_idx = -1;
|
||||
ObBasicSysVar *sys_var_ptr = NULL;
|
||||
if (OB_FAIL(calc_sys_var_store_idx(sys_var_id, store_idx))) {
|
||||
LOG_WARN("fail to calc sys var store idx", K(ret), K(sys_var_id));
|
||||
} else if (store_idx < 0 || store_idx >= ALL_SYS_VARS_COUNT) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected store idx", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else if (OB_NOT_NULL(store_[store_idx])) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("store ptr shoule be null", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else {
|
||||
if (OB_NOT_NULL(store_buf_[store_idx])) {
|
||||
sys_var_ptr = store_buf_[store_idx];
|
||||
store_buf_[store_idx] = nullptr;
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && OB_ISNULL(sys_var_ptr)) {
|
||||
if (OB_FAIL(create_sys_var(allocator_, sys_var_id, sys_var_ptr))) {
|
||||
LOG_WARN("fail to calc sys var", K(ret), K(sys_var_id));
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_ISNULL(sys_var_ptr)) {
|
||||
|
||||
@ -3273,26 +3273,10 @@ int ObSysVarFactory::create_all_sys_vars()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var)
|
||||
int ObSysVarFactory::create_sys_var(ObIAllocator &allocator_, ObSysVarClassType sys_var_id,
|
||||
ObBasicSysVar *&sys_var_ptr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t store_idx = -1;
|
||||
ObBasicSysVar *sys_var_ptr = NULL;
|
||||
if (OB_FAIL(calc_sys_var_store_idx(sys_var_id, store_idx))) {
|
||||
LOG_WARN("fail to calc sys var store idx", K(ret), K(sys_var_id));
|
||||
} else if (store_idx < 0 || store_idx >= ALL_SYS_VARS_COUNT) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected store idx", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else if (OB_NOT_NULL(store_[store_idx])) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("store ptr shoule be null", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else {
|
||||
if (OB_NOT_NULL(store_buf_[store_idx])) {
|
||||
sys_var_ptr = store_buf_[store_idx];
|
||||
store_buf_[store_idx] = nullptr;
|
||||
}
|
||||
}
|
||||
if (OB_ISNULL(sys_var_ptr)) {
|
||||
switch(sys_var_id) {
|
||||
case SYS_VAR_AUTO_INCREMENT_INCREMENT: {
|
||||
void *ptr = NULL;
|
||||
@ -5809,6 +5793,32 @@ int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObSysVarFactory::create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t store_idx = -1;
|
||||
ObBasicSysVar *sys_var_ptr = NULL;
|
||||
if (OB_FAIL(calc_sys_var_store_idx(sys_var_id, store_idx))) {
|
||||
LOG_WARN("fail to calc sys var store idx", K(ret), K(sys_var_id));
|
||||
} else if (store_idx < 0 || store_idx >= ALL_SYS_VARS_COUNT) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected store idx", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else if (OB_NOT_NULL(store_[store_idx])) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("store ptr shoule be null", K(ret), K(store_idx), K(sys_var_id));
|
||||
} else {
|
||||
if (OB_NOT_NULL(store_buf_[store_idx])) {
|
||||
sys_var_ptr = store_buf_[store_idx];
|
||||
store_buf_[store_idx] = nullptr;
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && OB_ISNULL(sys_var_ptr)) {
|
||||
if (OB_FAIL(create_sys_var(allocator_, sys_var_id, sys_var_ptr))) {
|
||||
LOG_WARN("fail to calc sys var", K(ret), K(sys_var_id));
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (OB_ISNULL(sys_var_ptr)) {
|
||||
|
||||
@ -1660,6 +1660,7 @@ public:
|
||||
int create_sys_var(ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var);
|
||||
int create_all_sys_vars();
|
||||
int free_sys_var(ObBasicSysVar *sys_var, int64_t sys_var_idx);
|
||||
static int create_sys_var(ObIAllocator &allocator_, ObSysVarClassType sys_var_id, ObBasicSysVar *&sys_var_ptr);
|
||||
static int calc_sys_var_store_idx(ObSysVarClassType sys_var_id, int64_t &store_idx);
|
||||
static int calc_sys_var_store_idx_by_name(const common::ObString &sys_var_name, int64_t &store_idx);
|
||||
static bool is_valid_sys_var_store_idx(int64_t store_idx);
|
||||
|
||||
Reference in New Issue
Block a user