Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/util/mysql_row_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace doris {
static uint8_t NEXT_TWO_BYTE = 252;
static uint8_t NEXT_THREE_BYTE = 253;
static uint8_t NEXT_EIGHT_BYTE = 254;
static size_t EXTRA_RESERVE_BYTE = 16;

// the first byte:
// <= 250: length
Expand Down Expand Up @@ -133,7 +134,7 @@ int MysqlRowBuffer<is_binary_format>::reserve(int64_t size) {
return 0;
}

int64_t alloc_size = std::max(need_size, _buf_size * 2);
int64_t alloc_size = std::max(need_size, _buf_size * 2) + EXTRA_RESERVE_BYTE;
char* new_buf = new (std::nothrow) char[alloc_size];

if (nullptr == new_buf) {
Expand Down
Loading