diff --git a/deps/oblib/src/common/object/ob_object.h b/deps/oblib/src/common/object/ob_object.h index c3a0c2348e..85a1ce1de0 100644 --- a/deps/oblib/src/common/object/ob_object.h +++ b/deps/oblib/src/common/object/ob_object.h @@ -1568,12 +1568,15 @@ public: OB_INLINE int get_json_print_data(ObString &json_data, char *buf, int64_t buf_len, int64_t &pos) const { int ret = OB_SUCCESS; json_data = get_string(); - if (!has_lob_header()) { + ObLobCommon* lob_comm = reinterpret_cast(json_data.ptr()); + bool bret = has_lob_header() || + (json_data.length() >= sizeof(ObLobCommon) && lob_comm->is_valid()); + if (!bret) { // if it called in log params, like K(json), it maybe a json with disk lob header only // cannot judge here is a plain json data or json data with disk lob header COMMON_LOG(DEBUG, "Lob: get json data without mem lob header", K(*this)); } else { - ObLobLocatorV2 loc(reinterpret_cast(v_.ptr_), val_len_, has_lob_header()); + ObLobLocatorV2 loc(reinterpret_cast(v_.ptr_), val_len_, bret); if (OB_UNLIKELY(!loc.is_valid(false))) { // do nothing, warn log inside COMMON_LOG(WARN, "Lob: invalid json lob", K(ret), K(json_data));