Skip to content

Commit

Permalink
Merge pull request #52621 from valbok/readbuffer
Browse files Browse the repository at this point in the history
MaterializedMySQL: Fix the infinite loop in ReadBuffer::read
  • Loading branch information
kssenii committed Aug 7, 2023
2 parents e593efc + 3cea474 commit b1f0cb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/IO/MySQLPacketPayloadReadBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ bool MySQLPacketPayloadReadBuffer::nextImpl()
}

in.nextIfAtEnd();
/// Don't return a buffer when no bytes available
if (!in.hasPendingData())
return false;
working_buffer = ReadBuffer::Buffer(in.position(), in.buffer().end());
size_t count = std::min(in.available(), payload_length - offset);
working_buffer.resize(count);
Expand Down

0 comments on commit b1f0cb8

Please sign in to comment.