OB query sql_id field in VIEW gv$sql_audit display error
This commit is contained in:
@ -3183,8 +3183,10 @@ int ObSql::handle_physical_plan(
|
|||||||
} else if (context.multi_stmt_item_.is_batched_multi_stmt() && is_valid && session.use_static_typing_engine()) {
|
} else if (context.multi_stmt_item_.is_batched_multi_stmt() && is_valid && session.use_static_typing_engine()) {
|
||||||
ret = STATIC_ENG_NOT_IMPLEMENT;
|
ret = STATIC_ENG_NOT_IMPLEMENT;
|
||||||
LOG_WARN("static engine not implement batched multi stmt, will retry", K(ret));
|
LOG_WARN("static engine not implement batched multi stmt, will retry", K(ret));
|
||||||
} else if (OB_FAIL(generate_sql_id(pc_ctx, add_plan_to_pc))) {
|
}
|
||||||
LOG_WARN("fail to generate sql id", K(ret));
|
generate_sql_id(pc_ctx, add_plan_to_pc, ret);
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
|
// do nothing
|
||||||
} else if (OB_FAIL(generate_physical_plan(parse_result, &pc_ctx, context, result))) {
|
} else if (OB_FAIL(generate_physical_plan(parse_result, &pc_ctx, context, result))) {
|
||||||
if (OB_ERR_PROXY_REROUTE == ret) {
|
if (OB_ERR_PROXY_REROUTE == ret) {
|
||||||
LOG_DEBUG("Failed to generate plan", K(ret));
|
LOG_DEBUG("Failed to generate plan", K(ret));
|
||||||
@ -3412,16 +3414,14 @@ int ObSql::replace_const_expr(ObRawExpr* raw_expr, ParamStore& param_store)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObSql::generate_sql_id(ObPlanCacheCtx& pc_ctx, bool add_plan_to_pc)
|
void ObSql::generate_sql_id(ObPlanCacheCtx &pc_ctx, bool add_plan_to_pc, int err_code)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
if (add_plan_to_pc == false || pc_ctx.is_ps_mode_ || OB_SUCCESS != err_code) {
|
||||||
if (add_plan_to_pc == false || pc_ctx.is_ps_mode_) {
|
|
||||||
(void)ObSQLUtils::md5(pc_ctx.raw_sql_, pc_ctx.sql_ctx_.sql_id_, (int32_t)sizeof(pc_ctx.sql_ctx_.sql_id_));
|
(void)ObSQLUtils::md5(pc_ctx.raw_sql_, pc_ctx.sql_ctx_.sql_id_, (int32_t)sizeof(pc_ctx.sql_ctx_.sql_id_));
|
||||||
} else {
|
} else {
|
||||||
(void)ObSQLUtils::md5(
|
(void)ObSQLUtils::md5(
|
||||||
pc_ctx.bl_key_.constructed_sql_, pc_ctx.sql_ctx_.sql_id_, (int32_t)sizeof(pc_ctx.sql_ctx_.sql_id_));
|
pc_ctx.bl_key_.constructed_sql_, pc_ctx.sql_ctx_.sql_id_, (int32_t)sizeof(pc_ctx.sql_ctx_.sql_id_));
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObSql::calc_pre_calculable_exprs(const ObDMLStmt& stmt, const ObIArray<ObHiddenColumnItem>& calculable_exprs,
|
int ObSql::calc_pre_calculable_exprs(const ObDMLStmt& stmt, const ObIArray<ObHiddenColumnItem>& calculable_exprs,
|
||||||
|
|||||||
@ -291,7 +291,7 @@ private:
|
|||||||
|
|
||||||
int replace_const_expr(common::ObIArray<ObRawExpr*>& raw_exprs, ParamStore& param_store);
|
int replace_const_expr(common::ObIArray<ObRawExpr*>& raw_exprs, ParamStore& param_store);
|
||||||
int replace_const_expr(ObRawExpr* raw_expr, ParamStore& param_store);
|
int replace_const_expr(ObRawExpr* raw_expr, ParamStore& param_store);
|
||||||
int generate_sql_id(ObPlanCacheCtx& pc_ctx, bool add_plan_to_pc);
|
void generate_sql_id(ObPlanCacheCtx& pc_ctx, bool add_plan_to_pc, int err_code);
|
||||||
int pc_add_plan(ObPlanCacheCtx& pc_ctx, ObResultSet& result, ObOutlineState& outline_state, ObPlanCache* plan_cache);
|
int pc_add_plan(ObPlanCacheCtx& pc_ctx, ObResultSet& result, ObOutlineState& outline_state, ObPlanCache* plan_cache);
|
||||||
// Check whether the parameterized template SQL can be prepared
|
// Check whether the parameterized template SQL can be prepared
|
||||||
void check_template_sql_can_be_prepare(ObPlanCacheCtx& pc_ctx, ObPhysicalPlan& plan);
|
void check_template_sql_can_be_prepare(ObPlanCacheCtx& pc_ctx, ObPhysicalPlan& plan);
|
||||||
|
|||||||
Reference in New Issue
Block a user