mirror of
https://github.com/MariaDB/server.git
synced 2026-05-11 17:40:11 +02:00
Merge 10.1 into 10.2
This commit is contained in:
commit
8f643e2063
320 changed files with 8039 additions and 6155 deletions
|
|
@ -27,101 +27,6 @@ IF(NOT WIN32)
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_LIBARCHIVE STREQUAL "STATIC")
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib)
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(LibArchive)
|
||||
|
||||
IF(NOT DEFINED WITH_LIBARCHIVE)
|
||||
IF(LibArchive_FOUND)
|
||||
SET(WITH_LIBARCHIVE_DEFAULT ON)
|
||||
ELSE()
|
||||
SET(WITH_LIBARCHIVE_DEFAULT OFF)
|
||||
ENDIF()
|
||||
SET(WITH_LIBARCHIVE ${WITH_LIBARCHIVE_DEFAULT} CACHE STRING "Use libarchive for streaming features (ON, OFF or STATIC)" )
|
||||
ENDIF()
|
||||
|
||||
IF(NOT WITH_LIBARCHIVE MATCHES "^(ON|OFF|STATIC)$")
|
||||
MESSAGE(FATAL_ERROR "Invalid value for WITH_LIBARCHIVE: '${WITH_LIBARCHIVE}'. Use one of ON, OFF or STATIC")
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX)
|
||||
SET(PIC_FLAG -fPIC)
|
||||
ENDIF()
|
||||
|
||||
IF((NOT WITH_LIBARCHIVE STREQUAL "OFF") AND (NOT LibArchive_FOUND))
|
||||
IF(CMAKE_VERSION VERSION_LESS "2.8.12")
|
||||
MESSAGE("libarchive can't be built, old cmake")
|
||||
ELSE()
|
||||
# Build a local version
|
||||
INCLUDE(ExternalProject)
|
||||
SET(LIBARCHIVE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libarchive)
|
||||
SET(libarchive_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libarchive)
|
||||
SET(libarchive_CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DENABLE_ICONV=OFF
|
||||
-DENABLE_TAR=ON
|
||||
-DENABLE_OPENSSL=OFF
|
||||
-DENABLE_TEST=OFF
|
||||
"-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} ${PIC_FLAG}"
|
||||
"-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO} ${PIC_FLAG}"
|
||||
"-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} ${PIC_FLAG}"
|
||||
"-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL} ${PIC_FLAG}"
|
||||
)
|
||||
IF(WIN32)
|
||||
SET(libarchive_CMAKE_ARGS ${libarchive_CMAKE_ARGS} -DWINDOWS_VERSION=WIN7 -DCMAKE_DEBUG_POSTFIX=d)
|
||||
SET(LIBARCHIVE_RELEASE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_static${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
SET(LIBARCHIVE_DEBUG_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_staticd${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
SET(byproducts ${LIBARCHIVE_RELEASE_LIB} ${LIBARCHIVE_DEBUG_LIB})
|
||||
ELSE()
|
||||
SET(LIBARCHIVE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
SET(byproducts ${LIBARCHIVE_LIB})
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_VERSION VERSION_GREATER "3.1")
|
||||
SET(byproducts BUILD_BYPRODUCTS ${byproducts})
|
||||
ENDIF()
|
||||
|
||||
ExternalProject_Add(libarchive
|
||||
PREFIX ${libarchive_PREFIX}
|
||||
DOWNLOAD_DIR ${LIBARCHIVE_DIR}
|
||||
URL http://www.libarchive.org/downloads/libarchive-3.2.2.tar.gz
|
||||
INSTALL_DIR ${LIBARCHIVE_DIR}
|
||||
CMAKE_ARGS ${libarchive_CMAKE_ARGS}
|
||||
${byproducts}
|
||||
)
|
||||
ADD_LIBRARY(archive_static STATIC IMPORTED)
|
||||
ADD_DEPENDENCIES(archive_static libarchive)
|
||||
IF(WIN32)
|
||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELWITHDEBINFO ${LIBARCHIVE_RELEASE_LIB})
|
||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELEASE ${LIBARCHIVE_RELEASE_LIB})
|
||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_DEBUG ${LIBARCHIVE_DEBUG_LIB})
|
||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_MINSIZEREL ${LIBARCHIVE_RELEASE_LIB})
|
||||
ELSE()
|
||||
SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION ${LIBARCHIVE_LIB})
|
||||
ENDIF()
|
||||
|
||||
SET(LibArchive_FOUND ON )
|
||||
SET(LibArchive_INCLUDE_DIRS ${LIBARCHIVE_DIR}/include )
|
||||
SET(LibArchive_LIBRARIES archive_static)
|
||||
IF(WIN32)
|
||||
SET(LIBARCHIVE_STATIC 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
IF(WITH_LIBARCHIVE AND LibArchive_FOUND)
|
||||
ADD_DEFINITIONS(-DHAVE_LIBARCHIVE)
|
||||
IF(LIBARCHIVE_STATIC)
|
||||
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
|
||||
ENDIF()
|
||||
INCLUDE_DIRECTORIES(${LibArchive_INCLUDE_DIRS})
|
||||
LINK_LIBRARIES(${LibArchive_LIBRARIES})
|
||||
SET(DS_ARCHIVE_SOURCE ds_archive.c)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
|
|
@ -154,7 +59,6 @@ MYSQL_ADD_EXECUTABLE(mariabackup
|
|||
innobackupex.cc
|
||||
changed_page_bitmap.cc
|
||||
datasink.c
|
||||
${DS_ARCHIVE_SOURCE}
|
||||
ds_buffer.c
|
||||
ds_compress.c
|
||||
ds_local.c
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@ datadir_iter_free(datadir_iter_t *it)
|
|||
/************************************************************************
|
||||
Holds the state needed to copy single data file. */
|
||||
struct datafile_cur_t {
|
||||
os_file_t file;
|
||||
pfs_os_file_t file;
|
||||
char rel_path[FN_REFLEN];
|
||||
char abs_path[FN_REFLEN];
|
||||
MY_STAT statinfo;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ Remove these on the first opportunity, i.e. single-binary XtraBackup. */
|
|||
/** Single bitmap file information */
|
||||
struct log_online_bitmap_file_t {
|
||||
char name[FN_REFLEN]; /*!< Name with full path */
|
||||
os_file_t file; /*!< Handle to opened file */
|
||||
pfs_os_file_t file; /*!< Handle to opened file */
|
||||
ib_uint64_t size; /*!< Size of the file */
|
||||
ib_uint64_t offset; /*!< Offset of the next read,
|
||||
or count of already-read bytes
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
*******************************************************/
|
||||
|
||||
#include "my_config.h"
|
||||
#include "crc_glue.h"
|
||||
#include "crc-intel-pclmul.h"
|
||||
#include <stdint.h>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|||
#include "read_filt.h"
|
||||
|
||||
struct xb_fil_cur_t {
|
||||
os_file_t file; /*!< source file handle */
|
||||
pfs_os_file_t file; /*!< source file handle */
|
||||
fil_node_t* node; /*!< source tablespace node */
|
||||
char rel_path[FN_REFLEN];
|
||||
/*!< normalized file path */
|
||||
|
|
|
|||
|
|
@ -848,9 +848,7 @@ ibx_get_one_option(int optid,
|
|||
opt_ibx_decrypt = true;
|
||||
break;
|
||||
case OPT_STREAM:
|
||||
if (!strcasecmp(argument, "tar"))
|
||||
xtrabackup_stream_fmt = XB_STREAM_FMT_TAR;
|
||||
else if (!strcasecmp(argument, "xbstream"))
|
||||
if (!strcasecmp(argument, "xbstream"))
|
||||
xtrabackup_stream_fmt = XB_STREAM_FMT_XBSTREAM;
|
||||
else {
|
||||
ibx_msg("Invalid --stream argument: %s\n", argument);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|||
|
||||
|
||||
extern void os_io_init_simple(void);
|
||||
extern os_file_t files[1000];
|
||||
extern pfs_os_file_t files[1000];
|
||||
extern const char *innodb_checksum_algorithm_names[];
|
||||
extern TYPELIB innodb_checksum_algorithm_typelib;
|
||||
extern dberr_t open_or_create_data_files(
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ typedef struct xb_wstream_file_struct xb_wstream_file_t;
|
|||
|
||||
typedef enum {
|
||||
XB_STREAM_FMT_NONE,
|
||||
XB_STREAM_FMT_TAR,
|
||||
XB_STREAM_FMT_XBSTREAM
|
||||
} xb_stream_fmt_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -704,11 +704,7 @@ struct my_option xb_client_options[] =
|
|||
|
||||
{"stream", OPT_XTRA_STREAM, "Stream all backup files to the standard output "
|
||||
"in the specified format."
|
||||
#ifdef HAVE_LIBARCHIVE
|
||||
"Supported formats are 'tar' and 'xbstream'."
|
||||
#else
|
||||
"Supported format is 'xbstream'."
|
||||
#endif
|
||||
,
|
||||
(G_PTR*) &xtrabackup_stream_str, (G_PTR*) &xtrabackup_stream_str, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
|
@ -1453,9 +1449,7 @@ xb_get_one_option(int optid,
|
|||
xtrabackup_target_dir= xtrabackup_real_target_dir;
|
||||
break;
|
||||
case OPT_XTRA_STREAM:
|
||||
if (!strcasecmp(argument, "tar"))
|
||||
xtrabackup_stream_fmt = XB_STREAM_FMT_TAR;
|
||||
else if (!strcasecmp(argument, "xbstream"))
|
||||
if (!strcasecmp(argument, "xbstream"))
|
||||
xtrabackup_stream_fmt = XB_STREAM_FMT_XBSTREAM;
|
||||
else
|
||||
{
|
||||
|
|
@ -2412,7 +2406,7 @@ check_if_skip_table(
|
|||
Reads the space flags from a given data file and returns the compressed
|
||||
page size, or 0 if the space is not compressed. */
|
||||
ulint
|
||||
xb_get_zip_size(os_file_t file)
|
||||
xb_get_zip_size(pfs_os_file_t file)
|
||||
{
|
||||
byte *buf;
|
||||
byte *page;
|
||||
|
|
@ -3106,14 +3100,6 @@ files first, and then streams them in a serialized way when closed. */
|
|||
static void
|
||||
xtrabackup_init_datasinks(void)
|
||||
{
|
||||
if (xtrabackup_parallel > 1 && xtrabackup_stream &&
|
||||
xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) {
|
||||
msg("xtrabackup: warning: the --parallel option does not have "
|
||||
"any effect when streaming in the 'tar' format. "
|
||||
"You can use the 'xbstream' format instead.\n");
|
||||
xtrabackup_parallel = 1;
|
||||
}
|
||||
|
||||
/* Start building out the pipelines from the terminus back */
|
||||
if (xtrabackup_stream) {
|
||||
/* All streaming goes to stdout */
|
||||
|
|
@ -3131,30 +3117,17 @@ xtrabackup_init_datasinks(void)
|
|||
/* Stream formatting */
|
||||
if (xtrabackup_stream) {
|
||||
ds_ctxt_t *ds;
|
||||
if (xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) {
|
||||
ds = ds_create(xtrabackup_target_dir, DS_TYPE_ARCHIVE);
|
||||
} else if (xtrabackup_stream_fmt == XB_STREAM_FMT_XBSTREAM) {
|
||||
ds = ds_create(xtrabackup_target_dir, DS_TYPE_XBSTREAM);
|
||||
} else {
|
||||
/* bad juju... */
|
||||
ds = NULL;
|
||||
}
|
||||
|
||||
ut_a(xtrabackup_stream_fmt == XB_STREAM_FMT_XBSTREAM);
|
||||
ds = ds_create(xtrabackup_target_dir, DS_TYPE_XBSTREAM);
|
||||
|
||||
xtrabackup_add_datasink(ds);
|
||||
|
||||
ds_set_pipe(ds, ds_data);
|
||||
ds_data = ds;
|
||||
|
||||
if (xtrabackup_stream_fmt != XB_STREAM_FMT_XBSTREAM) {
|
||||
|
||||
/* 'tar' does not allow parallel streams */
|
||||
ds_redo = ds_meta = ds_create(xtrabackup_target_dir,
|
||||
DS_TYPE_TMPFILE);
|
||||
xtrabackup_add_datasink(ds_meta);
|
||||
ds_set_pipe(ds_meta, ds);
|
||||
} else {
|
||||
ds_redo = ds_meta = ds_data;
|
||||
}
|
||||
ds_redo = ds_meta = ds_data;
|
||||
}
|
||||
|
||||
/* Encryption */
|
||||
|
|
@ -4856,7 +4829,7 @@ end:
|
|||
static my_bool
|
||||
xtrabackup_init_temp_log(void)
|
||||
{
|
||||
os_file_t src_file = XB_FILE_UNDEFINED;
|
||||
pfs_os_file_t src_file;
|
||||
char src_path[FN_REFLEN];
|
||||
char dst_path[FN_REFLEN];
|
||||
ibool success;
|
||||
|
|
@ -5183,7 +5156,7 @@ xb_space_create_file(
|
|||
ulint space_id, /*!<in: space id */
|
||||
ulint flags __attribute__((unused)),/*!<in: tablespace
|
||||
flags */
|
||||
os_file_t* file) /*!<out: file handle */
|
||||
pfs_os_file_t* file) /*!<out: file handle */
|
||||
{
|
||||
ibool ret;
|
||||
byte* buf;
|
||||
|
|
@ -5262,7 +5235,7 @@ mismatching ID, renames it to xtrabackup_tmp_#ID.ibd. If there was no
|
|||
matching file, creates a new tablespace.
|
||||
@return file handle of matched or created file */
|
||||
static
|
||||
os_file_t
|
||||
pfs_os_file_t
|
||||
xb_delta_open_matching_space(
|
||||
const char* dbname, /* in: path to destination database dir */
|
||||
const char* name, /* in: name of delta file (without .delta) */
|
||||
|
|
@ -5276,7 +5249,7 @@ xb_delta_open_matching_space(
|
|||
char dest_space_name[FN_REFLEN];
|
||||
ibool ok;
|
||||
fil_space_t* fil_space;
|
||||
os_file_t file = 0;
|
||||
pfs_os_file_t file;
|
||||
ulint tablespace_flags;
|
||||
xb_filter_entry_t* table;
|
||||
|
||||
|
|
@ -5440,8 +5413,8 @@ xtrabackup_apply_delta(
|
|||
including the .delta extension */
|
||||
void* /*data*/)
|
||||
{
|
||||
os_file_t src_file = XB_FILE_UNDEFINED;
|
||||
os_file_t dst_file = XB_FILE_UNDEFINED;
|
||||
pfs_os_file_t src_file;
|
||||
pfs_os_file_t dst_file;
|
||||
char src_path[FN_REFLEN];
|
||||
char dst_path[FN_REFLEN];
|
||||
char meta_path[FN_REFLEN];
|
||||
|
|
@ -5815,7 +5788,7 @@ xtrabackup_apply_deltas()
|
|||
static my_bool
|
||||
xtrabackup_close_temp_log(my_bool clear_flag)
|
||||
{
|
||||
os_file_t src_file = XB_FILE_UNDEFINED;
|
||||
pfs_os_file_t src_file;
|
||||
char src_path[FN_REFLEN];
|
||||
char dst_path[FN_REFLEN];
|
||||
ibool success;
|
||||
|
|
@ -6597,7 +6570,7 @@ skip_check:
|
|||
|
||||
if (xtrabackup_export) {
|
||||
msg("xtrabackup: export option is specified.\n");
|
||||
os_file_t info_file = XB_FILE_UNDEFINED;
|
||||
pfs_os_file_t info_file;
|
||||
char info_file_path[FN_REFLEN];
|
||||
ibool success;
|
||||
char table_name[FN_REFLEN];
|
||||
|
|
@ -7406,22 +7379,6 @@ int main(int argc, char **argv)
|
|||
innobase_file_per_table = TRUE;
|
||||
}
|
||||
|
||||
if (xtrabackup_incremental && xtrabackup_stream &&
|
||||
xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) {
|
||||
msg("xtrabackup: error: "
|
||||
"streaming incremental backups are incompatible with the \n"
|
||||
"'tar' streaming format. Use --stream=xbstream instead.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((xtrabackup_compress || xtrabackup_encrypt) && xtrabackup_stream &&
|
||||
xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) {
|
||||
msg("xtrabackup: error: "
|
||||
"compressed and encrypted backups are incompatible with the \n"
|
||||
"'tar' streaming format. Use --stream=xbstream instead.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!xtrabackup_prepare &&
|
||||
(innobase_log_arch_dir || xtrabackup_archived_to_lsn)) {
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|||
#include "changed_page_bitmap.h"
|
||||
|
||||
#ifdef __WIN__
|
||||
#define XB_FILE_UNDEFINED NULL
|
||||
#define XB_FILE_UNDEFINED INVALID_HANDLE_VALUE
|
||||
#else
|
||||
#define XB_FILE_UNDEFINED (-1)
|
||||
#endif
|
||||
|
|
@ -194,7 +194,7 @@ void xb_data_files_close(void);
|
|||
/***********************************************************************
|
||||
Reads the space flags from a given data file and returns the compressed
|
||||
page size, or 0 if the space is not compressed. */
|
||||
ulint xb_get_zip_size(os_file_t file);
|
||||
ulint xb_get_zip_size(pfs_os_file_t file);
|
||||
|
||||
/************************************************************************
|
||||
Checks if a table specified as a name in the form "database/name" (InnoDB 5.6)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue