Skip to content

Commit

Permalink
MDEV-31628: InnoDB reports the wrong system tablespace size on bootstrap
Browse files Browse the repository at this point in the history
SysTablespace::set_size(): Use correct 64-bit arithmetics for
reporting the initial size of the InnoDB system or temporary tablespace.
  • Loading branch information
dr-m committed Jul 5, 2023
1 parent 35de832 commit b1317c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions storage/innobase/fsp/fsp0sysspace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,19 +393,19 @@ SysTablespace::set_size(
Datafile& file)
{
ut_ad(!srv_read_only_mode || m_ignore_read_only);
const ib::bytes_iec b{uint64_t{file.m_size} << srv_page_size_shift};

/* We created the data file and now write it full of zeros */
ib::info() << "Setting file '" << file.filepath() << "' size to "
<< ib::bytes_iec{file.m_size << srv_page_size_shift} <<
". Physically writing the file full; Please wait ...";
ib::info() << "Setting file '" << file.filepath() << "' size to " << b
<< ". Physically writing the file full; Please wait ...";

bool success = os_file_set_size(
file.m_filepath, file.m_handle,
static_cast<os_offset_t>(file.m_size) << srv_page_size_shift);

if (success) {
ib::info() << "File '" << file.filepath() << "' size is now "
<< ib::bytes_iec{file.m_size << srv_page_size_shift}
<< b
<< ".";
} else {
ib::error() << "Could not set the file size of '"
Expand Down

0 comments on commit b1317c1

Please sign in to comment.