Merge pull request #72834 from ClickHouse/fix-segfault-in-cascade-write-buffer

Fix segfault in CascadeWriteBuffer::getResultBuffers()
This commit is contained in:
Vitaly Baranov 2024-12-09 15:30:06 +00:00 committed by GitHub
commit 8b0d29241e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,9 @@ void CascadeWriteBuffer::nextImpl()
CascadeWriteBuffer::WriteBufferPtrs CascadeWriteBuffer::getResultBuffers()
{
if (!curr_buffer)
return {};
/// Sync position with underlying buffer before invalidating
curr_buffer->position() = position();