Fix FastParserRes memory leak caused by remote plan
This commit is contained in:
@ -1071,6 +1071,9 @@ int ObSql::handle_remote_query(const ObRemoteSqlInfo &remote_sql_info, ObSqlCtx
|
|||||||
// is recorded on the control server, and there is no need to record it here
|
// is recorded on the control server, and there is no need to record it here
|
||||||
// Otherwise it will cause repeated warning messages
|
// Otherwise it will cause repeated warning messages
|
||||||
ob_reset_tsi_warning_buffer();
|
ob_reset_tsi_warning_buffer();
|
||||||
|
if (NULL != pc_ctx) {
|
||||||
|
pc_ctx->~ObPlanCacheCtx();
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1216,13 +1219,9 @@ inline int ObSql::handle_text_query(const ObString &stmt, ObSqlCtx &context, ObR
|
|||||||
LOG_WARN("fail to handle after get plan", K(ret));
|
LOG_WARN("fail to handle after get plan", K(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for inner sql, release the optimization memory
|
|
||||||
if (!THIS_WORKER.has_req_flag()) {
|
|
||||||
// only for inner sql
|
|
||||||
if (NULL != pc_ctx) {
|
if (NULL != pc_ctx) {
|
||||||
pc_ctx->~ObPlanCacheCtx();
|
pc_ctx->~ObPlanCacheCtx();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -385,11 +385,14 @@ struct ObPCParamEqualInfo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct ObFastParserResult {
|
struct ObFastParserResult {
|
||||||
|
private:
|
||||||
|
common::ModulePageAllocator inner_alloc_;
|
||||||
|
|
||||||
|
public:
|
||||||
ObFastParserResult()
|
ObFastParserResult()
|
||||||
: inner_alloc_("FastParserRes"), raw_params_(&inner_alloc_), ps_params_(&inner_alloc_), cache_params_(NULL)
|
: inner_alloc_("FastParserRes"), raw_params_(&inner_alloc_), ps_params_(&inner_alloc_), cache_params_(NULL)
|
||||||
{}
|
{}
|
||||||
ObPlanCacheKey pc_key_; // plan cache key, parameterized by fast parser
|
ObPlanCacheKey pc_key_; // plan cache key, parameterized by fast parser
|
||||||
common::ModulePageAllocator inner_alloc_;
|
|
||||||
common::ObFixedArray<ObPCParam *, common::ObIAllocator> raw_params_;
|
common::ObFixedArray<ObPCParam *, common::ObIAllocator> raw_params_;
|
||||||
common::ObFixedArray<const common::ObObjParam *, common::ObIAllocator> ps_params_;
|
common::ObFixedArray<const common::ObObjParam *, common::ObIAllocator> ps_params_;
|
||||||
ParamStore *cache_params_;
|
ParamStore *cache_params_;
|
||||||
|
|||||||
Reference in New Issue
Block a user