mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Fix unit tests
This commit is contained in:
parent
b4ef10ad1c
commit
72dbc8205b
@ -251,7 +251,16 @@ void WriteBufferFromAzureBlobStorage::allocateBuffer()
|
||||
/// First buffer was already allocated in BufferWithOwnMemory constructor with buffer size provided in constructor.
|
||||
/// It will be reallocated in subsequent nextImpl calls up to the desired buffer size from buffer_allocation_policy.
|
||||
if (buffer_allocation_policy->getBufferNumber() == 1)
|
||||
{
|
||||
/// Reduce memory size if initial size was larger then desired size from buffer_allocation_policy.
|
||||
/// Usually it doesn't happen but we have it in unit tests.
|
||||
if (memory.size() > buffer_allocation_policy->getBufferSize())
|
||||
{
|
||||
memory.resize(buffer_allocation_policy->getBufferSize());
|
||||
WriteBuffer::set(memory.data(), memory.size());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
auto size = buffer_allocation_policy->getBufferSize();
|
||||
memory = Memory(size);
|
||||
|
@ -355,7 +355,16 @@ void WriteBufferFromS3::allocateBuffer()
|
||||
/// First buffer was already allocated in BufferWithOwnMemory constructor with provided in constructor buffer size.
|
||||
/// It will be reallocated in subsequent nextImpl calls up to the desired buffer size from buffer_allocation_policy.
|
||||
if (buffer_allocation_policy->getBufferNumber() == 1)
|
||||
{
|
||||
/// Reduce memory size if initial size was larger then desired size from buffer_allocation_policy.
|
||||
/// Usually it doesn't happen but we have it in unit tests.
|
||||
if (memory.size() > buffer_allocation_policy->getBufferSize())
|
||||
{
|
||||
memory.resize(buffer_allocation_policy->getBufferSize());
|
||||
WriteBuffer::set(memory.data(), memory.size());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
memory = Memory(buffer_allocation_policy->getBufferSize());
|
||||
WriteBuffer::set(memory.data(), memory.size());
|
||||
|
Loading…
Reference in New Issue
Block a user