mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Slightly better
This commit is contained in:
parent
cbf5913109
commit
bdb69b8f08
@ -74,13 +74,13 @@ off_t MMapReadBufferFromFileDescriptor::seek(off_t offset, int whence)
|
||||
else if (whence == SEEK_CUR)
|
||||
new_pos = count() + offset;
|
||||
else
|
||||
throw Exception("MMapReadBufferFromFileDescriptor::seek expects SEEK_SET or SEEK_CUR as whence", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
throw Exception(ErrorCodes::ARGUMENT_OUT_OF_BOUND, "MMapReadBufferFromFileDescriptor::seek expects SEEK_SET or SEEK_CUR as whence");
|
||||
|
||||
working_buffer = internal_buffer;
|
||||
if (new_pos < 0 || new_pos > off_t(working_buffer.size()))
|
||||
throw Exception("Cannot seek through file " + getFileName()
|
||||
+ " because seek position (" + toString(new_pos) + ") is out of bounds [0, " + toString(working_buffer.size()) + "]",
|
||||
ErrorCodes::CANNOT_SEEK_THROUGH_FILE);
|
||||
throw Exception(ErrorCodes::CANNOT_SEEK_THROUGH_FILE,
|
||||
"Cannot seek through file {} because seek position ({}) is out of bounds [0, {}]",
|
||||
getFileName(), new_pos, working_buffer.size());
|
||||
|
||||
position() = working_buffer.begin() + new_pos;
|
||||
return new_pos;
|
||||
|
@ -69,13 +69,13 @@ off_t MMapReadBufferFromFileWithCache::seek(off_t offset, int whence)
|
||||
else if (whence == SEEK_CUR)
|
||||
new_pos = count() + offset;
|
||||
else
|
||||
throw Exception("MMapReadBufferFromFileWithCache::seek expects SEEK_SET or SEEK_CUR as whence", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
throw Exception(ErrorCodes::ARGUMENT_OUT_OF_BOUND, "MMapReadBufferFromFileWithCache::seek expects SEEK_SET or SEEK_CUR as whence");
|
||||
|
||||
working_buffer = internal_buffer;
|
||||
if (new_pos < 0 || new_pos > off_t(working_buffer.size()))
|
||||
throw Exception("Cannot seek through file " + getFileName()
|
||||
+ " because seek position (" + toString(new_pos) + ") is out of bounds [0, " + toString(working_buffer.size()) + "]",
|
||||
ErrorCodes::CANNOT_SEEK_THROUGH_FILE);
|
||||
throw Exception(ErrorCodes::CANNOT_SEEK_THROUGH_FILE,
|
||||
"Cannot seek through file {} because seek position ({}) is out of bounds [0, {}]",
|
||||
getFileName(), new_pos, working_buffer.size());
|
||||
|
||||
position() = working_buffer.begin() + new_pos;
|
||||
return new_pos;
|
||||
|
Loading…
Reference in New Issue
Block a user