Skip to content

Commit

Permalink
Merge branch '10.2' into bb-10.2-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Aug 25, 2017
2 parents f2033df + a544225 commit 2741287
Show file tree
Hide file tree
Showing 585 changed files with 79,337 additions and 12,280 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ ENDIF()

SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")

# mariadb_connector_c fetches submodules which is useful for plugins
INCLUDE(submodules)
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)

# Add storage engines and plugins.
Expand Down Expand Up @@ -460,7 +460,6 @@ INSTALL_DOCUMENTATION(README.md CREDITS COPYING COPYING.thirdparty
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)

IF(UNIX)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme)
ENDIF()

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.

MariaDB is developed by many of the original developers of MySQL who
now work for the MariadB Foundation and the MariaDB Corporation, and by many people in
now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in
the community.

MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_PATCH=9
88 changes: 75 additions & 13 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
default_pager_set= 0, opt_sigint_ignore= 0,
auto_vertical_output= 0,
show_warnings= 0, executing_query= 0,
ignore_spaces= 0, opt_progress_reports;
ignore_spaces= 0, opt_binhex= 0, opt_progress_reports;
static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error;
static my_bool column_types_flag;
static my_bool preserve_comments= 0;
Expand Down Expand Up @@ -1496,6 +1496,8 @@ static struct my_option my_long_options[] =
{"batch", 'B',
"Don't use history file. Disable interactive behavior. (Enables --silent.)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"binary-as-hex", 'b', "Print binary data as hex", &opt_binhex, &opt_binhex,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
Expand Down Expand Up @@ -3318,7 +3320,8 @@ com_go(String *buffer,char *line __attribute__((unused)))
print_table_data_html(result);
else if (opt_xml)
print_table_data_xml(result);
else if (vertical || (auto_vertical_output && (terminal_width < get_result_width(result))))
else if (vertical || (auto_vertical_output &&
(terminal_width < get_result_width(result))))
print_table_data_vertically(result);
else if (opt_silent && verbose <= 2 && !output_tables)
print_tab_data(result);
Expand Down Expand Up @@ -3536,6 +3539,41 @@ print_field_types(MYSQL_RES *result)
}


/* Used to determine if we should invoke print_as_hex for this field */

static bool
is_binary_field(MYSQL_FIELD *field)
{
if ((field->charsetnr == 63) &&
(field->type == MYSQL_TYPE_BIT ||
field->type == MYSQL_TYPE_BLOB ||
field->type == MYSQL_TYPE_LONG_BLOB ||
field->type == MYSQL_TYPE_MEDIUM_BLOB ||
field->type == MYSQL_TYPE_TINY_BLOB ||
field->type == MYSQL_TYPE_VAR_STRING ||
field->type == MYSQL_TYPE_STRING ||
field->type == MYSQL_TYPE_VARCHAR ||
field->type == MYSQL_TYPE_GEOMETRY))
return 1;
return 0;
}


/* Print binary value as hex literal (0x ...) */

static void
print_as_hex(FILE *output_file, const char *str, ulong len, ulong total_bytes_to_send)
{
const char *ptr= str, *end= ptr+len;
ulong i;
fprintf(output_file, "0x");
for(; ptr < end; ptr++)
fprintf(output_file, "%02X", *((uchar*)ptr));
for (i= 2*len+2; i < total_bytes_to_send; i++)
tee_putc((int)' ', output_file);
}


static void
print_table_data(MYSQL_RES *result)
{
Expand All @@ -3562,6 +3600,8 @@ print_table_data(MYSQL_RES *result)
length= MY_MAX(length,field->max_length);
if (length < 4 && !IS_NOT_NULL(field->flags))
length=4; // Room for "NULL"
if (opt_binhex && is_binary_field(field))
length= 2 + length * 2;
field->max_length=length;
num_flag[mysql_field_tell(result) - 1]= IS_NUM(field->type);
separator.fill(separator.length()+length+2,'-');
Expand Down Expand Up @@ -3629,9 +3669,11 @@ print_table_data(MYSQL_RES *result)
many extra padding-characters we should send with the printing function.
*/
visible_length= charset_info->cset->numcells(charset_info, buffer, buffer + data_length);
extra_padding= data_length - visible_length;
extra_padding= (uint) (data_length - visible_length);

if (field_max_length > MAX_COLUMN_LENGTH)
if (opt_binhex && is_binary_field(field))
print_as_hex(PAGER, cur[off], lengths[off], field_max_length);
else if (field_max_length > MAX_COLUMN_LENGTH)
tee_print_sized_data(buffer, data_length, MAX_COLUMN_LENGTH+extra_padding, FALSE);
else
{
Expand Down Expand Up @@ -3765,11 +3807,15 @@ print_table_data_html(MYSQL_RES *result)
if (interrupted_query)
break;
ulong *lengths=mysql_fetch_lengths(result);
field= mysql_fetch_fields(result);
(void) tee_fputs("<TR>", PAGER);
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
xmlencode_print(cur[i], lengths[i]);
if (opt_binhex && is_binary_field(&field[i]))
print_as_hex(PAGER, cur[i], lengths[i], lengths[i]);
else
xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
Expand Down Expand Up @@ -3805,7 +3851,10 @@ print_table_data_xml(MYSQL_RES *result)
if (cur[i])
{
tee_fprintf(PAGER, "\">");
xmlencode_print(cur[i], lengths[i]);
if (opt_binhex && is_binary_field(&fields[i]))
print_as_hex(PAGER, cur[i], lengths[i], lengths[i]);
else
xmlencode_print(cur[i], lengths[i]);
tee_fprintf(PAGER, "</field>\n");
}
else
Expand Down Expand Up @@ -3852,13 +3901,19 @@ print_table_data_vertically(MYSQL_RES *result)
{
unsigned int i;
const char *p;

if (opt_binhex && is_binary_field(field))
fprintf(PAGER, "0x");
for (i= 0, p= cur[off]; i < lengths[off]; i+= 1, p+= 1)
{
if (*p == '\0')
tee_putc((int)' ', PAGER);
if (opt_binhex && is_binary_field(field))
fprintf(PAGER, "%02X", *((uchar*)p));
else
tee_putc((int)*p, PAGER);
{
if (*p == '\0')
tee_putc((int)' ', PAGER);
else
tee_putc((int)*p, PAGER);
}
}
tee_putc('\n', PAGER);
}
Expand All @@ -3868,7 +3923,6 @@ print_table_data_vertically(MYSQL_RES *result)
}
}


/* print_warnings should be called right after executing a statement */

static void print_warnings()
Expand Down Expand Up @@ -4005,11 +4059,19 @@ print_tab_data(MYSQL_RES *result)
while ((cur = mysql_fetch_row(result)))
{
lengths=mysql_fetch_lengths(result);
safe_put_field(cur[0],lengths[0]);
field= mysql_fetch_fields(result);
if (opt_binhex && is_binary_field(&field[0]))
print_as_hex(PAGER, cur[0], lengths[0], lengths[0]);
else
safe_put_field(cur[0],lengths[0]);

for (uint off=1 ; off < mysql_num_fields(result); off++)
{
(void) tee_fputs("\t", PAGER);
safe_put_field(cur[off], lengths[off]);
if (opt_binhex && field && is_binary_field(&field[off]))
print_as_hex(PAGER, cur[off], lengths[off], lengths[off]);
else
safe_put_field(cur[off], lengths[off]);
}
(void) tee_fputs("\n", PAGER);
}
Expand Down
14 changes: 0 additions & 14 deletions cmake/mariadb_connector_c.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt AND GIT_EXECUTABLE)
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
ENDIF()
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
git submodule init
git submodule update
Then restart the build.
")
ENDIF()

SET(OPT CONC_)

IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand Down
9 changes: 5 additions & 4 deletions cmake/ssl.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2012, Oracle and/or its affiliates.
# Copyright (c) 2011, 2017, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -11,7 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# We support different versions of SSL:
# - "bundled" uses source code in <source dir>/extra/yassl
Expand Down Expand Up @@ -124,7 +125,7 @@ MACRO (MYSQL_CHECK_SSL)
SET(OPENSSL_ROOT_DIR ${WITH_SSL_PATH})
ENDIF()
ENDIF()
FIND_PACKAGE(OpenSSL 1.0.0)
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
INCLUDE(CheckSymbolExists)
Expand Down Expand Up @@ -159,7 +160,7 @@ MACRO (MYSQL_CHECK_SSL)
HAVE_EncryptAes128Gcm)
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
ENDIF()
MYSQL_USE_BUNDLED_SSL()
ENDIF()
Expand Down
30 changes: 30 additions & 0 deletions cmake/submodules.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# update submodules automatically
IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" config --get cmake.update-submodules
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE cmake_update_submodules)
IF(cmake_update_submodules MATCHES no)
SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE("-- Updating submodules (forced)")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ELSEIF (cmake_update_submodules MATCHES yes)
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ELSE()
MESSAGE("-- Updating submodules")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ENDIF()
ENDIF()

IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
git submodule update --init
Then restart the build.
")
ENDIF()
4 changes: 3 additions & 1 deletion cmake/systemd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ MACRO(CHECK_SYSTEMD)
UNSET(HAVE_SYSTEMD_SD_NOTIFYF)
MESSAGE_ONCE(systemd "Systemd features not enabled")
IF(WITH_SYSTEMD STREQUAL "yes")
MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=YES however no dependencies installed/found")
MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=yes however no dependencies installed/found")
ENDIF()
ENDIF()
ELSEIF(NOT WITH_SYSTEMD STREQUAL "no")
MESSAGE(FATAL_ERROR "Invalid value for WITH_SYSTEMD. Must be 'yes', 'no', or 'auto'.")
ENDIF()
ENDIF()
ENDMACRO()
3 changes: 1 addition & 2 deletions debian/libmariadb-dev.install
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
usr/bin/mysql_config
usr/include/mysql/*.h
usr/include/mysql/psi/*.h
usr/include/mysql
usr/lib/*/libmariadb.so
usr/lib/*/libmariadbclient.a
usr/lib/*/libmysqlservices.a
Expand Down
13 changes: 8 additions & 5 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1342,8 +1342,8 @@ backup_files(const char *from, bool prep_mode)
return(ret);
}

bool
backup_start()
/** Start --backup */
bool backup_start()
{
if (!opt_no_lock) {
if (opt_safe_slave_backup) {
Expand Down Expand Up @@ -1418,9 +1418,8 @@ backup_start()
return(true);
}


bool
backup_finish()
/** Release resources after backup_start() */
void backup_release()
{
/* release all locks */
if (!opt_no_lock) {
Expand All @@ -1435,7 +1434,11 @@ backup_finish()
xb_mysql_query(mysql_connection,
"START SLAVE SQL_THREAD", false);
}
}

/** Finish after backup_start() and backup_release() */
bool backup_finish()
{
/* Copy buffer pool dump or LRU dump */
if (!opt_rsync) {
if (buffer_pool_filename && file_exists(buffer_pool_filename)) {
Expand Down
10 changes: 6 additions & 4 deletions extra/mariabackup/backup_copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ copy_file(ds_ctxt_t *datasink,
const char *dst_file_path,
uint thread_n);

bool
backup_start();
bool
backup_finish();
/** Start --backup */
bool backup_start();
/** Release resources after backup_start() */
void backup_release();
/** Finish after backup_start() and backup_release() */
bool backup_finish();
bool
apply_log_finish();
bool
Expand Down
Loading

0 comments on commit 2741287

Please sign in to comment.