Skip to content

Commit

Permalink
Merge tag 'mariadb-10.0.31' into 10.0-galera
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
  • Loading branch information
mariadb-SachinSetiya committed May 30, 2017
2 parents 0e3170e + 725e47b commit 92209ac
Show file tree
Hide file tree
Showing 491 changed files with 11,657 additions and 7,947 deletions.
16 changes: 6 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2006, 2014, Oracle and/or its affiliates.
# Copyright (c) 2008, 2014, Monty Program Ab
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
# Copyright (c) 2008, 2017, MariaDB
#
# 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 Down Expand Up @@ -242,12 +242,9 @@ IF (WITH_ASAN)
ENDIF()
ENDIF()


OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
IF(ENABLE_DEBUG_SYNC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
ENDIF()
# Always enable debug sync for debug builds.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")

OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
IF (ENABLE_GCOV AND NOT WIN32 AND NOT APPLE)
Expand Down Expand Up @@ -494,8 +491,7 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

INSTALL_DOCUMENTATION(README CREDITS COPYING COPYING.LESSER EXCEPTIONS-CLIENT
COMPONENT Readme)
INSTALL_DOCUMENTATION(README CREDITS COPYING EXCEPTIONS-CLIENT COMPONENT Readme)

# MDEV-6526 these files are not installed anymore
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
Expand Down
516 changes: 0 additions & 516 deletions COPYING.LESSER

This file was deleted.

1 change: 0 additions & 1 deletion client/client_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,3 @@ enum options_client
Name of the performance schema database.
*/
#define PERFORMANCE_SCHEMA_DB_NAME "performance_schema"

3 changes: 1 addition & 2 deletions client/mysql.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, MariaDB
Copyright (c) 2009, 2017, MariaDB
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 Down Expand Up @@ -3061,7 +3061,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
{
unsigned int num_fields= mysql_num_fields(result);
my_ulonglong num_rows= mysql_num_rows(result);
mysql_fetch_fields(result);
if (num_fields==3 && num_rows==1)
{
if (!(cur= mysql_fetch_row(result)))
Expand Down
7 changes: 3 additions & 4 deletions client/mysql_upgrade.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB
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 Down Expand Up @@ -1047,15 +1047,15 @@ static int check_version_match(void)

int main(int argc, char **argv)
{
char self_name[FN_REFLEN];
char self_name[FN_REFLEN + 1];

MY_INIT(argv[0]);

#if __WIN__
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
#endif
{
strncpy(self_name, argv[0], FN_REFLEN);
strmake_buf(self_name, argv[0]);
}

if (init_dynamic_string(&ds_args, "", 512, 256) ||
Expand Down Expand Up @@ -1145,4 +1145,3 @@ int main(int argc, char **argv)
my_end(my_end_arg);
exit(0);
}

21 changes: 13 additions & 8 deletions client/mysqladmin.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB
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 Down Expand Up @@ -614,6 +614,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)

static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
int ret = 0;
const char *status;
/*
MySQL documentation relies on the fact that mysqladmin will
Expand Down Expand Up @@ -1107,7 +1108,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
if (strcmp(typed_password, verified) != 0)
{
my_printf_error(0,"Passwords don't match",MYF(ME_BELL));
return -1;
ret = -1;
goto password_done;
}
}
else
Expand All @@ -1134,7 +1136,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'",
error_flags, mysql_error(mysql));
return -1;
ret = -1;
goto password_done;
}
else
{
Expand All @@ -1145,7 +1148,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
"Could not get old_passwords setting from "
"server; error: '%s'",
error_flags, mysql_error(mysql));
return -1;
ret = -1;
goto password_done;
}
if (!mysql_num_rows(res))
old= 1;
Expand All @@ -1170,15 +1174,15 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0, "Can't turn off logging; error: '%s'",
error_flags, mysql_error(mysql));
return -1;
ret = -1;
}
else
if (mysql_query(mysql,buff))
{
if (mysql_errno(mysql)!=1290)
{
my_printf_error(0,"unable to change password; error: '%s'",
error_flags, mysql_error(mysql));
return -1;
}
else
{
Expand All @@ -1192,9 +1196,10 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
" --skip-grant-tables).\n"
"Use: \"mysqladmin flush-privileges password '*'\""
" instead", error_flags);
return -1;
}
ret = -1;
}
password_done:
/* free up memory from prompted password */
if (typed_password != argv[1])
{
Expand Down Expand Up @@ -1296,7 +1301,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
return 1;
}
}
return 0;
return ret;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);

size_t tlen = strlen(logname);
if (tlen > UINT_MAX)
if (tlen > sizeof(buf) - 10)
{
error("Log name too long.");
DBUG_RETURN(ERROR_STOP);
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlcheck.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB
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 Down
11 changes: 6 additions & 5 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB
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 Down Expand Up @@ -2142,6 +2142,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
case '-':
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
break;
/* fall through */
default:
fputc(*comment_string, xml_file);
break;
Expand Down Expand Up @@ -2179,7 +2180,6 @@ static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
print_xml_comment(sql_file, strlen(comment_buff), comment_buff);
}


/*
create_delimiter
Generate a new (null-terminated) string that does not exist in query
Expand Down Expand Up @@ -2524,7 +2524,7 @@ static uint dump_routines_for_db(char *db)
query_buff);
print_comment(sql_file, 1,
"-- does %s have permissions on mysql.proc?\n\n",
current_user);
fix_for_comment(current_user));
maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!",
current_user, query_buff);
}
Expand Down Expand Up @@ -2818,6 +2818,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,

my_free(scv_buff);

if (path)
my_fclose(sql_file, MYF(MY_WME));
DBUG_RETURN(0);
}
else
Expand Down Expand Up @@ -5827,8 +5829,7 @@ static my_bool get_view_structure(char *table, char* db)
dynstr_free(&ds_view);
}

if (switch_character_set_results(mysql, default_charset))
DBUG_RETURN(1);
switch_character_set_results(mysql, default_charset);

/* If a separate .sql file was opened, close it now */
if (sql_file != md_result_file)
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlimport.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2011, 2016, MariaDB
Copyright (c) 2011, 2017, MariaDB
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 Down
2 changes: 1 addition & 1 deletion client/mysqlshow.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB
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 Down
2 changes: 1 addition & 1 deletion client/mysqlslap.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB
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 Down
27 changes: 13 additions & 14 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, Monty Program Ab.
Copyright (c) 2009, 2017, MariaDB
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 Down Expand Up @@ -1062,7 +1062,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
if (!(v= var_get(p, &p, 0, 0)))
{
report_or_die( "Bad variable in eval");
return;
DBUG_VOID_RETURN;
}
dynstr_append_mem(query_eval, v->str_val, v->str_val_len);
}
Expand Down Expand Up @@ -1721,13 +1721,12 @@ void log_msg(const char *fmt, ...)
int cat_file(DYNAMIC_STRING* ds, const char* filename)
{
int fd;
size_t len;
int len;
char buff[16384];

if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
return 1;
while((len= my_read(fd, (uchar*)&buff,
sizeof(buff)-1, MYF(0))) > 0)
while((len= (int)my_read(fd, (uchar*)&buff, sizeof(buff)-1, MYF(0))) > 0)
{
char *p= buff, *start= buff,*end=buff+len;
while (p < end)
Expand Down Expand Up @@ -1777,7 +1776,7 @@ static int run_command(char* cmd,
if (!(res_file= popen(cmd, "r")))
{
report_or_die("popen(\"%s\", \"r\") failed", cmd);
return -1;
DBUG_RETURN(-1);
}

while (fgets(buf, sizeof(buf), res_file))
Expand Down Expand Up @@ -2685,7 +2684,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
report_or_die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
eval_expr(var, "", 0);
return;
DBUG_VOID_RETURN;
}
dynstr_free(&ds_query);

Expand Down Expand Up @@ -2876,7 +2875,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
dynstr_free(&ds_query);
dynstr_free(&ds_col);
eval_expr(var, "", 0);
return;
DBUG_VOID_RETURN;
}

{
Expand All @@ -2901,7 +2900,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
ds_col.str, ds_query.str);
dynstr_free(&ds_query);
dynstr_free(&ds_col);
return;
DBUG_VOID_RETURN;
}
DBUG_PRINT("info", ("Found column %d with name '%s'",
i, fields[i].name));
Expand Down Expand Up @@ -3349,7 +3348,7 @@ void do_exec(struct st_command *command)
if (!*cmd)
{
report_or_die("Missing argument in exec");
return;
DBUG_VOID_RETURN;
}
command->last_argument= command->end;

Expand Down Expand Up @@ -3383,7 +3382,7 @@ void do_exec(struct st_command *command)
dynstr_free(&ds_cmd);
if (command->abort_on_error)
report_or_die("popen(\"%s\", \"r\") failed", command->first_argument);
return;
DBUG_VOID_RETURN;
}

ds_result= &ds_res;
Expand Down Expand Up @@ -3441,7 +3440,7 @@ void do_exec(struct st_command *command)
ds_cmd.str, error, status, errno,
ds_res.str);
dynstr_free(&ds_cmd);
return;
DBUG_VOID_RETURN;
}

DBUG_PRINT("info",
Expand Down Expand Up @@ -3574,7 +3573,7 @@ void do_system(struct st_command *command)
if (strlen(command->first_argument) == 0)
{
report_or_die("Missing arguments to system, nothing to do!");
return;
DBUG_VOID_RETURN;
}

init_dynamic_string(&ds_cmd, 0, command->query_len + 64, 256);
Expand Down Expand Up @@ -4561,7 +4560,7 @@ void do_perl(struct st_command *command)
if (command->abort_on_error)
die("popen(\"%s\", \"r\") failed", buf);
dynstr_free(&ds_delimiter);
return;
DBUG_VOID_RETURN;
}

while (fgets(buf, sizeof(buf), res_file))
Expand Down
2 changes: 2 additions & 0 deletions cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ OPTION(ENABLED_LOCAL_INFILE "" ON)
IF(RPM)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "")
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "")
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
Expand Down
2 changes: 1 addition & 1 deletion cmake/libutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# binaries properly)
ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
COMMAND rm ${TARGET_LOCATION}
COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}
COMMAND libtool -static -o ${TARGET_LOCATION}
${STATIC_LIBS}
)
ELSE()
Expand Down
Loading

0 comments on commit 92209ac

Please sign in to comment.