[ARRAY] fix array_remove core
This commit is contained in:
parent
4f73e22dae
commit
11fee84175
14
deps/oblib/src/lib/udt/ob_array_type.cpp
vendored
14
deps/oblib/src/lib/udt/ob_array_type.cpp
vendored
@ -609,12 +609,14 @@ int ObArrayBinary::get_data_binary(char *res_buf, int64_t buf_len)
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
OB_LOG(WARN, "buf len isn't enough", K(ret), K(buf_len));
|
||||
} else if (data_container_ == NULL) {
|
||||
uint32_t last_idx = length_ > 0 ? length_ - 1 : 0;
|
||||
MEMCPY(res_buf + pos, reinterpret_cast<char *>(null_bitmaps_), sizeof(uint8_t) * length_);
|
||||
pos += sizeof(uint8_t) * length_;
|
||||
MEMCPY(res_buf + pos, reinterpret_cast<char *>(offsets_), sizeof(uint32_t) * length_);
|
||||
pos += sizeof(uint32_t) * length_;
|
||||
MEMCPY(res_buf + pos, data_, offsets_[last_idx]);
|
||||
if (length_ > 0) {
|
||||
uint32_t last_idx = length_ - 1;
|
||||
MEMCPY(res_buf + pos, reinterpret_cast<char *>(null_bitmaps_), sizeof(uint8_t) * length_);
|
||||
pos += sizeof(uint8_t) * length_;
|
||||
MEMCPY(res_buf + pos, reinterpret_cast<char *>(offsets_), sizeof(uint32_t) * length_);
|
||||
pos += sizeof(uint32_t) * length_;
|
||||
MEMCPY(res_buf + pos, data_, offsets_[last_idx]);
|
||||
}
|
||||
} else {
|
||||
MEMCPY(res_buf + pos, reinterpret_cast<char *>(data_container_->null_bitmaps_.get_data()), sizeof(uint8_t) * data_container_->null_bitmaps_.size());
|
||||
pos += sizeof(uint8_t) * data_container_->null_bitmaps_.size();
|
||||
|
6
deps/oblib/src/lib/udt/ob_array_type.h
vendored
6
deps/oblib/src/lib/udt/ob_array_type.h
vendored
@ -936,8 +936,10 @@ public :
|
||||
{
|
||||
int32_t len = 0;
|
||||
if (this->data_container_ == NULL) {
|
||||
uint32_t last_idx = this->length_ > 0 ? this->length_ - 1 : 0;
|
||||
len = this->length_ * sizeof(uint8_t) + this->length_ * sizeof(uint32_t) + this->offsets_[last_idx];
|
||||
if (this->length_ > 0) {
|
||||
uint32_t last_idx = this->length_ - 1;
|
||||
len = this->length_ * sizeof(uint8_t) + this->length_ * sizeof(uint32_t) + this->offsets_[last_idx];
|
||||
}
|
||||
} else {
|
||||
len = sizeof(uint8_t) * data_container_->null_bitmaps_.size()
|
||||
+ sizeof(uint32_t) * data_container_->offsets_.size()
|
||||
|
Loading…
x
Reference in New Issue
Block a user