mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Reserve enough memory for memcpySmallAllowReadWriteOverflow15
This commit is contained in:
parent
569b8487e8
commit
c4e1d09c66
@ -670,8 +670,7 @@ struct ArrayElementStringImpl
|
|||||||
ColumnArray::Offset current_offset = 0;
|
ColumnArray::Offset current_offset = 0;
|
||||||
/// get the total result bytes at first, and reduce the cost of result_data.resize.
|
/// get the total result bytes at first, and reduce the cost of result_data.resize.
|
||||||
size_t total_result_bytes = 0;
|
size_t total_result_bytes = 0;
|
||||||
ColumnString::Chars zero_buf(1);
|
ColumnString::Chars zero_buf(16, '\0'); /// Needs 15 extra bytes for memcpySmallAllowReadWriteOverflow15
|
||||||
zero_buf.push_back(0);
|
|
||||||
std::vector<std::pair<const ColumnString::Char *, UInt64>> selected_bufs;
|
std::vector<std::pair<const ColumnString::Char *, UInt64>> selected_bufs;
|
||||||
selected_bufs.reserve(size);
|
selected_bufs.reserve(size);
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
@ -737,8 +736,7 @@ struct ArrayElementStringImpl
|
|||||||
size_t size = offsets.size();
|
size_t size = offsets.size();
|
||||||
result_offsets.resize(size);
|
result_offsets.resize(size);
|
||||||
|
|
||||||
ColumnString::Chars zero_buf(1);
|
ColumnString::Chars zero_buf(16, '\0'); /// Needs 15 extra bytes for memcpySmallAllowReadWriteOverflow15
|
||||||
zero_buf.push_back(0);
|
|
||||||
ColumnArray::Offset current_offset = 0;
|
ColumnArray::Offset current_offset = 0;
|
||||||
/// get the total result bytes at first, and reduce the cost of result_data.resize.
|
/// get the total result bytes at first, and reduce the cost of result_data.resize.
|
||||||
size_t total_result_bytes = 0;
|
size_t total_result_bytes = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user