修复obrowkey反序列化bug导致建多分区表内存膨胀的问题
This commit is contained in:
5
deps/oblib/src/common/rowkey/ob_rowkey.cpp
vendored
5
deps/oblib/src/common/rowkey/ob_rowkey.cpp
vendored
@ -294,7 +294,7 @@ int ObRowkey::serialize(char *buf, const int64_t buf_len, int64_t &pos) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRowkey::deserialize(const char *buf, const int64_t buf_len, int64_t &pos)
|
||||
int ObRowkey::deserialize(const char *buf, const int64_t buf_len, int64_t &pos, bool check_zero /*= false*/)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t obj_cnt = 0;
|
||||
@ -332,6 +332,9 @@ int ObRowkey::deserialize(const char *buf, const int64_t buf_len, int64_t &pos)
|
||||
KP(buf), K(buf_len), K(pos), K(obj_cnt), K(ret));
|
||||
}
|
||||
}
|
||||
} else if (check_zero && obj_cnt == 0) {
|
||||
// Prevent the reserved obj array not aware the obj is empty when obj_cnt = 0
|
||||
obj_cnt_ = obj_cnt;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
2
deps/oblib/src/common/rowkey/ob_rowkey.h
vendored
2
deps/oblib/src/common/rowkey/ob_rowkey.h
vendored
@ -101,7 +101,7 @@ public:
|
||||
|
||||
int serialize(char *buf, const int64_t buf_len, int64_t &pos) const;
|
||||
int64_t get_serialize_size(void) const;
|
||||
int deserialize(const char *buf, const int64_t buf_len, int64_t &pos);
|
||||
int deserialize(const char *buf, const int64_t buf_len, int64_t &pos, bool check_zero = false);
|
||||
|
||||
int serialize_objs(char *buf, const int64_t buf_len, int64_t &pos) const;
|
||||
int64_t get_serialize_objs_size(void) const;
|
||||
|
||||
Reference in New Issue
Block a user