mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
decdd4bf49
When MariaDB Server is run in a container under Windows Subsystem for Linux, the fstat(2) system calls that InnoDB invokes in os_file_set_size() or os_file_get_size() are causing a failure in case the file had been renamed in the past while the file handle was open. This affects at least ALTER TABLE and OPTIMIZE TABLE. os_file_get_size(): Invoke lseek(2) instead of fstat(2). We do not mind if the file pointer is moving to the end of the file, because InnoDB exclusively invokes positioned reads and writes, or in some rare cases, appends to an existing file. os_file_set_size(): Invoke os_file_get_size() instead of fstat(2). Define the POSIX and Windows versions separately. Formerly, the Windows version was called os_file_change_size_win32(). fil_node_t::read_page0(): Use os_file_get_size() to determine the size, and do not crash on error. fil_node_t::read_metadata(): Remove the non-Windows stat* parameter and always invoke fstat(2) outside Windows, but do tolerate errors. Because fstat(2) is more likely to fail than lseek(2), and this is not time critical code, we can afford the extra lseek(2) system call. Reviewed by: Vladislav Vaintroub |
||
---|---|---|
.. | ||
fil0crypt.cc | ||
fil0fil.cc | ||
fil0pagecompress.cc |