summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2021-11-29 18:55:16 +0600
committerEugene Kosov <claprix@yandex.ru>2021-12-03 01:16:51 +0600
commit881835f6943de9d06d26baafc2e2def802f97f2b (patch)
treee09707fde31c08aed12eada4f45cfd55a9bb0051
parentf9726ced257b8fdaa2e027464f45cd3d6b6f5728 (diff)
downloadmariadb-git-bb-10.5-MDEV-27139-file-offset-type.tar.gz
MDEV-27139 32-bit systems fail to use big innodb-log-file-sizebb-10.5-MDEV-27139-file-offset-type
log_write_buf(): do not cast to size_t which prevents to write to files which a bigger that 4G and remove useless assertion mapped_file_t::map(): cleanup
-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;