From 7695ff8035805e7553641112573505e303d0da26 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 15 Jul 2019 18:02:43 +0300 Subject: [PATCH] Fix build in gcc9 --- dbms/src/IO/ReadBufferAIO.cpp | 2 +- dbms/src/IO/WriteBufferAIO.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/IO/ReadBufferAIO.cpp b/dbms/src/IO/ReadBufferAIO.cpp index f47e04bff75..162a83b7b94 100644 --- a/dbms/src/IO/ReadBufferAIO.cpp +++ b/dbms/src/IO/ReadBufferAIO.cpp @@ -254,7 +254,7 @@ void ReadBufferAIO::prepare() /// Region of the disk from which we want to read data. const off_t region_begin = first_unread_pos_in_file; - if ((requested_byte_count > std::numeric_limits::max()) || + if ((static_cast(requested_byte_count) > std::numeric_limits::max()) || (first_unread_pos_in_file > (std::numeric_limits::max() - static_cast(requested_byte_count)))) throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR); diff --git a/dbms/src/IO/WriteBufferAIO.cpp b/dbms/src/IO/WriteBufferAIO.cpp index 2fe7da27809..37661473d9c 100644 --- a/dbms/src/IO/WriteBufferAIO.cpp +++ b/dbms/src/IO/WriteBufferAIO.cpp @@ -274,7 +274,7 @@ void WriteBufferAIO::prepare() /// Region of the disk in which we want to write data. const off_t region_begin = pos_in_file; - if ((flush_buffer.offset() > std::numeric_limits::max()) || + if ((static_cast(flush_buffer.offset()) > std::numeric_limits::max()) || (pos_in_file > (std::numeric_limits::max() - static_cast(flush_buffer.offset())))) throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR);