Fix core caused by check_stmt_unique
This commit is contained in:
parent
66452923c0
commit
3d363ea059
@ -181,6 +181,21 @@ public:
|
||||
ObFdItemSet &fd_item_set,
|
||||
ObSqlBitSet<> &deduced_fd);
|
||||
|
||||
inline void destory()
|
||||
{
|
||||
DLIST_FOREACH_NORET(node, item_store_.get_obj_list()) {
|
||||
if (node != NULL && node->get_obj() != NULL) {
|
||||
node->get_obj()->~ObFdItem();
|
||||
}
|
||||
}
|
||||
DLIST_FOREACH_NORET(node, item_set_store_.get_obj_list()) {
|
||||
if (node != NULL && node->get_obj() != NULL) {
|
||||
node->get_obj()->~ObFdItemSet();
|
||||
}
|
||||
}
|
||||
parent_sets_.destroy();
|
||||
}
|
||||
|
||||
inline common::ObIAllocator &get_allocator() { return allocator_; }
|
||||
TO_STRING_KV("", "");
|
||||
private:
|
||||
|
@ -3463,7 +3463,7 @@ int ObRawExprDeduceType::add_implicit_cast_for_op_row(
|
||||
|| OB_ISNULL(child_ptr->get_param_expr(0))) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("child_ptr is NULL", K(ret), K(child_ptr));
|
||||
} else if (OB_FAIL(ObRawExprCopier::copy_expr_node(*expr_factory_,
|
||||
} else if (OB_FAIL(ObRawExprCopier::copy_expr_node(*child_ptr->get_expr_factory(),
|
||||
child_ptr,
|
||||
child_ptr))) {
|
||||
LOG_WARN("failed to copy expr node", K(ret));
|
||||
|
@ -3968,38 +3968,35 @@ int ObTransformUtils::check_exprs_unique_on_table_items(const ObDMLStmt *stmt,
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected null", K(ret));
|
||||
} else {
|
||||
lib::ContextParam param;
|
||||
param.set_mem_attr(session_info->get_effective_tenant_id(), "CheckUnique",
|
||||
ObCtxIds::DEFAULT_CTX_ID)
|
||||
.set_properties(lib::USE_TL_PAGE_OPTIONAL)
|
||||
.set_page_size(OB_MALLOC_NORMAL_BLOCK_SIZE);
|
||||
CREATE_WITH_TEMP_CONTEXT(param) {
|
||||
ObArenaAllocator &alloc = CURRENT_CONTEXT->get_arena_allocator();
|
||||
ObFdItemFactory fd_item_factory(alloc);
|
||||
ObRawExprFactory expr_factory(alloc);
|
||||
UniqueCheckHelper check_helper;
|
||||
check_helper.alloc_ = &alloc;
|
||||
check_helper.fd_factory_ = &fd_item_factory;
|
||||
check_helper.expr_factory_ = &expr_factory;
|
||||
check_helper.schema_checker_ = schema_checker;
|
||||
check_helper.session_info_ = session_info;
|
||||
UniqueCheckInfo res_info;
|
||||
ObRelIds all_tables;
|
||||
if (OB_FAIL(compute_tables_property(stmt, check_helper, table_items, conditions, res_info))) {
|
||||
LOG_WARN("failed to compute tables property", K(ret));
|
||||
} else if (OB_FAIL(get_rel_ids_from_tables(stmt, table_items, all_tables))) {
|
||||
LOG_WARN("failed to add members", K(ret));
|
||||
} else if (!is_strict && OB_FAIL(append(res_info.fd_sets_, res_info.candi_fd_sets_))) {
|
||||
// is strict, use fd_item_set & candi_fd_set check unique
|
||||
LOG_WARN("failed to append fd item sets", K(ret));
|
||||
} else if (OB_FAIL(ObOptimizerUtil::is_exprs_unique(exprs, all_tables, res_info.fd_sets_,
|
||||
res_info.equal_sets_,
|
||||
res_info.const_exprs_,
|
||||
is_unique))) {
|
||||
LOG_WARN("failed to check is exprs unique", K(ret));
|
||||
} else {
|
||||
LOG_TRACE("get is unique result", K(exprs), K(table_items), K(is_unique));
|
||||
}
|
||||
ObArenaAllocator alloc("CheckUnique", OB_MALLOC_NORMAL_BLOCK_SIZE,
|
||||
session_info->get_effective_tenant_id(),
|
||||
ObCtxIds::DEFAULT_CTX_ID);
|
||||
ObFdItemFactory fd_item_factory(alloc);
|
||||
ObRawExprFactory expr_factory(alloc);
|
||||
UniqueCheckHelper check_helper;
|
||||
check_helper.alloc_ = &alloc;
|
||||
check_helper.fd_factory_ = &fd_item_factory;
|
||||
check_helper.expr_factory_ = &expr_factory;
|
||||
check_helper.schema_checker_ = schema_checker;
|
||||
check_helper.session_info_ = session_info;
|
||||
UniqueCheckInfo res_info;
|
||||
ObRelIds all_tables;
|
||||
if (OB_FAIL(compute_tables_property(stmt, check_helper, table_items, conditions, res_info))) {
|
||||
LOG_WARN("failed to compute tables property", K(ret));
|
||||
} else if (OB_FAIL(get_rel_ids_from_tables(stmt, table_items, all_tables))) {
|
||||
LOG_WARN("failed to add members", K(ret));
|
||||
} else if (!is_strict && OB_FAIL(append(res_info.fd_sets_, res_info.candi_fd_sets_))) {
|
||||
// is strict, use fd_item_set & candi_fd_set check unique
|
||||
LOG_WARN("failed to append fd item sets", K(ret));
|
||||
} else if (OB_FAIL(ObOptimizerUtil::is_exprs_unique(exprs, all_tables, res_info.fd_sets_,
|
||||
res_info.equal_sets_,
|
||||
res_info.const_exprs_,
|
||||
is_unique))) {
|
||||
LOG_WARN("failed to check is exprs unique", K(ret));
|
||||
} else {
|
||||
fd_item_factory.destory();
|
||||
expr_factory.destory();
|
||||
LOG_TRACE("get is unique result", K(exprs), K(table_items), K(is_unique));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -4089,37 +4086,34 @@ int ObTransformUtils::check_stmt_unique(const ObSelectStmt *stmt,
|
||||
if (OB_FAIL(ret) || is_unique || !need_check) {
|
||||
/*do nothing*/
|
||||
} else {
|
||||
lib::ContextParam param;
|
||||
param.set_mem_attr(session_info->get_effective_tenant_id(), "CheckUnique",
|
||||
ObCtxIds::DEFAULT_CTX_ID)
|
||||
.set_properties(lib::USE_TL_PAGE_OPTIONAL)
|
||||
.set_page_size(OB_MALLOC_NORMAL_BLOCK_SIZE);
|
||||
CREATE_WITH_TEMP_CONTEXT(param) {
|
||||
ObArenaAllocator &alloc = CURRENT_CONTEXT->get_arena_allocator();
|
||||
ObFdItemFactory fd_item_factory(alloc);
|
||||
ObRawExprFactory expr_factory(alloc);
|
||||
UniqueCheckHelper check_helper;
|
||||
check_helper.alloc_ = &alloc;
|
||||
check_helper.fd_factory_ = &fd_item_factory;
|
||||
check_helper.expr_factory_ = &expr_factory;
|
||||
check_helper.schema_checker_ = schema_checker;
|
||||
check_helper.session_info_ = session_info;
|
||||
UniqueCheckInfo res_info;
|
||||
ObRelIds all_tables;
|
||||
if (OB_FAIL(compute_stmt_property(stmt, check_helper, res_info, extra_flags))) {
|
||||
LOG_WARN("failed to compute stmt property", K(ret));
|
||||
} else if (OB_FAIL(stmt->get_from_tables(all_tables))) {
|
||||
LOG_WARN("failed to get from tables", K(ret));
|
||||
} else if (!is_strict && OB_FAIL(append(res_info.fd_sets_, res_info.candi_fd_sets_))) {
|
||||
// is strict, use fd_item_set & candi_fd_set check unique
|
||||
LOG_WARN("failed to append fd item sets", K(ret));
|
||||
} else if (OB_FAIL(ObOptimizerUtil::is_exprs_unique(exprs, all_tables, res_info.fd_sets_,
|
||||
res_info.equal_sets_,
|
||||
res_info.const_exprs_, is_unique))) {
|
||||
LOG_WARN("failed to check is exprs unique", K(ret));
|
||||
} else {
|
||||
LOG_TRACE("get is unique result", K(ret), K(is_unique));
|
||||
}
|
||||
ObArenaAllocator alloc("CheckUnique", OB_MALLOC_NORMAL_BLOCK_SIZE,
|
||||
session_info->get_effective_tenant_id(),
|
||||
ObCtxIds::DEFAULT_CTX_ID);
|
||||
ObFdItemFactory fd_item_factory(alloc);
|
||||
ObRawExprFactory expr_factory(alloc);
|
||||
UniqueCheckHelper check_helper;
|
||||
check_helper.alloc_ = &alloc;
|
||||
check_helper.fd_factory_ = &fd_item_factory;
|
||||
check_helper.expr_factory_ = &expr_factory;
|
||||
check_helper.schema_checker_ = schema_checker;
|
||||
check_helper.session_info_ = session_info;
|
||||
UniqueCheckInfo res_info;
|
||||
ObRelIds all_tables;
|
||||
if (OB_FAIL(compute_stmt_property(stmt, check_helper, res_info, extra_flags))) {
|
||||
LOG_WARN("failed to compute stmt property", K(ret));
|
||||
} else if (OB_FAIL(stmt->get_from_tables(all_tables))) {
|
||||
LOG_WARN("failed to get from tables", K(ret));
|
||||
} else if (!is_strict && OB_FAIL(append(res_info.fd_sets_, res_info.candi_fd_sets_))) {
|
||||
// is strict, use fd_item_set & candi_fd_set check unique
|
||||
LOG_WARN("failed to append fd item sets", K(ret));
|
||||
} else if (OB_FAIL(ObOptimizerUtil::is_exprs_unique(exprs, all_tables, res_info.fd_sets_,
|
||||
res_info.equal_sets_,
|
||||
res_info.const_exprs_, is_unique))) {
|
||||
LOG_WARN("failed to check is exprs unique", K(ret));
|
||||
} else {
|
||||
fd_item_factory.destory();
|
||||
expr_factory.destory();
|
||||
LOG_TRACE("get is unique result", K(ret), K(is_unique));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
36
tools/deploy/obd/jdbc.yaml.template
Normal file
36
tools/deploy/obd/jdbc.yaml.template
Normal file
@ -0,0 +1,36 @@
|
||||
oceanbase-ce:
|
||||
servers:
|
||||
- name: server1
|
||||
ip: 127.0.0.1
|
||||
server1:
|
||||
mysql_port: ${mysql_port}
|
||||
rpc_port: ${rpc_port}
|
||||
home_path: ${home_path}
|
||||
zone: zone1
|
||||
# The directory for data storage. The default value is home_path/store.
|
||||
# data_dir: /data
|
||||
# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
|
||||
# redo_dir: /redo
|
||||
|
||||
tag: latest
|
||||
include: obd/observer.include.yaml
|
||||
global:
|
||||
log_disk_size: '240G'
|
||||
# for default system config used by farm, please see tools/deploy/obd/observer.include.yaml
|
||||
# You can also specify the configuration directly below (stored locally, switching the working directory and redeploying will still take effect)
|
||||
home_path: /data/{user}/{deploy_name}/observer/{server}
|
||||
production_mode: false
|
||||
memory_limit: '50G'
|
||||
system_memory: '3G'
|
||||
datafile_size: '40G'
|
||||
# cpu_count: '24'
|
||||
obproxy-ce:
|
||||
servers:
|
||||
- 127.0.0.1
|
||||
global:
|
||||
listen_port: ${proxy_listen_port}
|
||||
prometheus_listen_port: ${prometheus_listen_port}
|
||||
home_path: ${proxy_home_path}
|
||||
include: obd/obproxy.include.yaml
|
||||
depends:
|
||||
- oceanbase-ce
|
36
tools/deploy/obd/oci.yaml.template
Normal file
36
tools/deploy/obd/oci.yaml.template
Normal file
@ -0,0 +1,36 @@
|
||||
oceanbase-ce:
|
||||
servers:
|
||||
- name: server1
|
||||
ip: 127.0.0.1
|
||||
server1:
|
||||
mysql_port: ${mysql_port}
|
||||
rpc_port: ${rpc_port}
|
||||
home_path: ${home_path}
|
||||
zone: zone1
|
||||
# The directory for data storage. The default value is home_path/store.
|
||||
# data_dir: /data
|
||||
# The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
|
||||
# redo_dir: /redo
|
||||
|
||||
tag: latest
|
||||
include: obd/observer.include.yaml
|
||||
global:
|
||||
log_disk_size: '240G'
|
||||
# for default system config used by farm, please see tools/deploy/obd/observer.include.yaml
|
||||
# You can also specify the configuration directly below (stored locally, switching the working directory and redeploying will still take effect)
|
||||
home_path: /data/{user}/{deploy_name}/observer/{server}
|
||||
production_mode: false
|
||||
memory_limit: '80G'
|
||||
system_memory: '10G'
|
||||
datafile_size: '40G'
|
||||
# cpu_count: '24'
|
||||
obproxy-ce:
|
||||
servers:
|
||||
- 127.0.0.1
|
||||
global:
|
||||
listen_port: ${proxy_listen_port}
|
||||
prometheus_listen_port: ${prometheus_listen_port}
|
||||
home_path: ${proxy_home_path}
|
||||
include: obd/obproxy.include.yaml
|
||||
depends:
|
||||
- oceanbase-ce
|
Loading…
x
Reference in New Issue
Block a user