[CP] CRASH ERROR improve

This commit is contained in:
tushicheng
2024-02-04 09:12:28 +00:00
committed by ob-robot
parent 5e08668e62
commit 6acb97c9f6
9 changed files with 30 additions and 258 deletions

View File

@ -12,10 +12,10 @@
#define USING_LOG_PREFIX SQL_ENG
#include "ob_expr_json_search.h"
#include "util/easy_string.h"
#include "sql/engine/expr/ob_expr_util.h"
#include "share/object/ob_obj_cast.h"
#include "sql/session/ob_sql_session_info.h"
#include "lib/signal/safe_snprintf.h"
#include "ob_expr_json_func_helper.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;
@ -168,7 +168,7 @@ int ObExprJsonSearch::find_matches(common::ObIAllocator *allocator,
} else {
uint64_t reserve_len = i == 0 ? 3 : static_cast<uint64_t>(std::log10(i)) + 3;
char temp_buf[reserve_len + 1];
int64_t count = safe_snprintf(temp_buf, reserve_len + 1, "[%lu]", i);
int64_t count = lnprintf(temp_buf, reserve_len + 1, "[%lu]", i);
if (count < 0) {
LOG_WARN("fail to snprintf", K(i), K(count));
} else if (OB_FAIL(path.append(temp_buf, count))) {