Skip to content

Commit 8cfa734

Browse files
Merged 'mysql-5.7.13' into ps-5.7.13-merge
Merge blueprint: https://blueprints.launchpad.net/percona-server/+spec/merge-5.7.13 *** Conflict in 'libmysql/libmysql.ver.in' resolved in combining 'libmysqlclient' -> 'libperconaserverclient' rename with splitting '@.0' and '@.3' libraries. *** Conflict in 'sql/rpl_slave.cc' in 'global_init_info()' resolved in combining both changes - call to 'fill_mts_gaps_and_recover()' put under binlog protection. PS bugs: lp:1358836 "Backup locks do not guarantee consistent SHOW SLAVE STATUS with binary log disabled" (https://bugs.launchpad.net/percona-server/+bug/1358836) lp:1372806 "Deadlock with LOCK BINLOG FOR BACKUP + SHOW SLAVE STATUS with binary log enabled" (https://bugs.launchpad.net/percona-server/+bug/1372806) (commit aaf2f1f) Oracle bug: (http://bugs.mysql.com/bug.php?id=77496) (commit 3bffd42) *** Reverted our fix for lp:1566642 "Replication does not work when @@GLOBAL.SERVER_UUID is missing on the master" (https://bugs.launchpad.net/percona-server/+bug/1566642) (commit 4663069) in favor of the upstream fix for (http://bugs.mysql.com/bug.php?id=80962) (commit 71c0780) Removed our MTR test case "rpl.bug80962" as new checks from "rpl.rpl_get_master_version_and_clock" completely covers it. *** Reverted our fix for lp:1552682 "Audit log worker thread may crash on write call writing fewer bytes than requested" (https://bugs.launchpad.net/percona-server/+bug/1552682) (commit 35fa3b9) in favor of the upstream fix for (commit 4b9d594) *** Reverted our fix for lp:1454441 "Hanging 'System Lock' when executing 'flush table ... for export'" (https://bugs.launchpad.net/percona-server/+bug/1454441) (commit 5692683) in favor of the upstream fix for (http://bugs.mysql.com/bug.php?id=77011) (commit 4b714c4, 5,6->5.7 merge commit eff4a3c) Removed our MTR test case "innodb.percona_bug1454441" as "innodb.flush-hang" completely covers it. *** Conflicting changes in 'log_buffer_extend()' and 'log_init()' in 'storage/innobase/log/log0log.cc' combined into "ut_zalloc_nokey(log_sys->buf_size * 2 + srv_log_write_ahead_size));" Alignment assertions in 'log_buffer_switch()' changed to "ut_ad(log_sys->buf == ut_align(log_sys->buf_ptr, srv_log_write_ahead_size));" References: lp:1578516 "Innodb crash recovery with ALL_O_DIRECT in 5.7 errno != EINVAL" (https://bugs.launchpad.net/percona-server/+bug/1578516) (commit 3eeb4a1) (commit aa47808) *** Removed MTR test case 'main.bug73556' as it tests the same Bug #73556 as 'main.percona_bug1354011'. *** Re-recorded the following MTR tests after WL#9124 "Extension of inlined JSON path operato." (commit a5d4e7c) upstream implementation: 'main.opt_hints_pfs' 'perfschema.digest_table_full' 'perfschema.rpl_gtid_func' 'perfschema.start_server_low_digest' 'perfschema.start_server_low_digest_sql_length' 'perfschema.statement_digest' 'perfschema.statement_digest_consumers' 'perfschema.statement_digest_long_query' 'query_rewrite_plugins.digest_collision' 'query_rewrite_plugins.optional_columns' 'query_rewrite_plugins.verbose' *** Re-recorded 'audit_log.audit_log_threadpool' as because of the WL#5705 "Audit log plugin fine-grained pre-filtering" (commit 1edc52a) a new 'MYSQL_AUDIT_CONNECTION_DISCONNECT' event is generated. *** 'rpl.percona_bug1331586' MTR test case re-enabled for valgrind as the root cause why it was disabled originally was fixed in 5.7.13 Bug #22110916 / #78999 "INJECTED QUERY LOG EVENTS DO NOT SET EXPLICIT_DEFAULTS_TS, READ IT ON APPLYING" (http://bugs.mysql.com/bug.php?id=78999) (commit 626a9cd) *** 'rpl.rpl_checksum_cache' MTR test case re-enable for ASan as the root cause why it was disabled originally was fixed in 5.7.13 Bug #22109863 / #78995 "Binlog_sender::read_event may access freed event buffer" (https://bugs.mysql.com/bug.php?id=78995) (commit 72f463e) *** Removed extra "lldb" help string in 'mysql-test/mysql-test-run.pl' *** Fixed SIGSEGV problem in 'pfs_instr-oom' unit test. This is a Percona fix for Bug#81868 "pfs_instr-oom unit test fails on MySQL Server 5.7.13" (http://bugs.mysql.com/bug.php?id=81868). ** Disabled 'scalability_metrics.scalability_metrics' MTR test case as because of the existing accessing freed memory problem lp:1441139 "handle_fatal_signal (sig=11) in Queue<PROF_MEASUREMENT>::pop | sql/sql_profile.h:127 | handle_fatal_signal (sig=11) in my_lfind" (https://bugs.launchpad.net/percona-server/+bug/1441139) and because of the additional MYSQL_AUDIT_CONNECTION_DISCONNECT event generated in recently implemented WL#5705 "Audit log plugin fine-grained pre-filtering" (commit 1edc52a), this test case cannot be run without crashing the server anymore. *** Percona-specific code containing '__attibute__(())' GCC extensions refactored to utilize new 'MY_ATTRIBUTE()' macro. *** Updated man pages from MySQL Server 5.7.13 source tarball. *** VERSION raised to "5.7.13-6". univ.i version raised to "6" *** This merge also fixes lp:1541698 "Invalid InnoDB FTS Doc ID during INSERT" (https://bugs.launchpad.net/percona-server/+bug/1541698) as corresponding upstream Bug #80261 / #22679185 "Invalid InnoDB FTS Doc ID during INSERT" (http://bugs.mysql.com/bug.php?id=80261) was fixed in 5.7.13.
2 parents 0022004 + e0e0ae2 commit 8cfa734

File tree

1,040 files changed

+21950
-6606
lines changed

Some content is hidden

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

1,040 files changed

+21950
-6606
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,6 @@ strings/test_decimal
28412841
support-files/*.ini
28422842
support-files/MacOSX/Description.plist
28432843
support-files/MacOSX/Info.plist
2844-
support-files/MacOSX/ReadMe.txt
28452844
support-files/MacOSX/StartupParameters.plist
28462845
support-files/MacOSX/postflight
28472846
support-files/MacOSX/postinstall

VERSION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=7
3-
MYSQL_VERSION_PATCH=12
4-
MYSQL_VERSION_EXTRA=-5
3+
MYSQL_VERSION_PATCH=13
4+
MYSQL_VERSION_EXTRA=-6

client/base/abstract_program.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016 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
@@ -28,7 +28,7 @@ extern const char *load_default_groups[];
2828

2929
my_bool Abstract_program::callback_option_parsed(
3030
int optid,
31-
const struct my_option *opt __attribute__((unused)),
31+
const struct my_option *opt MY_ATTRIBUTE((unused)),
3232
char *argument)
3333
{
3434
// Check if option uses My::Tools::Base::Options, and it should.

client/base/abstract_program.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016 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
@@ -83,6 +83,10 @@ class Abstract_program : public Options::Composite_options_provider
8383
Prints program invocation message.
8484
*/
8585
virtual void short_usage()= 0;
86+
/**
87+
Return error code
88+
*/
89+
virtual int get_error_code()= 0;
8690

8791
protected:
8892
Abstract_program();
@@ -108,7 +112,7 @@ class Abstract_program : public Options::Composite_options_provider
108112
If we have anonymous functions or binding this should be removed.
109113
*/
110114
static my_bool callback_option_parsed(int optid,
111-
const struct my_option *opt __attribute__((unused)),
115+
const struct my_option *opt MY_ATTRIBUTE((unused)),
112116
char *argument);
113117

114118
Options::Debug_options m_debug_options;

client/base/debug_options.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -72,7 +72,7 @@ void Debug_options::create_options()
7272
}
7373

7474

75-
void Debug_options::debug_option_callback(char *argument __attribute__((unused)))
75+
void Debug_options::debug_option_callback(char *argument MY_ATTRIBUTE((unused)))
7676
{
7777
if (this->m_dbug_option.has_value())
7878
{

client/base/debug_options.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -52,7 +52,7 @@ class Debug_options : public Abstract_options_provider
5252

5353
private:
5454

55-
void debug_option_callback(char *argument __attribute__((unused)));
55+
void debug_option_callback(char *argument MY_ATTRIBUTE((unused)));
5656

5757
Abstract_program* m_program;
5858
bool m_debug_info_flag;

client/base/help_options.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -46,13 +46,13 @@ void Help_options::create_options()
4646
this, &Help_options::version_callback));
4747
}
4848

49-
void Help_options::help_callback(char* argument __attribute__((unused)))
49+
void Help_options::help_callback(char* argument MY_ATTRIBUTE((unused)))
5050
{
5151
this->print_usage();
5252
exit(0);
5353
}
5454

55-
void Help_options::version_callback(char* argument __attribute__((unused)))
55+
void Help_options::version_callback(char* argument MY_ATTRIBUTE((unused)))
5656
{
5757
this->print_version_line();
5858
exit(0);

client/base/help_options.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -51,8 +51,8 @@ class Help_options : public Abstract_options_provider
5151
virtual void print_usage();
5252

5353
private:
54-
void help_callback(char* argument __attribute__((unused)));
55-
void version_callback(char* argument __attribute__((unused)));
54+
void help_callback(char* argument MY_ATTRIBUTE((unused)));
55+
void version_callback(char* argument MY_ATTRIBUTE((unused)));
5656

5757
void print_version_line();
5858

client/base/mysql_connection_options.cc

+6-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -50,19 +50,6 @@ Mysql_connection_options::Mysql_connection_options(Abstract_program *program)
5050
this->add_provider(&this->m_ssl_options_provider);
5151
}
5252

53-
Mysql_connection_options::~Mysql_connection_options()
54-
{
55-
my_boost::mutex::scoped_lock lock(m_connection_mutex);
56-
for (vector<MYSQL*>::iterator it= this->m_allocated_connections.begin();
57-
it != this->m_allocated_connections.end(); it++)
58-
{
59-
if (*it)
60-
{
61-
mysql_close(*it);
62-
}
63-
}
64-
}
65-
6653
void Mysql_connection_options::create_options()
6754
{
6855
this->create_new_option(&this->m_bind_addr, "bind-address",
@@ -129,13 +116,7 @@ void Mysql_connection_options::create_options()
129116

130117
MYSQL* Mysql_connection_options::create_connection()
131118
{
132-
MYSQL *connection = new MYSQL;
133-
134-
{
135-
my_boost::mutex::scoped_lock lock(m_connection_mutex);
136-
this->m_allocated_connections.push_back(connection);
137-
}
138-
mysql_init(connection);
119+
MYSQL *connection= mysql_init(NULL);
139120
if (this->m_compress)
140121
mysql_options(connection, MYSQL_OPT_COMPRESS, NullS);
141122

@@ -184,6 +165,7 @@ MYSQL* Mysql_connection_options::create_connection()
184165
this->get_null_or_string(this->m_mysql_unix_port), 0))
185166
{
186167
this->db_error(connection, "while connecting to the MySQL server");
168+
mysql_close(connection);
187169
return NULL;
188170
}
189171

@@ -218,22 +200,22 @@ const char* Mysql_connection_options::get_null_or_string(
218200

219201
#ifdef _WIN32
220202
void Mysql_connection_options::pipe_protocol_callback(
221-
char* not_used __attribute__((unused)))
203+
char* not_used MY_ATTRIBUTE((unused)))
222204
{
223205
this->m_protocol= MYSQL_PROTOCOL_PIPE;
224206
}
225207
#endif
226208

227209
void Mysql_connection_options::protocol_callback(
228-
char* not_used __attribute__((unused)))
210+
char* not_used MY_ATTRIBUTE((unused)))
229211
{
230212
this->m_protocol=
231213
find_type_or_exit(this->m_protocol_string.value().c_str(),
232214
&sql_protocol_typelib, "protocol");
233215
}
234216

235217
void Mysql_connection_options::secure_auth_callback(
236-
char* not_used __attribute__((unused)))
218+
char* not_used MY_ATTRIBUTE((unused)))
237219
{
238220
/* --secure-auth is a zombie option. */
239221
if (!this->m_secure_auth)

client/base/mysql_connection_options.h

+3-10
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class Mysql_connection_options
7474
@param program Pointer to main program class.
7575
*/
7676
Mysql_connection_options(Abstract_program *program);
77-
~Mysql_connection_options();
7877

7978
/**
8079
Creates all options that will be provided.
@@ -111,19 +110,13 @@ class Mysql_connection_options
111110
*/
112111
void db_error(MYSQL* connection, const char* when);
113112
#ifdef _WIN32
114-
void pipe_protocol_callback(char* not_used __attribute__((unused)));
113+
void pipe_protocol_callback(char* not_used MY_ATTRIBUTE((unused)));
115114
#endif
116-
void protocol_callback(char* not_used __attribute__((unused)));
117-
void secure_auth_callback(char* argument __attribute__((unused)));
115+
void protocol_callback(char* not_used MY_ATTRIBUTE((unused)));
116+
void secure_auth_callback(char* argument MY_ATTRIBUTE((unused)));
118117

119118
static bool mysql_inited;
120119

121-
/*
122-
List of created connections. As we don't have memory management for
123-
C structs we must clear it by options provider destruction.
124-
*/
125-
std::vector<MYSQL*> m_allocated_connections;
126-
my_boost::mutex m_connection_mutex;
127120
Ssl_options m_ssl_options_provider;
128121
Abstract_program *m_program;
129122
Nullable<std::string> m_protocol_string;

client/base/mysql_query_runner.cc

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -28,17 +28,40 @@ using std::string;
2828

2929
Mysql_query_runner::Mysql_query_runner(MYSQL* connection)
3030
: m_is_processing(new my_boost::atomic<bool>(false)),
31+
m_is_original_runner(true),
3132
m_connection(connection)
3233
{}
3334

3435
Mysql_query_runner::Mysql_query_runner(const Mysql_query_runner& source)
3536
: m_result_callbacks(source.m_result_callbacks),
3637
m_message_callbacks(source.m_message_callbacks),
3738
m_is_processing(source.m_is_processing),
39+
m_is_original_runner(false),
3840
m_connection(source.m_connection)
3941
{
4042
}
4143

44+
Mysql_query_runner::~Mysql_query_runner()
45+
{
46+
if (m_is_original_runner)
47+
{
48+
for (std::vector<I_callable<int64, const Row&>*>::iterator
49+
it= m_result_callbacks.begin(); it != m_result_callbacks.end(); ++it)
50+
{
51+
delete *it;
52+
}
53+
for (std::vector<I_callable<int64, const Message_data&>*>::iterator
54+
it= m_message_callbacks.begin(); it != m_message_callbacks.end(); ++it)
55+
{
56+
delete *it;
57+
}
58+
59+
delete m_is_processing;
60+
61+
mysql_close(this->m_connection);
62+
}
63+
}
64+
4265
Mysql_query_runner& Mysql_query_runner::add_result_callback(
4366
I_callable<int64, const Row& >* result_callback)
4467
{
@@ -280,7 +303,7 @@ void Mysql_query_runner::append_escape_string(
280303

281304
int length = mysql_real_escape_string_quote(
282305
m_connection, &((*destination_string)[0]) + start_lenght, original,
283-
original_length, '"');
306+
(ulong)original_length, '"');
284307
destination_string->resize(start_lenght + length);
285308
}
286309

client/base/mysql_query_runner.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2014, 2016, 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
@@ -51,6 +51,8 @@ class Mysql_query_runner
5151
Copy constructor.
5252
*/
5353
Mysql_query_runner(const Mysql_query_runner& source);
54+
55+
~Mysql_query_runner();
5456
/**
5557
Adds new callback to be called on every result row of query.
5658
If callback return value other than 0 then query execution, passing
@@ -214,6 +216,12 @@ class Mysql_query_runner
214216
*/
215217
my_boost::atomic<bool>* m_is_processing;
216218

219+
/**
220+
Indicates if this is original runner or a copy. In case of original the
221+
cleanup is performed on destruction.
222+
*/
223+
bool m_is_original_runner;
224+
217225
MYSQL* m_connection;
218226
};
219227

client/base/password_option.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2001, 2016, 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
@@ -61,6 +61,9 @@ void Password_option::password_callback(char* argument)
6161
}
6262
else
6363
{
64-
*this->m_destination_value = Nullable<string>(::get_tty_password(NULL));
64+
char *password= ::get_tty_password(NULL);
65+
*this->m_destination_value = Nullable<string>(password);
66+
my_free(password);
67+
6568
}
6669
}

client/base/ssl_options.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void Mysql_connection_options::Ssl_options::create_options()
7878

7979

8080
void Mysql_connection_options::Ssl_options::ca_option_callback(
81-
char *argument __attribute__((unused)))
81+
char *argument MY_ATTRIBUTE((unused)))
8282
{
8383
if (!ssl_mode_set_explicitly)
8484
::opt_ssl_mode= SSL_MODE_VERIFY_CA;
@@ -101,7 +101,7 @@ void Mysql_connection_options::Ssl_options::apply_for_connection(
101101

102102

103103
void Mysql_connection_options::Ssl_options::use_ssl_option_callback(
104-
char *argument __attribute__((unused)))
104+
char *argument MY_ATTRIBUTE((unused)))
105105
{
106106
CLIENT_WARN_DEPRECATED("--ssl", "--ssl-mode");
107107
if (!opt_use_ssl_arg)
@@ -112,7 +112,7 @@ void Mysql_connection_options::Ssl_options::use_ssl_option_callback(
112112

113113

114114
void Mysql_connection_options::Ssl_options::ssl_verify_server_cert_callback(
115-
char *argument __attribute__((unused)))
115+
char *argument MY_ATTRIBUTE((unused)))
116116
{
117117
CLIENT_WARN_DEPRECATED("--ssl-verify-server-cert",
118118
"--ssl-mode=VERIFY_IDENTITY");

client/check/mysqlcheck.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2001, 2016, 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
@@ -274,7 +274,7 @@ static void usage(void)
274274

275275

276276
static my_bool
277-
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
277+
get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
278278
char *argument)
279279
{
280280
int orig_what_to_do= what_to_do;

0 commit comments

Comments
 (0)