[BUGFIX] fix ObTextStringIter ctx init to nullptr

This commit is contained in:
obdev
2023-03-23 07:12:03 +00:00
committed by ob-robot
parent a12694fff8
commit 54f9ade886
5 changed files with 14 additions and 11 deletions

View File

@ -116,7 +116,7 @@ public:
bool has_lob_header) : bool has_lob_header) :
type_(type), cs_type_(cs_type), is_init_(false), is_lob_(false), is_outrow_(false), type_(type), cs_type_(cs_type), is_init_(false), is_lob_(false), is_outrow_(false),
has_lob_header_(has_lob_header), state_(TEXTSTRING_ITER_INVALID), datum_str_(datum_str), has_lob_header_(has_lob_header), state_(TEXTSTRING_ITER_INVALID), datum_str_(datum_str),
err_ret_(OB_SUCCESS) ctx_(nullptr), err_ret_(OB_SUCCESS)
{ {
if (is_lob_storage(type)) { if (is_lob_storage(type)) {
validate_has_lob_header(has_lob_header_); validate_has_lob_header(has_lob_header_);
@ -126,7 +126,7 @@ public:
ObTextStringIter(const ObObj &obj) : ObTextStringIter(const ObObj &obj) :
type_(obj.get_type()), cs_type_(obj.get_collation_type()), is_init_(false), is_lob_(false), type_(obj.get_type()), cs_type_(obj.get_collation_type()), is_init_(false), is_lob_(false),
is_outrow_(false), has_lob_header_(obj.has_lob_header()), state_(TEXTSTRING_ITER_INVALID), is_outrow_(false), has_lob_header_(obj.has_lob_header()), state_(TEXTSTRING_ITER_INVALID),
datum_str_(obj.get_string()), err_ret_(OB_SUCCESS) datum_str_(obj.get_string()), ctx_(nullptr), err_ret_(OB_SUCCESS)
{ {
if (is_lob_storage(obj.get_type())) { if (is_lob_storage(obj.get_type())) {
validate_has_lob_header(has_lob_header_); validate_has_lob_header(has_lob_header_);

View File

@ -28,6 +28,9 @@ typedef struct ObLobPieceInfo ObLobPieceInfo;
// TODO interface define // TODO interface define
class ObILobApator { class ObILobApator {
public: public:
virtual int write_lob_meta(ObLobAccessParam &param, ObLobMetaInfo& row_info) = 0;
virtual int update_lob_meta(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row) = 0;
virtual int erase_lob_meta(ObLobAccessParam &param, ObLobMetaInfo& row_info) = 0;
virtual int scan_lob_meta(const ObLobAccessParam &param, ObTableScanParam &scan_param, common::ObNewRowIterator *&meta_iter_) = 0; virtual int scan_lob_meta(const ObLobAccessParam &param, ObTableScanParam &scan_param, common::ObNewRowIterator *&meta_iter_) = 0;
virtual int get_lob_data(ObLobAccessParam &param, uint64_t piece_id, ObLobPieceInfo& info) = 0; virtual int get_lob_data(ObLobAccessParam &param, uint64_t piece_id, ObLobPieceInfo& info) = 0;
virtual int revert_scan_iter(common::ObNewRowIterator *iter) = 0; virtual int revert_scan_iter(common::ObNewRowIterator *iter) = 0;

View File

@ -673,7 +673,7 @@ int ObLobMetaWriteIter::close()
int ObLobMetaManager::write(ObLobAccessParam& param, ObLobMetaInfo& in_row) int ObLobMetaManager::write(ObLobAccessParam& param, ObLobMetaInfo& in_row)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (OB_FAIL(persistent_lob_adapter_.write_lob_meta_tablet(param, in_row))) { if (OB_FAIL(persistent_lob_adapter_.write_lob_meta(param, in_row))) {
LOG_WARN("write lob meta failed.", K(ret), K(param)); LOG_WARN("write lob meta failed.", K(ret), K(param));
} }
return ret; return ret;
@ -721,7 +721,7 @@ int ObLobMetaManager::scan(ObLobAccessParam& param, ObLobMetaScanIter &iter)
int ObLobMetaManager::erase(ObLobAccessParam& param, ObLobMetaInfo& in_row) int ObLobMetaManager::erase(ObLobAccessParam& param, ObLobMetaInfo& in_row)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (OB_FAIL(persistent_lob_adapter_.erase_lob_meta_tablet(param, in_row))) { if (OB_FAIL(persistent_lob_adapter_.erase_lob_meta(param, in_row))) {
LOG_WARN("erase lob meta failed.", K(ret), K(param)); LOG_WARN("erase lob meta failed.", K(ret), K(param));
} }
return ret; return ret;
@ -731,7 +731,7 @@ int ObLobMetaManager::erase(ObLobAccessParam& param, ObLobMetaInfo& in_row)
int ObLobMetaManager::update(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row) int ObLobMetaManager::update(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (OB_FAIL(persistent_lob_adapter_.update_lob_meta_tablet(param, old_row, new_row))) { if (OB_FAIL(persistent_lob_adapter_.update_lob_meta(param, old_row, new_row))) {
LOG_WARN("update lob meta failed."); LOG_WARN("update lob meta failed.");
} }
return ret; return ret;

View File

@ -362,7 +362,7 @@ int ObPersistentLobApator::build_lob_meta_table_dml(
return ret; return ret;
} }
int ObPersistentLobApator::erase_lob_meta_tablet(ObLobAccessParam &param, ObLobMetaInfo& in_row) int ObPersistentLobApator::erase_lob_meta(ObLobAccessParam &param, ObLobMetaInfo& in_row)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
@ -477,7 +477,7 @@ int ObPersistentLobApator::erase_lob_piece_tablet(ObLobAccessParam& param, ObLob
return ret; return ret;
} }
int ObPersistentLobApator::write_lob_meta_tablet(ObLobAccessParam& param, ObLobMetaInfo& in_row) int ObPersistentLobApator::write_lob_meta(ObLobAccessParam& param, ObLobMetaInfo& in_row)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
@ -528,7 +528,7 @@ int ObPersistentLobApator::write_lob_meta_tablet(ObLobAccessParam& param, ObLobM
return ret; return ret;
} }
int ObPersistentLobApator::update_lob_meta_tablet(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row) int ObPersistentLobApator::update_lob_meta(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;

View File

@ -56,17 +56,17 @@ public:
virtual int revert_scan_iter(common::ObNewRowIterator *iter) override; virtual int revert_scan_iter(common::ObNewRowIterator *iter) override;
virtual int fetch_lob_id(const ObLobAccessParam& param, uint64_t &lob_id) override; virtual int fetch_lob_id(const ObLobAccessParam& param, uint64_t &lob_id) override;
// write meta tablet // write meta tablet
int write_lob_meta_tablet(ObLobAccessParam &param, ObLobMetaInfo& row_info); virtual int write_lob_meta(ObLobAccessParam &param, ObLobMetaInfo& row_info) override;
// write piece tablet // write piece tablet
int write_lob_piece_tablet(ObLobAccessParam& param, ObLobPieceInfo& in_row); int write_lob_piece_tablet(ObLobAccessParam& param, ObLobPieceInfo& in_row);
// erase meta tablet item // erase meta tablet item
int erase_lob_meta_tablet(ObLobAccessParam &param, ObLobMetaInfo& row_info); virtual int erase_lob_meta(ObLobAccessParam &param, ObLobMetaInfo& row_info) override;
// erase piece tablet item // erase piece tablet item
int erase_lob_piece_tablet(ObLobAccessParam& param, ObLobPieceInfo& in_row); int erase_lob_piece_tablet(ObLobAccessParam& param, ObLobPieceInfo& in_row);
// update piece tabliet item // update piece tabliet item
int update_lob_piece_tablet(ObLobAccessParam& param, ObLobPieceInfo& in_row); int update_lob_piece_tablet(ObLobAccessParam& param, ObLobPieceInfo& in_row);
// update lob meta tablet item // update lob meta tablet item
int update_lob_meta_tablet(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row); virtual int update_lob_meta(ObLobAccessParam& param, ObLobMetaInfo& old_row, ObLobMetaInfo& new_row) override;
private: private:
// get schema from schema service // get schema from schema service
int get_lob_tablet_schema( int get_lob_tablet_schema(