Skip to content

Commit 92209ac

Browse files
Merge tag 'mariadb-10.0.31' into 10.0-galera
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2 parents 0e3170e + 725e47b commit 92209ac

File tree

491 files changed

+11657
-7947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

491 files changed

+11657
-7947
lines changed

CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2006, 2014, Oracle and/or its affiliates.
2-
# Copyright (c) 2008, 2014, Monty Program Ab
1+
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
2+
# Copyright (c) 2008, 2017, MariaDB
33
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -242,12 +242,9 @@ IF (WITH_ASAN)
242242
ENDIF()
243243
ENDIF()
244244

245-
246-
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
247-
IF(ENABLE_DEBUG_SYNC)
248-
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
249-
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
250-
ENDIF()
245+
# Always enable debug sync for debug builds.
246+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
247+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
251248

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

497-
INSTALL_DOCUMENTATION(README CREDITS COPYING COPYING.LESSER EXCEPTIONS-CLIENT
498-
COMPONENT Readme)
494+
INSTALL_DOCUMENTATION(README CREDITS COPYING EXCEPTIONS-CLIENT COMPONENT Readme)
499495

500496
# MDEV-6526 these files are not installed anymore
501497
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC

COPYING.LESSER

Lines changed: 0 additions & 516 deletions
This file was deleted.

client/client_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,3 @@ enum options_client
117117
Name of the performance schema database.
118118
*/
119119
#define PERFORMANCE_SCHEMA_DB_NAME "performance_schema"
120-

client/mysql.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
3-
Copyright (c) 2009, 2016, MariaDB
3+
Copyright (c) 2009, 2017, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -3061,7 +3061,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
30613061
{
30623062
unsigned int num_fields= mysql_num_fields(result);
30633063
my_ulonglong num_rows= mysql_num_rows(result);
3064-
mysql_fetch_fields(result);
30653064
if (num_fields==3 && num_rows==1)
30663065
{
30673066
if (!(cur= mysql_fetch_row(result)))

client/mysql_upgrade.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
3-
Copyright (c) 2010, 2016, MariaDB
3+
Copyright (c) 2010, 2017, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -1047,15 +1047,15 @@ static int check_version_match(void)
10471047

10481048
int main(int argc, char **argv)
10491049
{
1050-
char self_name[FN_REFLEN];
1050+
char self_name[FN_REFLEN + 1];
10511051

10521052
MY_INIT(argv[0]);
10531053

10541054
#if __WIN__
10551055
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
10561056
#endif
10571057
{
1058-
strncpy(self_name, argv[0], FN_REFLEN);
1058+
strmake_buf(self_name, argv[0]);
10591059
}
10601060

10611061
if (init_dynamic_string(&ds_args, "", 512, 256) ||
@@ -1145,4 +1145,3 @@ int main(int argc, char **argv)
11451145
my_end(my_end_arg);
11461146
exit(0);
11471147
}
1148-

client/mysqladmin.cc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
3-
Copyright (c) 2010, 2016, MariaDB
3+
Copyright (c) 2010, 2017, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -614,6 +614,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
614614

615615
static int execute_commands(MYSQL *mysql,int argc, char **argv)
616616
{
617+
int ret = 0;
617618
const char *status;
618619
/*
619620
MySQL documentation relies on the fact that mysqladmin will
@@ -1107,7 +1108,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
11071108
if (strcmp(typed_password, verified) != 0)
11081109
{
11091110
my_printf_error(0,"Passwords don't match",MYF(ME_BELL));
1110-
return -1;
1111+
ret = -1;
1112+
goto password_done;
11111113
}
11121114
}
11131115
else
@@ -1134,7 +1136,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
11341136
{
11351137
my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'",
11361138
error_flags, mysql_error(mysql));
1137-
return -1;
1139+
ret = -1;
1140+
goto password_done;
11381141
}
11391142
else
11401143
{
@@ -1145,7 +1148,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
11451148
"Could not get old_passwords setting from "
11461149
"server; error: '%s'",
11471150
error_flags, mysql_error(mysql));
1148-
return -1;
1151+
ret = -1;
1152+
goto password_done;
11491153
}
11501154
if (!mysql_num_rows(res))
11511155
old= 1;
@@ -1170,15 +1174,15 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
11701174
{
11711175
my_printf_error(0, "Can't turn off logging; error: '%s'",
11721176
error_flags, mysql_error(mysql));
1173-
return -1;
1177+
ret = -1;
11741178
}
1179+
else
11751180
if (mysql_query(mysql,buff))
11761181
{
11771182
if (mysql_errno(mysql)!=1290)
11781183
{
11791184
my_printf_error(0,"unable to change password; error: '%s'",
11801185
error_flags, mysql_error(mysql));
1181-
return -1;
11821186
}
11831187
else
11841188
{
@@ -1192,9 +1196,10 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
11921196
" --skip-grant-tables).\n"
11931197
"Use: \"mysqladmin flush-privileges password '*'\""
11941198
" instead", error_flags);
1195-
return -1;
11961199
}
1200+
ret = -1;
11971201
}
1202+
password_done:
11981203
/* free up memory from prompted password */
11991204
if (typed_password != argv[1])
12001205
{
@@ -1296,7 +1301,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
12961301
return 1;
12971302
}
12981303
}
1299-
return 0;
1304+
return ret;
13001305
}
13011306

13021307
/**

client/mysqlbinlog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
19761976
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
19771977

19781978
size_t tlen = strlen(logname);
1979-
if (tlen > UINT_MAX)
1979+
if (tlen > sizeof(buf) - 10)
19801980
{
19811981
error("Log name too long.");
19821982
DBUG_RETURN(ERROR_STOP);

client/mysqlcheck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
3-
Copyright (c) 2010, 2016, MariaDB
3+
Copyright (c) 2010, 2017, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by

client/mysqldump.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
3-
Copyright (c) 2010, 2016, MariaDB
3+
Copyright (c) 2010, 2017, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -2142,6 +2142,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
21422142
case '-':
21432143
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
21442144
break;
2145+
/* fall through */
21452146
default:
21462147
fputc(*comment_string, xml_file);
21472148
break;
@@ -2179,7 +2180,6 @@ static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
21792180
print_xml_comment(sql_file, strlen(comment_buff), comment_buff);
21802181
}
21812182

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

28192819
my_free(scv_buff);
28202820

2821+
if (path)
2822+
my_fclose(sql_file, MYF(MY_WME));
28212823
DBUG_RETURN(0);
28222824
}
28232825
else
@@ -5827,8 +5829,7 @@ static my_bool get_view_structure(char *table, char* db)
58275829
dynstr_free(&ds_view);
58285830
}
58295831

5830-
if (switch_character_set_results(mysql, default_charset))
5831-
DBUG_RETURN(1);
5832+
switch_character_set_results(mysql, default_charset);
58325833

58335834
/* If a separate .sql file was opened, close it now */
58345835
if (sql_file != md_result_file)

client/mysqlimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
3-
Copyright (c) 2011, 2016, MariaDB
3+
Copyright (c) 2011, 2017, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)