修复obrowkey反序列化bug导致建多分区表内存膨胀的问题

This commit is contained in:
obdev
2023-07-26 09:12:47 +00:00
committed by ob-robot
parent f8af7ea99a
commit cd9798ae42
3 changed files with 16 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;