From 978179a9d4933d3d8d2ac99028798e8a07095dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 20 Feb 2017 17:58:42 +0200 Subject: MDEV-11520 Extending an InnoDB data file unnecessarily allocates a large memory buffer on Windows fil_extend_space_to_desired_size(), os_file_set_size(): Use calloc() for memory allocation, and handle failures. Properly check the return status of posix_fallocate(). On Windows, instead of extending the file by at most 1 megabyte at a time, write a zero-filled page at the end of the file. According to the Microsoft blog post https://blogs.msdn.microsoft.com/oldnewthing/20110922-00/?p=9573 this will physically extend the file by writing zero bytes. (InnoDB never uses DeviceIoControl() to set the file sparse.) For innodb_plugin, port the XtraDB fix for MySQL Bug#56433 (introducing fil_system->file_extend_mutex). The bug was fixed differently in MySQL 5.6 (and MariaDB Server 10.0). --- storage/innobase/include/sync0sync.h | 1 + 1 file changed, 1 insertion(+) (limited to 'storage/innobase/include/sync0sync.h') diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index bc8d0d27be3..f074ca2f189 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -675,6 +675,7 @@ or row lock! */ #define SYNC_BUF_BLOCK 146 /* Block mutex */ #define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */ #define SYNC_DOUBLEWRITE 140 +#define SYNC_OUTER_ANY_LATCH 136 #define SYNC_ANY_LATCH 135 #define SYNC_MEM_HASH 131 #define SYNC_MEM_POOL 130 -- cgit v1.2.1