diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-11-24 17:17:16 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-11-24 17:17:16 +0200 |
commit | f1cc6e387479b8d1ab559b3a9f1cc8675607f78a (patch) | |
tree | c7e72991c41baa9e2436cbc295e21ece203ccead /extra/mariabackup | |
parent | 6979d20426b222ecd4bcf3d69be161cc63d505d9 (diff) | |
parent | 316f0d8fe3f3eda61bfe1025ef59a93dde3c753b (diff) | |
download | mariadb-git-f1cc6e387479b8d1ab559b3a9f1cc8675607f78a.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'extra/mariabackup')
-rw-r--r-- | extra/mariabackup/crc/crc_glue.c | 2 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 27 |
2 files changed, 24 insertions, 5 deletions
diff --git a/extra/mariabackup/crc/crc_glue.c b/extra/mariabackup/crc/crc_glue.c index c301cb01e2e..11d2c21886b 100644 --- a/extra/mariabackup/crc/crc_glue.c +++ b/extra/mariabackup/crc/crc_glue.c @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include <string.h> #include <zlib.h> -#if __GNUC__ >= 4 && defined(__x86_64__) +#if defined(__GNUC__) && defined(__x86_64__) static int pclmul_enabled = 0; #endif diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index e9be1a9d915..71bac9b4951 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -4398,10 +4398,29 @@ xtrabackup_apply_delta( if (off == 0) { /* Read tablespace size from page 0, and extend the file to specified size.*/ - os_offset_t n_pages = mach_read_from_4(buf + FSP_HEADER_OFFSET + FSP_SIZE); - success = os_file_set_size(dst_path, dst_file, n_pages*page_size); - if (!success) - goto error; + os_offset_t n_pages = mach_read_from_4( + buf + FSP_HEADER_OFFSET + FSP_SIZE); + if (mach_read_from_4(buf + + FIL_PAGE_SPACE_ID)) { + if (!os_file_set_size( + dst_path, dst_file, + n_pages * page_size)) + goto error; + } else if (fil_space_t* space + = fil_space_acquire(0)) { + /* The system tablespace can + consist of multiple files. The + first one has full tablespace + size in page 0, but only the last + file should be extended. */ + fil_node_t* n = UT_LIST_GET_FIRST( + space->chain); + bool fail = !strcmp(n->name, dst_path) + && !fil_space_extend( + space, n_pages); + fil_space_release(space); + if (fail) goto error; + } } success = os_file_write(IORequestWrite, |