Skip to content

Commit 471e58f

Browse files
committed
MERGE: mysql-trunk-->mysql-trunk-wl5768
2 parents 7052506 + 7c59f7b commit 471e58f

File tree

956 files changed

+8880
-4029
lines changed

Some content is hidden

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

956 files changed

+8880
-4029
lines changed

.bzrignore

+1
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,7 @@ scripts/mysql_fix_privilege_tables_sql.c
18461846
scripts/mysql_fix_privilege_tables_sql.c.rule
18471847
scripts/mysql_install_db
18481848
scripts/mysql_secure_installation
1849+
scripts/mysql_server_config
18491850
scripts/mysql_setpermission
18501851
scripts/mysql_tableinfo
18511852
scripts/mysql_upgrade

CMakeLists.txt

+29
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,35 @@ IF (WITH_ASAN)
302302
ENDIF()
303303

304304

305+
OPTION(WITH_MSAN "Enable memory sanitizer" OFF)
306+
IF(WITH_MSAN)
307+
MY_CHECK_C_COMPILER_FLAG("-fsanitize=memory" HAVE_C_FMSANITIZE)
308+
MY_CHECK_CXX_COMPILER_FLAG("-fsanitize=memory" HAVE_CXX_FMSANITIZE)
309+
310+
IF(HAVE_C_FMSANITIZE AND HAVE_CXX_FMSANITIZE)
311+
# We switch on basic optimization also for debug builds.
312+
# With optimization we may get some warnings, so we switch off -Werror
313+
SET(MSAN_FLAGS
314+
"-fsanitize=memory -fsanitize-memory-track-origins -O1 -fPIC")
315+
SET(CMAKE_C_FLAGS_DEBUG
316+
"${CMAKE_C_FLAGS_DEBUG} ${MSAN_FLAGS} -Wno-error")
317+
SET(CMAKE_C_FLAGS_RELWITHDEBINFO
318+
"${CMAKE_C_FLAGS_RELWITHDEBINFO} ${MSAN_FLAGS}")
319+
SET(CMAKE_CXX_FLAGS_DEBUG
320+
"${CMAKE_CXX_FLAGS_DEBUG} ${MSAN_FLAGS} -Wno-error")
321+
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
322+
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${MSAN_FLAGS}")
323+
ELSE()
324+
MESSAGE(FATAL_ERROR "Do not know how to enable memory sanitizer")
325+
ENDIF()
326+
ENDIF()
327+
328+
IF(WITH_ASAN AND WITH_MSAN)
329+
MESSAGE(FATAL_ERROR
330+
"Cannot use AddressSanitizer and MemorySanitizer together")
331+
ENDIF()
332+
333+
305334
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
306335
IF(ENABLE_DEBUG_SYNC)
307336
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")

client/mysql_upgrade.c

+1
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
465465
*/
466466
if (run_tool(tool_executable_name,
467467
&ds_tmp, /* Get output from command, discard*/
468+
"--no-defaults",
468469
"--help",
469470
"2>&1",
470471
IF_WIN("> NUL", "> /dev/null"),

client/mysqladmin.cc

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -40,7 +40,7 @@ ulonglong last_values[MAX_MYSQL_VAR];
4040
static int interval=0;
4141
static my_bool option_force=0,interrupted=0,new_line=0,
4242
opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0,
43-
tty_password= 0, opt_nobeep;
43+
tty_password= 0, opt_nobeep, opt_secure_auth= TRUE;
4444
static my_bool debug_info_flag= 0, debug_check_flag= 0;
4545
static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
4646
static uint opt_count_iterations= 0, my_end_arg;
@@ -183,6 +183,9 @@ static struct my_option my_long_options[] =
183183
"Currently only works with extended-status.",
184184
&opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
185185
0, 0, 0},
186+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
187+
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
188+
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
186189
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
187190
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
188191
"Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
@@ -354,6 +357,8 @@ int main(int argc,char *argv[])
354357

355358
if (opt_bind_addr)
356359
mysql_options(&mysql,MYSQL_OPT_BIND,opt_bind_addr);
360+
if (!opt_secure_auth)
361+
mysql_options(&mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
357362
if (opt_compress)
358363
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
359364
if (opt_connect_timeout)

client/mysqlbinlog.cc

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -138,6 +138,7 @@ static int port= 0;
138138
static uint my_end_arg;
139139
static const char* sock= 0;
140140
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
141+
static my_bool opt_secure_auth= TRUE;
141142

142143
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
143144
static char *shared_memory_base_name= 0;
@@ -1499,6 +1500,9 @@ static struct my_option my_long_options[] =
14991500
"prefix for the file names.",
15001501
&output_file, &output_file, 0, GET_STR, REQUIRED_ARG,
15011502
0, 0, 0, 0, 0, 0},
1503+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
1504+
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
1505+
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
15021506
{"server-id", OPT_SERVER_ID,
15031507
"Extract only binlog entries created by the server having the given id.",
15041508
&server_id, &server_id, 0, GET_ULONG,
@@ -1894,6 +1898,8 @@ static Exit_status safe_connect()
18941898
mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
18951899
if (opt_bind_addr)
18961900
mysql_options(mysql, MYSQL_OPT_BIND, opt_bind_addr);
1901+
if (!opt_secure_auth)
1902+
mysql_options(mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
18971903
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
18981904
if (shared_memory_base_name)
18991905
mysql_options(mysql, MYSQL_SHARED_MEMORY_BASE_NAME,

client/mysqlcheck.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -41,7 +41,7 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
4141
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
4242
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
4343
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
44-
opt_write_binlog= 1;
44+
opt_write_binlog= 1, opt_secure_auth=TRUE;
4545
static uint verbose = 0, opt_mysql_port=0;
4646
static int my_end_arg;
4747
static char * opt_mysql_unix_port = 0;
@@ -144,6 +144,9 @@ static struct my_option my_long_options[] =
144144
"when commands should not be sent to replication slaves.",
145145
&opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
146146
1, 0, 0, 0, 0, 0},
147+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
148+
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
149+
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
147150
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
148151
0, 0},
149152
{"password", 'p',
@@ -886,6 +889,8 @@ static int dbConnect(char *host, char *user, char *passwd)
886889
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
887890
if (opt_bind_addr)
888891
mysql_options(&mysql_connection, MYSQL_OPT_BIND, opt_bind_addr);
892+
if (!opt_secure_auth)
893+
mysql_options(&mysql_connection, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
889894
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
890895
if (shared_memory_base_name)
891896
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);

client/mysqldump.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -109,7 +109,8 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
109109
opt_slave_apply= 0,
110110
opt_include_master_host_port= 0,
111111
opt_events= 0, opt_comments_used= 0,
112-
opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0;
112+
opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0,
113+
opt_secure_auth= 1;
113114
static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
114115
static ulong opt_max_allowed_packet, opt_net_buffer_length;
115116
static MYSQL mysql_connection,*mysql=0;
@@ -512,6 +513,9 @@ static struct my_option my_long_options[] =
512513
{"socket", 'S', "The socket file to use for connection.",
513514
&opt_mysql_unix_port, &opt_mysql_unix_port, 0,
514515
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
516+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
517+
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
518+
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
515519
#include <sslopt-longopts.h>
516520
{"tab",'T',
517521
"Create tab-separated textfile for each table to given path. (Create .sql "
@@ -1602,6 +1606,8 @@ static int connect_to_db(char *host, char *user,char *passwd)
16021606
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
16031607
if (opt_bind_addr)
16041608
mysql_options(&mysql_connection,MYSQL_OPT_BIND,opt_bind_addr);
1609+
if (!opt_secure_auth)
1610+
mysql_options(&mysql_connection,MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
16051611
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
16061612
if (shared_memory_base_name)
16071613
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);

client/mysqlimport.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -47,7 +47,7 @@ static char *add_load_option(char *ptr,const char *object,
4747

4848
static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0,
4949
replace=0,silent=0,ignore=0,opt_compress=0,
50-
opt_low_priority= 0, tty_password= 0;
50+
opt_low_priority= 0, tty_password= 0, opt_secure_auth= 1;
5151
static my_bool debug_info_flag= 0, debug_check_flag= 0;
5252
static uint opt_use_threads=0, opt_local_file=0, my_end_arg= 0;
5353
static char *opt_password=0, *current_user=0,
@@ -161,6 +161,9 @@ static struct my_option my_long_options[] =
161161
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
162162
{"replace", 'r', "If duplicate unique key was found, replace old row.",
163163
&replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
164+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
165+
" uses old (pre-4.1.1) protocol.",
166+
&opt_secure_auth, &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
164167
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
165168
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
166169
"Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
@@ -425,6 +428,8 @@ static MYSQL *db_connect(char *host, char *database,
425428
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
426429
if (opt_bind_addr)
427430
mysql_options(mysql,MYSQL_OPT_BIND,opt_bind_addr);
431+
if (!opt_secure_auth)
432+
mysql_options(mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
428433
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
429434
if (shared_memory_base_name)
430435
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);

client/mysqlshow.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -38,6 +38,7 @@ static uint my_end_arg= 0;
3838
static uint opt_verbose=0;
3939
static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
4040
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
41+
static my_bool opt_secure_auth= TRUE;
4142

4243
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
4344
static char *shared_memory_base_name=0;
@@ -122,6 +123,8 @@ int main(int argc, char **argv)
122123
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
123124
if (opt_bind_addr)
124125
mysql_options(&mysql,MYSQL_OPT_BIND,opt_bind_addr);
126+
if (!opt_secure_auth)
127+
mysql_options(&mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
125128
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
126129
if (shared_memory_base_name)
127130
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
@@ -234,6 +237,9 @@ static struct my_option my_long_options[] =
234237
{"protocol", OPT_MYSQL_PROTOCOL,
235238
"The protocol to use for connection (tcp, socket, pipe, memory).",
236239
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
240+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
241+
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
242+
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
237243
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
238244
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
239245
"Base name of shared memory.", &shared_memory_base_name,

client/mysqlslap.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -126,6 +126,7 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
126126
*post_system= NULL,
127127
*opt_mysql_unix_port= NULL;
128128
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
129+
static my_bool opt_secure_auth= TRUE;
129130
static uint opt_enable_cleartext_plugin= 0;
130131
static my_bool using_opt_enable_cleartext_plugin= 0;
131132

@@ -338,6 +339,8 @@ int main(int argc, char **argv)
338339
SSL_SET_OPTIONS(&mysql);
339340
if (opt_protocol)
340341
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
342+
if (!opt_secure_auth && slap_connect(&mysql))
343+
mysql_options(&mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth);
341344
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
342345
if (shared_memory_base_name)
343346
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
@@ -677,6 +680,9 @@ static struct my_option my_long_options[] =
677680
{"query", 'q', "Query to run or file containing query to run.",
678681
&user_supplied_query, &user_supplied_query,
679682
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
683+
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
684+
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
685+
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
680686
#if defined (_WIN32) && !defined (EMBEDDED_LIBRARY)
681687
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
682688
"Base name of shared memory.", &shared_memory_base_name,

cmake/build_configurations/mysql_release.cmake

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -60,3 +60,13 @@ IF(UNIX)
6060

6161
ENDIF()
6262

63+
# Release builds on Solaris need to do an extra build to compile the
64+
# client libraries with Sun Studio. The release build script will replace
65+
# those libraries and the corresponding mysql_config before making the
66+
# final package.
67+
# But *this* mysql_config is still relevant for the embedded library
68+
# which will not be rebuilt, so we ensure we make a copy of it.
69+
70+
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCC)
71+
SET(COPY_MYSQL_CONFIG 1 CACHE BOOL "")
72+
ENDIF()

cmake/cpack_source_ignore_files.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -39,6 +39,7 @@ scripts/mysql_find_rows$
3939
scripts/mysql_fix_extensions$
4040
scripts/mysql_install_db$
4141
scripts/mysql_secure_installation$
42+
scripts/mysql_server_config$
4243
scripts/mysql_setpermission$
4344
scripts/mysql_zap$
4445
scripts/mysqlaccess$

cmake/os/FreeBSD.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -20,5 +20,3 @@
2020
# #Legacy option, maybe not needed anymore , taken as is from autotools build
2121
# ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000)
2222

23-
# The below was used for really old versions of FreeBSD, roughly: before 5.1.9
24-
# ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH)

cmake/os/Linux.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ ENDFOREACH()
3232

3333
# Ensure we have clean build for shared libraries
3434
# without unresolved symbols
35-
# Not supported with AddressSanitizer
36-
IF(NOT WITH_ASAN)
35+
# Not supported with AddressSanitizer and MemorySanitizer
36+
IF(NOT WITH_ASAN AND NOT WITH_MSAN)
3737
SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
3838
ENDIF()
3939

0 commit comments

Comments
 (0)