adjust subquery iter hash map memory mode && adjust table columns rewrite error code
This commit is contained in:
committed by
ob-robot
parent
a13159f429
commit
4f31c69e63
@ -933,7 +933,7 @@ int ObTableColumns::resolve_view_definition(
|
|||||||
K(select_stmt_node->type_));
|
K(select_stmt_node->type_));
|
||||||
} else if (OB_FAIL(select_resolver.resolve(*select_stmt_node))) {
|
} else if (OB_FAIL(select_resolver.resolve(*select_stmt_node))) {
|
||||||
LOG_WARN("resolve view definition failed", K(ret));
|
LOG_WARN("resolve view definition failed", K(ret));
|
||||||
if (OB_ALLOCATE_MEMORY_FAILED != ret) {
|
if (can_rewrite_error_code(ret)) {
|
||||||
ret = OB_ERR_VIEW_INVALID;
|
ret = OB_ERR_VIEW_INVALID;
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("failed to resolve view", K(ret));
|
LOG_WARN("failed to resolve view", K(ret));
|
||||||
@ -1125,5 +1125,15 @@ int64_t ObTableColumns::ColumnAttributes::get_data_length() const
|
|||||||
result_type_.get_accuracy().get_length() : ob_obj_type_size(result_type_.get_type());
|
result_type_.get_accuracy().get_length() : ob_obj_type_size(result_type_.get_type());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObTableColumns::can_rewrite_error_code(const int ret)
|
||||||
|
{
|
||||||
|
bool res = true;
|
||||||
|
if (OB_ALLOCATE_MEMORY_FAILED == ret
|
||||||
|
|| OB_SQL_RESOLVER_NO_MEMORY == ret) {
|
||||||
|
res = false;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
}/* ns observer*/
|
}/* ns observer*/
|
||||||
}/* ns oceanbase */
|
}/* ns oceanbase */
|
||||||
|
|||||||
@ -140,6 +140,7 @@ private:
|
|||||||
const int64_t buf_len,
|
const int64_t buf_len,
|
||||||
int64_t &pos);
|
int64_t &pos);
|
||||||
private:
|
private:
|
||||||
|
static bool can_rewrite_error_code(const int ret);
|
||||||
char type_str_[common::OB_MAX_SYS_PARAM_NAME_LENGTH];
|
char type_str_[common::OB_MAX_SYS_PARAM_NAME_LENGTH];
|
||||||
char *column_type_str_;
|
char *column_type_str_;
|
||||||
int64_t column_type_str_len_;
|
int64_t column_type_str_len_;
|
||||||
|
|||||||
@ -223,7 +223,7 @@ int ObSubQueryIterator::init_mem_entity()
|
|||||||
lib::ContextParam param;
|
lib::ContextParam param;
|
||||||
param.set_mem_attr(ObMemAttr(op_.get_exec_ctx().get_my_session()->get_effective_tenant_id(),
|
param.set_mem_attr(ObMemAttr(op_.get_exec_ctx().get_my_session()->get_effective_tenant_id(),
|
||||||
"SqlSQIterator",
|
"SqlSQIterator",
|
||||||
ObCtxIds::WORK_AREA));
|
ObCtxIds::DEFAULT_CTX_ID));
|
||||||
param.set_properties(lib::USE_TL_PAGE_OPTIONAL);
|
param.set_properties(lib::USE_TL_PAGE_OPTIONAL);
|
||||||
if (OB_FAIL(CURRENT_CONTEXT->CREATE_CONTEXT(mem_entity_, param))) {
|
if (OB_FAIL(CURRENT_CONTEXT->CREATE_CONTEXT(mem_entity_, param))) {
|
||||||
LOG_WARN("fail to create entity", K(ret));
|
LOG_WARN("fail to create entity", K(ret));
|
||||||
|
|||||||
@ -67,7 +67,10 @@ public:
|
|||||||
int init_mem_entity();
|
int init_mem_entity();
|
||||||
int init_hashmap(const int64_t param_num)
|
int init_hashmap(const int64_t param_num)
|
||||||
{
|
{
|
||||||
return hashmap_.create(param_num * 2, common::ObModIds::OB_HASH_BUCKET);
|
int64_t tenant_id = op_.get_exec_ctx().get_my_session()->get_effective_tenant_id();
|
||||||
|
return hashmap_.create(param_num * 2,
|
||||||
|
ObMemAttr(tenant_id, "SqlSQIterBKT", ObCtxIds::DEFAULT_CTX_ID),
|
||||||
|
ObMemAttr(tenant_id, "SqlSQIterND", ObCtxIds::DEFAULT_CTX_ID));
|
||||||
}
|
}
|
||||||
bool has_hashmap() const { return hashmap_.created(); }
|
bool has_hashmap() const { return hashmap_.created(); }
|
||||||
int init_probe_row(const int64_t cnt);
|
int init_probe_row(const int64_t cnt);
|
||||||
|
|||||||
Reference in New Issue
Block a user