Skip to content

Commit

Permalink
System Versioning 1.0 pre3
Browse files Browse the repository at this point in the history
Merge branch '10.3' into trunk
  • Loading branch information
midenok committed Dec 11, 2017
2 parents b7cd182 + 8f581e8 commit 79dd77e
Show file tree
Hide file tree
Showing 2,327 changed files with 207,786 additions and 116,982 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=3
MYSQL_VERSION_PATCH=3
SERVER_MATURITY=beta
5 changes: 3 additions & 2 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2955,10 +2955,11 @@ int main(int argc, char** argv)

if (!argc || opt_version)
{
if (!argc)
usage();
if (!opt_version)
{
usage();
retval= ERROR_STOP;
}
goto err;
}

Expand Down
3 changes: 2 additions & 1 deletion cmake/dtrace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ MACRO(CHECK_DTRACE)
# On FreeBSD, dtrace does not handle userland tracing yet
IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
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")
ENDIF()
SET(HAVE_DTRACE ${ENABLE_DTRACE})
Expand Down
5 changes: 5 additions & 0 deletions cmake/mysql_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ MACRO(GET_MYSQL_VERSION)
MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION)
MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION)
MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION)
MYSQL_GET_CONFIG_VALUE("SERVER_MATURITY" SERVER_MATURITY)

IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR
NOT "${MINOR_VERSION}" MATCHES "[0-9]+" OR
Expand All @@ -69,6 +70,10 @@ ENDMACRO()
# Get mysql version and other interesting variables
GET_MYSQL_VERSION()

# Maturity level
string(TOUPPER ${SERVER_MATURITY} SERVER_MATURITY)
SET(SERVER_MATURITY_LEVEL MariaDB_PLUGIN_MATURITY_${SERVER_MATURITY})

SET(MYSQL_TCP_PORT_DEFAULT 0)
IF(NOT MYSQL_TCP_PORT)
SET(MYSQL_TCP_PORT 3306)
Expand Down
2 changes: 1 addition & 1 deletion cmake/wsrep.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})

# Set the patch version
SET(WSREP_PATCH_VERSION "20")
SET(WSREP_PATCH_VERSION "21")

# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
Expand Down
1 change: 0 additions & 1 deletion config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
#cmakedefine HAVE_PREAD 1
#cmakedefine HAVE_PAUSE_INSTRUCTION 1
#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1
#cmakedefine HAVE_HMT_PRIORITY_INSTRUCTION 1
#cmakedefine HAVE_RDTSCLL 1
#cmakedefine HAVE_READ_REAL_TIME 1
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
Expand Down
11 changes: 0 additions & 11 deletions configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -792,17 +792,6 @@ IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
}
" HAVE_FAKE_PAUSE_INSTRUCTION)
ENDIF()
IF (NOT HAVE_PAUSE_INSTRUCTION)
CHECK_C_SOURCE_COMPILES("
#include <sys/platform/ppc.h>
int main()
{
__ppc_set_ppr_low();
__ppc_set_ppr_med();
return 0;
}
" HAVE_HMT_PRIORITY_INSTRUCTION)
ENDIF()
ENDIF()

CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1)
Expand Down
13 changes: 6 additions & 7 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,8 @@ datadir_iter_next_database(datadir_iter_t *it)
it->dbpath = static_cast<char*>(
malloc(it->dbpath_len));
}
ut_snprintf(it->dbpath, it->dbpath_len,
"%s/%s", it->datadir_path,
it->dbinfo.name);
snprintf(it->dbpath, it->dbpath_len, "%s/%s",
it->datadir_path, it->dbinfo.name);
os_normalize_path(it->dbpath);

if (it->dbinfo.type == OS_FILE_TYPE_FILE) {
Expand Down Expand Up @@ -1034,8 +1033,8 @@ move_file(ds_ctxt_t *datasink,
char dst_dir_abs[FN_REFLEN];
size_t dirname_length;

ut_snprintf(dst_file_path_abs, sizeof(dst_file_path_abs),
"%s/%s", dst_dir, dst_file_path);
snprintf(dst_file_path_abs, sizeof(dst_file_path_abs),
"%s/%s", dst_dir, dst_file_path);

dirname_part(dst_dir_abs, dst_file_path_abs, &dirname_length);

Expand Down Expand Up @@ -1252,8 +1251,8 @@ backup_files(const char *from, bool prep_mode)
} else if (!prep_mode) {
/* backup fake file into empty directory */
char path[FN_REFLEN];
ut_snprintf(path, sizeof(path),
"%s/db.opt", node.filepath);
snprintf(path, sizeof(path),
"%s/db.opt", node.filepath);
if (!(ret = backup_file_printf(
trim_dotslash(path), "%s", ""))) {
msg("Failed to create file %s\n", path);
Expand Down
14 changes: 7 additions & 7 deletions extra/mariabackup/backup_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ select_incremental_lsn_from_history(lsn_t *incremental_lsn)
mysql_real_escape_string(mysql_connection, buf,
opt_incremental_history_name,
(unsigned long)strlen(opt_incremental_history_name));
ut_snprintf(query, sizeof(query),
snprintf(query, sizeof(query),
"SELECT innodb_to_lsn "
"FROM PERCONA_SCHEMA.xtrabackup_history "
"WHERE name = '%s' "
Expand All @@ -602,7 +602,7 @@ select_incremental_lsn_from_history(lsn_t *incremental_lsn)
mysql_real_escape_string(mysql_connection, buf,
opt_incremental_history_uuid,
(unsigned long)strlen(opt_incremental_history_uuid));
ut_snprintf(query, sizeof(query),
snprintf(query, sizeof(query),
"SELECT innodb_to_lsn "
"FROM PERCONA_SCHEMA.xtrabackup_history "
"WHERE uuid = '%s' "
Expand Down Expand Up @@ -766,7 +766,7 @@ kill_long_queries(MYSQL *connection, time_t timeout)
is_select_query(info))) {
msg_ts("Killing query %s (duration %d sec): %s\n",
id, (int)duration, info);
ut_snprintf(kill_stmt, sizeof(kill_stmt),
snprintf(kill_stmt, sizeof(kill_stmt),
"KILL %s", id);
xb_mysql_query(connection, kill_stmt, false, false);
}
Expand Down Expand Up @@ -1288,8 +1288,8 @@ write_current_binlog_file(MYSQL *connection)
goto cleanup;
}

ut_snprintf(filepath, sizeof(filepath), "%s%c%s",
log_bin_dir, FN_LIBCHAR, log_bin_file);
snprintf(filepath, sizeof(filepath), "%s%c%s",
log_bin_dir, FN_LIBCHAR, log_bin_file);
result = copy_file(ds_data, filepath, log_bin_file, 0);
}

Expand Down Expand Up @@ -1574,8 +1574,8 @@ char *make_argv(char *buf, size_t len, int argc, char **argv)
if (strncmp(*argv, "--password", strlen("--password")) == 0) {
arg = "--password=...";
}
left-= ut_snprintf(buf + len - left, left,
"%s%c", arg, argc > 1 ? ' ' : 0);
left-= snprintf(buf + len - left, left,
"%s%c", arg, argc > 1 ? ' ' : 0);
++argv; --argc;
}

Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/changed_page_bitmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ log_online_open_bitmap_file_read_only(

xb_ad(name[0] != '\0');

ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%s", srv_data_home, name);
snprintf(bitmap_file->name, FN_REFLEN, "%s%s", srv_data_home, name);
bitmap_file->file = os_file_create_simple_no_error_handling(
0, bitmap_file->name,
OS_FILE_OPEN, OS_FILE_READ_ONLY, true, &success);
Expand Down
1 change: 1 addition & 0 deletions extra/mariabackup/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <mysql_version.h>
#include <fcntl.h>
#include <stdarg.h>
#include <my_sys.h>


# define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open)
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/crc/crc_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions extra/mariabackup/encryption_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ static void encryption_plugin_init(int argc, char **argv)
{
/* Patch optional and mandatory plugins, we only need to load the one in xb_plugin_load. */
mysql_optional_plugins[0] = mysql_mandatory_plugins[0] = 0;
plugin_maturity = MariaDB_PLUGIN_MATURITY_UNKNOWN; /* mariabackup accepts all plugins */
msg("Loading encryption plugin\n");
for (int i= 1; i < argc; i++)
msg("\t Encryption plugin parameter : '%s'\n", argv[i]);
Expand Down
19 changes: 1 addition & 18 deletions extra/mariabackup/fil_cur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,7 @@ xb_fil_cur_open(

posix_fadvise(cursor->file, 0, 0, POSIX_FADV_SEQUENTIAL);

/* Determine the page size */
ulint flags = xb_get_space_flags(cursor->file);
if (flags == ULINT_UNDEFINED) {
xb_fil_cur_close(cursor);
return(XB_FIL_CUR_SKIP);
}

if (!fsp_flags_is_valid(flags, cursor->space_id)) {
ulint cflags = fsp_flags_convert_from_101(flags);
if (cflags == ULINT_UNDEFINED) {
msg("[%02u] mariabackup: Error: Invalid "
"tablespace flags: %x.\n", thread_n, uint(flags));
return(XB_FIL_CUR_SKIP);
}
flags = cflags;
}

const page_size_t page_size(flags);
const page_size_t page_size(cursor->node->space->flags);
cursor->page_size = page_size;

/* Allocate read buffer */
Expand Down
21 changes: 12 additions & 9 deletions extra/mariabackup/write_filt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include "write_filt.h"
#include "fil_cur.h"
#include "xtrabackup.h"
#include <os0proc.h>

/************************************************************************
Write-through page write filter. */
Expand Down Expand Up @@ -68,19 +69,22 @@ wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
xb_fil_cur_t *cursor)
{
char meta_name[FN_REFLEN];
ulint buf_size;
xb_wf_incremental_ctxt_t *cp =
&(ctxt->u.wf_incremental_ctxt);

ctxt->cursor = cursor;

/* allocate buffer for incremental backup (4096 pages) */
buf_size = (cursor->page_size.physical() / 4 + 1)
* cursor->page_size.physical();
cp->delta_buf_base = static_cast<byte *>(malloc(buf_size));
memset(cp->delta_buf_base, 0, buf_size);
cp->delta_buf = static_cast<byte *>
(ut_align(cp->delta_buf_base, cursor->page_size.physical()));
cp->delta_buf_size = (cursor->page_size.physical() / 4)
* cursor->page_size.physical();
cp->delta_buf = (unsigned char *)os_mem_alloc_large(&cp->delta_buf_size);

if (!cp->delta_buf) {
msg("[%02u] mariabackup: Error: "
"cannot allocate %zu bytes\n",
cursor->thread_n, (size_t) cp->delta_buf_size);
return (FALSE);
}

/* write delta meta info */
snprintf(meta_name, sizeof(meta_name), "%s%s", dst_name,
Expand Down Expand Up @@ -184,8 +188,7 @@ static void
wf_incremental_deinit(xb_write_filt_ctxt_t *ctxt)
{
xb_wf_incremental_ctxt_t *cp = &(ctxt->u.wf_incremental_ctxt);

free(cp->delta_buf_base);
os_mem_free_large(cp->delta_buf, cp->delta_buf_size);
}

/************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/write_filt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

/* Incremental page filter context */
typedef struct {
byte *delta_buf_base;
ulint delta_buf_size;
byte *delta_buf;
ulint npages;
} xb_wf_incremental_ctxt_t;
Expand Down
Loading

0 comments on commit 79dd77e

Please sign in to comment.