patch 4.0
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
#define _OB_SQL_INIT_H 1
|
||||
|
||||
#include "lib/alloc/malloc_hook.h"
|
||||
#include "engine/ob_phy_operator.h"
|
||||
#include "engine/ob_physical_plan.h"
|
||||
#include "sql/engine/expr/ob_sql_expression.h"
|
||||
#include "sql/engine/expr/ob_expr_operator.h"
|
||||
@ -23,11 +22,8 @@
|
||||
#include "sql/engine/expr/ob_expr_extra_info_factory.h"
|
||||
#include "sql/plan_cache/ob_plan_cache_value.h"
|
||||
#include "sql/plan_cache/ob_plan_set.h"
|
||||
#include "sql/executor/ob_root_transmit.h"
|
||||
#include "sql/executor/ob_distributed_scheduler.h"
|
||||
#include "sql/plan_cache/ob_lib_cache_register.h"
|
||||
#include "sql/executor/ob_task_runner_notifier_service.h"
|
||||
#include "sql/executor/ob_interm_result_manager.h"
|
||||
#include "sql/executor/ob_interm_result_pool.h"
|
||||
#include "sql/executor/ob_mini_task_executor.h"
|
||||
#include "sql/engine/px/ob_px_sqc_handler.h"
|
||||
#include "sql/ob_end_trans_callback.h"
|
||||
@ -36,9 +32,11 @@
|
||||
#include "share/object/ob_obj_cast.h"
|
||||
#include "engine/ob_serializable_function.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
// inline void register_phy_operator_classes()
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace sql
|
||||
{
|
||||
//inline void register_phy_operator_classes()
|
||||
//{
|
||||
// ObRootTransmit *root_trans = new (std::nothrow) ObRootTransmit();
|
||||
// delete root_trans;
|
||||
@ -46,26 +44,22 @@ namespace sql {
|
||||
|
||||
inline int init_sql_factories()
|
||||
{
|
||||
// ATTENTION: don't delete this log, it's used to init thread local variable LogBufferMgr in ObLog.
|
||||
//**注意**,不要把这行日志删了, 该日志是为了初始化ObLog中线程局部
|
||||
//变量LogBufferMgr, 避免其在jit malloc hook中进行该线程局部变量的
|
||||
//new操作,导致malloc hook和日志模块的循环调用。
|
||||
SQL_LOG(INFO, "init sql factories");
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(ObPxSqcHandlerFactory::get_instance()->init())) {
|
||||
SQL_LOG(ERROR, "failed to init sqc handler", K(ret));
|
||||
} else {
|
||||
ObExprOperatorFactory::register_expr_operators();
|
||||
ObExprExtraInfoFactory::register_expr_extra_infos();
|
||||
// register_phy_operator_classes();
|
||||
}
|
||||
if (OB_FAIL(ret)) {
|
||||
SQL_LOG(ERROR, "failed to init sql factories", K(ret));
|
||||
}
|
||||
return ret;
|
||||
ObExprOperatorFactory::register_expr_operators();
|
||||
ObExprExtraInfoFactory::register_expr_extra_infos();
|
||||
ObLibCacheRegister::register_cache_objs();
|
||||
//register_phy_operator_classes();
|
||||
return OB_SUCCESS;
|
||||
}
|
||||
|
||||
inline int init_sql_expr_static_var()
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
lib::ObMallocAllocator* allocator = NULL;
|
||||
lib::ObMallocAllocator *allocator = NULL;
|
||||
const lib::ObMemAttr attr(common::OB_SYS_TENANT_ID, ObModIds::OB_NUMBER);
|
||||
if (OB_FAIL(ObExprTRDateFormat::init())) {
|
||||
SQL_LOG(ERROR, "failed to init vars in oracle trunc", K(ret));
|
||||
@ -80,6 +74,8 @@ inline int init_sql_expr_static_var()
|
||||
SQL_LOG(ERROR, "failed to init ORACLE_ARITH_RESULT_TYPE", K(ret));
|
||||
} else if (OB_FAIL(ObCharsetUtils::init(*allocator))) {
|
||||
SQL_LOG(ERROR, "fail to init ObCharsetUtils", K(ret));
|
||||
} else if (OB_FAIL(ObCharset::init_charset())) {
|
||||
SQL_LOG(ERROR, "fail to init charset", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -87,16 +83,8 @@ inline int init_sql_expr_static_var()
|
||||
inline int init_sql_executor_singletons()
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(ObIntermResultItemPool::build_instance())) {
|
||||
SQL_LOG(ERROR, "fail to build ObIntermResultItemPool instance", K(ret));
|
||||
} else if (OB_FAIL(ObIntermResultPool::build_instance())) {
|
||||
SQL_LOG(ERROR, "fail to build ObIntermResultPool instance", K(ret));
|
||||
} else if (OB_FAIL(ObIntermResultManager::build_instance())) {
|
||||
SQL_LOG(ERROR, "fail to build ObIntermResultManager instance", K(ret));
|
||||
} else if (OB_FAIL(ObTaskRunnerNotifierService::build_instance())) {
|
||||
if (OB_FAIL(ObTaskRunnerNotifierService::build_instance())) {
|
||||
SQL_LOG(ERROR, "fail to build ObTaskRunnerNotifierService instance", K(ret));
|
||||
} else if (OB_FAIL(ObDistributedSchedulerManager::build_instance())) {
|
||||
SQL_LOG(ERROR, "fail to build ObDistributedSchedulerManager instance", K(ret));
|
||||
} else {
|
||||
ObFuncSerialization::init();
|
||||
}
|
||||
@ -110,7 +98,7 @@ inline void print_sql_stat()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
|
||||
#endif /* _OB_SQL_INIT_H */
|
||||
|
||||
Reference in New Issue
Block a user