summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/log/log0log.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index f677aedc87c..ee4a953ed10 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -235,19 +235,19 @@ dberr_t mapped_file_t::map(const char *path, bool read_only,
if (fd == -1)
return DB_ERROR;
- const auto file_size= os_file_get_size(path).m_total_size;
+ const auto file_size=
+ static_cast<size_t>(os_file_get_size(path).m_total_size);
const int nvme_flag= nvme ? MAP_SYNC : 0;
- void *ptr= my_mmap(0, static_cast<size_t>(file_size),
- read_only ? PROT_READ : PROT_READ | PROT_WRITE,
- MAP_SHARED_VALIDATE | nvme_flag, fd, 0);
+ void *ptr=
+ my_mmap(0, file_size, read_only ? PROT_READ : PROT_READ | PROT_WRITE,
+ MAP_SHARED_VALIDATE | nvme_flag, fd, 0);
mysql_file_close(fd, MYF(MY_WME));
if (ptr == MAP_FAILED)
return DB_ERROR;
- m_area= {static_cast<byte *>(ptr),
- static_cast<span<byte>::size_type>(file_size)};
+ m_area= {static_cast<byte *>(ptr), file_size};
return DB_SUCCESS;
}
@@ -610,9 +610,7 @@ loop:
log_block_store_checksum(buf + i * OS_FILE_LOG_BLOCK_SIZE);
}
- ut_a((next_offset >> srv_page_size_shift) <= ULINT_MAX);
-
- log_sys.log.write(static_cast<size_t>(next_offset), {buf, write_len});
+ log_sys.log.write(next_offset, {buf, write_len});
if (write_len < len) {
start_lsn += write_len;