fix print remote sql info coredump

This commit is contained in:
leslieyuchen
2022-03-15 12:02:28 +08:00
committed by LINxiansheng
parent 58698cf43a
commit a4d3ae7db7
5 changed files with 33 additions and 10 deletions

View File

@ -21,12 +21,37 @@
#include "sql/engine/ob_exec_context.h"
#include "sql/engine/ob_physical_plan.h"
#include "sql/engine/px/ob_dfo.h"
#include "lib/utility/ob_print_utils.h"
namespace oceanbase {
using namespace common;
using namespace share;
using namespace transaction;
namespace sql {
ObPhysicalPlanCtx::ObPhysicalPlanCtx(common::ObIAllocator& allocator)
DEF_TO_STRING(ObRemoteSqlInfo)
{
int64_t pos = 0;
J_OBJ_START();
J_KV(K_(use_ps), K_(is_batched_stmt), K_(ps_param_cnt), K_(remote_sql));
J_COMMA();
J_NAME("ps_params");
J_COLON();
if (OB_ISNULL(ps_params_) || ps_param_cnt_ <= 0) {
J_NULL();
} else {
J_ARRAY_START();
for (int64_t i = 0; pos < buf_len && i < ps_param_cnt_; ++i) {
BUF_PRINTO(ps_params_->at(i));
if (i != ps_param_cnt_ - 1) {
J_COMMA();
}
}
J_ARRAY_END();
}
J_OBJ_END();
return pos;
}
ObPhysicalPlanCtx::ObPhysicalPlanCtx(common::ObIAllocator &allocator)
: allocator_(allocator),
tenant_id_(OB_INVALID_ID),
tsc_snapshot_timestamp_(0),