Bug #79150 InnoDB: Remove runtime checks for 32-bit file offsets
Submitted: 6 Nov 2015 8:58 Modified: 12 Nov 2015 19:56
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[6 Nov 2015 8:58] Marko Mäkelä
Description:
The InnoDB source code contains some checks for 32-bit off_t (file offset), trying to detect overflow when accessing files that exceed the 4 GiB barrier created by a 32-bit off_t.

MySQL 5.7 supports only two 32-bit operating systems: Microsoft Windows, and various versions of Linux.

cmake/os/Linux.cmake unconditionally defines the following:
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)

On Windows, we do not use off_t for file offset arithmetics, except in os_file_check_args().

How to repeat:
Read the code.

Suggested fix:
Remove os_file_check_args(), and make Tablespace::get_sum_of_sizes() always return the sum of sizes, never ULINT_UNDEFINED.
[12 Nov 2015 19:56] Daniel Price
Fixed as of the upcoming 5.7.11, 5.8.0 release, and here's the changelog entry:

Unreachable code that checks for 32-bit file offsets was removed.
[18 Jun 2016 21:28] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0