More approprate fix

This commit is contained in:
kssenii 2021-07-14 20:15:05 +03:00
parent 1993d8e0f4
commit f9a2c39701
2 changed files with 4 additions and 6 deletions

View File

@ -352,10 +352,6 @@ static ReturnType parseJSONEscapeSequence(Vector & s, ReadBuffer & buf)
++buf.position();
/// It is possible that current buffer ends with `\` (start of escape sequence), oef is not reached,
/// but there is no pending data yet. Without this wait we will read beyond the end of current buffer in code below.
while (!buf.eof() && !buf.hasPendingData()) {}
if (buf.eof())
return error("Cannot parse escape sequence", ErrorCodes::CANNOT_PARSE_ESCAPE_SEQUENCE);
@ -1150,8 +1146,6 @@ bool loadAtPosition(ReadBuffer & in, DB::Memory<> & memory, char * & current)
if (current < in.buffer().end())
return true;
while (!in.eof() && !in.hasPendingData()) {}
saveUpToPosition(in, memory, current);
bool loaded_more = !in.eof();

View File

@ -56,6 +56,10 @@ bool ZstdInflatingReadBuffer::nextImpl()
eof = true;
return !working_buffer.empty();
}
else if (output.pos == 0)
{
return nextImpl();
}
return true;
}