mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 22:22:00 +00:00
fix
This commit is contained in:
parent
8caf119e53
commit
f8d710dd84
@ -254,9 +254,12 @@ void ReadBufferAIO::prepare()
|
|||||||
/// Region of the disk from which we want to read data.
|
/// Region of the disk from which we want to read data.
|
||||||
const off_t region_begin = first_unread_pos_in_file;
|
const off_t region_begin = first_unread_pos_in_file;
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
if ((requested_byte_count > std::numeric_limits<off_t>::max()) ||
|
if ((requested_byte_count > std::numeric_limits<off_t>::max()) ||
|
||||||
(first_unread_pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(requested_byte_count))))
|
(first_unread_pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(requested_byte_count))))
|
||||||
throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);
|
throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
const off_t region_end = first_unread_pos_in_file + requested_byte_count;
|
const off_t region_end = first_unread_pos_in_file + requested_byte_count;
|
||||||
|
|
||||||
|
@ -274,9 +274,12 @@ void WriteBufferAIO::prepare()
|
|||||||
/// Region of the disk in which we want to write data.
|
/// Region of the disk in which we want to write data.
|
||||||
const off_t region_begin = pos_in_file;
|
const off_t region_begin = pos_in_file;
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
if ((flush_buffer.offset() > std::numeric_limits<off_t>::max()) ||
|
if ((flush_buffer.offset() > std::numeric_limits<off_t>::max()) ||
|
||||||
(pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(flush_buffer.offset()))))
|
(pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(flush_buffer.offset()))))
|
||||||
throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);
|
throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
const off_t region_end = pos_in_file + flush_buffer.offset();
|
const off_t region_end = pos_in_file + flush_buffer.offset();
|
||||||
const size_t region_size = region_end - region_begin;
|
const size_t region_size = region_end - region_begin;
|
||||||
|
Loading…
Reference in New Issue
Block a user