Commit f1cc6e38 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.1 into 10.2

parents 6979d204 316f0d8f
...@@ -42,7 +42,8 @@ MACRO(CHECK_DTRACE) ...@@ -42,7 +42,8 @@ MACRO(CHECK_DTRACE)
# On FreeBSD, dtrace does not handle userland tracing yet # On FreeBSD, dtrace does not handle userland tracing yet
IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
AND NOT BUGGY_GCC_NO_DTRACE_MODULES AND NOT BUGGY_GCC_NO_DTRACE_MODULES
AND NOT BUGGY_LINUX_DTRACE) AND NOT BUGGY_LINUX_DTRACE
AND NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace") SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace")
ENDIF() ENDIF()
SET(HAVE_DTRACE ${ENABLE_DTRACE}) SET(HAVE_DTRACE ${ENABLE_DTRACE})
......
...@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ...@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <string.h> #include <string.h>
#include <zlib.h> #include <zlib.h>
#if __GNUC__ >= 4 && defined(__x86_64__) #if defined(__GNUC__) && defined(__x86_64__)
static int pclmul_enabled = 0; static int pclmul_enabled = 0;
#endif #endif
......
...@@ -4398,10 +4398,29 @@ xtrabackup_apply_delta( ...@@ -4398,10 +4398,29 @@ xtrabackup_apply_delta(
if (off == 0) { if (off == 0) {
/* Read tablespace size from page 0, /* Read tablespace size from page 0,
and extend the file to specified size.*/ and extend the file to specified size.*/
os_offset_t n_pages = mach_read_from_4(buf + FSP_HEADER_OFFSET + FSP_SIZE); os_offset_t n_pages = mach_read_from_4(
success = os_file_set_size(dst_path, dst_file, n_pages*page_size); buf + FSP_HEADER_OFFSET + FSP_SIZE);
if (!success) 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; 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, success = os_file_write(IORequestWrite,
......
...@@ -2802,7 +2802,7 @@ sub mysql_server_start($) { ...@@ -2802,7 +2802,7 @@ sub mysql_server_start($) {
# Some InnoDB options are incompatible with the default bootstrap. # Some InnoDB options are incompatible with the default bootstrap.
# If they are used, re-bootstrap # If they are used, re-bootstrap
if ( $extra_opts and if ( $extra_opts and
"@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)/ ) "@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path/ )
{ {
mysql_install_db($mysqld, undef, $extra_opts); mysql_install_db($mysqld, undef, $extra_opts);
} }
......
--sequence --innodb-data-file-path=ibdata_first:3M;ibdata_second:1M:autoextend
\ No newline at end of file
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
# Create full backup , modify table, then create incremental/differential backup
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
SELECT count(*) FROM t;
count(*)
100000
# Prepare full backup, apply incremental one
# Restore and check results
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT count(*) FROM t;
count(*)
100000
DROP TABLE t;
call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
echo # Create full backup , modify table, then create incremental/differential backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
SELECT count(*) FROM t;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
--disable_result_log
echo # Prepare full backup, apply incremental one;
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
echo # Restore and check results;
let $targetdir=$basedir;
#-- source include/restart_and_restore.inc
let $_datadir= `SELECT @@datadir`;
let $innodb_data_file_path=`SELECT @@innodb_data_file_path`;
echo # shutdown server;
--source include/shutdown_mysqld.inc
echo # remove datadir;
rmdir $_datadir;
echo # xtrabackup move back;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir "--innodb_data_file_path=$innodb_data_file_path" --target-dir=$targetdir;
echo # restart server;
--source include/start_mysqld.inc
--enable_result_log
SELECT count(*) FROM t;
DROP TABLE t;
# Cleanup
rmdir $basedir;
rmdir $incremental_dir;
...@@ -138,10 +138,13 @@ inline void* aligned_malloc(size_t size, size_t align) { ...@@ -138,10 +138,13 @@ inline void* aligned_malloc(size_t size, size_t align) {
void *result; void *result;
#ifdef _MSC_VER #ifdef _MSC_VER
result = _aligned_malloc(size, align); result = _aligned_malloc(size, align);
#else #elif defined (HAVE_POSIX_MEMALIGN)
if(posix_memalign(&result, align, size)) { if(posix_memalign(&result, align, size)) {
result = 0; result = 0;
} }
#else
/* Use unaligned malloc as fallback */
result = malloc(size);
#endif #endif
return result; return result;
} }
......
...@@ -163,6 +163,11 @@ IF(NOT MSVC) ...@@ -163,6 +163,11 @@ IF(NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
ENDIF() ENDIF()
CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN)
IF(HAVE_POSIX_MEMALIGN)
ADD_DEFINITIONS(-DHAVE_POSIX_MEMALIGN)
ENDIF()
# Only use futexes on Linux if GCC atomics are available # Only use futexes on Linux if GCC atomics are available
IF(NOT MSVC AND NOT CMAKE_CROSSCOMPILING) IF(NOT MSVC AND NOT CMAKE_CROSSCOMPILING)
CHECK_C_SOURCE_RUNS( CHECK_C_SOURCE_RUNS(
......
...@@ -99,6 +99,12 @@ IF(HAVE_SCHED_GETCPU) ...@@ -99,6 +99,12 @@ IF(HAVE_SCHED_GETCPU)
ENDIF() ENDIF()
IF(NOT MSVC) IF(NOT MSVC)
CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN)
IF(HAVE_POSIX_MEMALIGN)
ADD_DEFINITIONS(-DHAVE_POSIX_MEMALIGN)
ENDIF()
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
# workaround for old gcc on x86, gcc atomic ops only work under -march=i686 # workaround for old gcc on x86, gcc atomic ops only work under -march=i686
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
......
...@@ -102,10 +102,13 @@ inline void* aligned_malloc(size_t size, size_t align) { ...@@ -102,10 +102,13 @@ inline void* aligned_malloc(size_t size, size_t align) {
void *result; void *result;
#ifdef _MSC_VER #ifdef _MSC_VER
result = _aligned_malloc(size, align); result = _aligned_malloc(size, align);
#else #elif defined (HAVE_POSIX_MEMALIGN)
if(posix_memalign(&result, align, size)) { if(posix_memalign(&result, align, size)) {
result = 0; result = 0;
} }
#else
/* Use unaligned malloc as fallback */
result = malloc(size);
#endif #endif
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment