提交 9add78d4 编写于 作者: L LINxiansheng 提交者: wangzelin.wzl

fix two bugs:

上级 90003168
......@@ -176,7 +176,10 @@ int ObRSTCollector::flush_query_response_time(uint64_t tenant_id,const ObString&
int ObRSTCollector::enable_query_response_time(uint64_t tenant_id){
int ret = OB_SUCCESS;
if (OB_FAIL(ret = collector_map_.set_refactored(tenant_id, new ObRSTTimeCollector()))) {
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id));
if(tenant_config->query_response_time_stats){
SERVER_LOG(INFO, "query_response_time_stats already turn on", K(ret), K(tenant_id));
} else if (OB_FAIL(ret = collector_map_.set_refactored(tenant_id, new ObRSTTimeCollector()))) {
if (OB_HASH_EXIST == ret) {
ret = OB_ERR_ALREADY_EXISTS;
}
......@@ -186,7 +189,10 @@ int ObRSTCollector::enable_query_response_time(uint64_t tenant_id){
int ObRSTCollector::free_query_response_time(uint64_t tenant_id){
int ret = OB_SUCCESS;
if (OB_FAIL(collector_map_.erase_refactored(tenant_id))) {
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id));
if(!tenant_config->query_response_time_stats){
SERVER_LOG(INFO, "query_response_time_stats already turn off", K(ret), K(tenant_id));
} else if (OB_FAIL(collector_map_.erase_refactored(tenant_id))) {
SERVER_LOG(WARN,"erase the time collector failed", K(tenant_id));
}
return ret;
......
......@@ -1113,7 +1113,7 @@ int ObShowResolver::resolve(const ParseNode& parse_tree)
} else {
show_resv_ctx.stmt_type_ = stmt::T_SHOW_QUERY_RESPONSE_TIME;
GEN_SQL_STEP_1(ObShowSqlSet::SHOW_QUERY_RESPONSE_TIME);
GEN_SQL_STEP_2(ObShowSqlSet::SHOW_QUERY_RESPONSE_TIME, OB_INFORMATION_SCHEMA_NAME, OB_QUERY_RESPONSE_TIME_TNAME);
GEN_SQL_STEP_2(ObShowSqlSet::SHOW_QUERY_RESPONSE_TIME, OB_SYS_DATABASE_NAME, OB_ALL_VIRTUAL_QUERY_RESPONSE_TIME_TNAME);
}
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册