[BUGFIX] fix lob bugs
This commit is contained in:
@ -62,7 +62,8 @@ private:
|
||||
PlanText &plan_text,
|
||||
common::ObObj &result);
|
||||
|
||||
static int set_display_result_for_mysql(PlanText &plan_text,
|
||||
static int set_display_result_for_mysql(sql::ObExecContext &ctx,
|
||||
PlanText &plan_text,
|
||||
common::ObObj &result);
|
||||
|
||||
static int get_plan_format(const ObString &format,
|
||||
|
||||
@ -138,13 +138,14 @@ int ob_adjust_lob_datum(const ObObj &origin_obj,
|
||||
out_datum.set_string(full_data);
|
||||
}
|
||||
} else { // origin obj does not have lob header, but meta has, build temp lob header
|
||||
OB_ASSERT(0); // should not come here?
|
||||
ObObj out_obj(origin_obj);
|
||||
if (OB_FAIL(ObTextStringResult::ob_convert_obj_temporay_lob(out_obj, allocator))) {
|
||||
LOG_WARN("Lob: failed to convert plain lob data to temp lob", K(ret));
|
||||
} else if (OB_FAIL(out_datum.from_obj(out_obj, obj_datum_map_))) {
|
||||
LOG_WARN("convert lob obj to datum failed", K(ret), K(out_obj));
|
||||
}
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpect for input obj, input obj should has lob header", K(ret), K(origin_obj), K(obj_meta));
|
||||
// ObObj out_obj(origin_obj);
|
||||
// if (OB_FAIL(ObTextStringResult::ob_convert_obj_temporay_lob(out_obj, allocator))) {
|
||||
// LOG_WARN("Lob: failed to convert plain lob data to temp lob", K(ret));
|
||||
// } else if (OB_FAIL(out_datum.from_obj(out_obj, obj_datum_map_))) {
|
||||
// LOG_WARN("convert lob obj to datum failed", K(ret), K(out_obj));
|
||||
// }
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@ -164,10 +164,20 @@ int ObLobSeqId::get_next_seq_id(ObString& seq_id, ObLobSeqId &end)
|
||||
seq_id.assign_ptr(buf_, len_);
|
||||
}
|
||||
} else {
|
||||
bool need_expend = false;
|
||||
uint64_t cur = digits_[dig_len_ - 1];
|
||||
// TODO @luohongdi.lhd. try smaller step rather than add digits
|
||||
cur += LOB_SEQ_STEP_LEN;
|
||||
if (cur > LOB_SEQ_STEP_MAX || compare(end) != -1) {
|
||||
if (cur > LOB_SEQ_STEP_MAX) {
|
||||
need_expend = true;
|
||||
} else {
|
||||
digits_[dig_len_ - 1] = cur;
|
||||
if (compare(end) != -1) {
|
||||
need_expend = true;
|
||||
}
|
||||
digits_[dig_len_ - 1] = (cur - LOB_SEQ_STEP_LEN);
|
||||
}
|
||||
if (need_expend) {
|
||||
if (OB_FAIL(add_digits(LOB_SEQ_ID_MIN)) || OB_FAIL(append_seq_buf(LOB_SEQ_ID_MIN))) {
|
||||
LOG_WARN("failed add seq node.", K(ret), K(len_), K(cap_), K(dig_len_), K(dig_cap_));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user