Fix errors

This commit is contained in:
Alexey Milovidov 2021-07-11 05:43:54 +03:00
parent 52a234b048
commit 2d02a3a45d
2 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ off_t ReadBufferFromFileDescriptor::seek(off_t offset, int whence)
watch.stop();
ProfileEvents::increment(ProfileEvents::DiskReadElapsedMicroseconds, watch.elapsedMicroseconds());
file_offset_of_buffer_end = new_pos;
file_offset_of_buffer_end = seek_pos;
if (offset_after_seek_pos > 0)
ignore(offset_after_seek_pos);

View File

@ -56,10 +56,10 @@ std::unique_ptr<ReadBufferFromFileBase> createReadBufferFromFileBase(
auto align_up = [=](size_t value) { return (value + min_alignment - 1) / min_alignment * min_alignment; };
if (alignment % min_alignment)
{
if (alignment == 0)
alignment = min_alignment;
else if (alignment % min_alignment)
alignment = align_up(alignment);
}
if (buffer_size % min_alignment)
{