Merge lp:~akopytov/percona-server/enhancements-for-start-transaction-with-consistent into lp:percona-server/5.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 584
Proposed branch: lp:~akopytov/percona-server/enhancements-for-start-transaction-with-consistent
Merge into: lp:percona-server/5.6
Prerequisite: lp:~akopytov/percona-server/backup-locks
Diff against target: 1877 lines (+1099/-34) (has conflicts)
22 files modified
build-ps/debian/control (+17/-0)
build-ps/debian/rules (+19/-0)
client/client_priv.h (+4/-0)
client/mysqldump.c (+107/-22)
doc/source/upstream-bug-fixes.rst (+135/-0)
mysql-test/r/backup_locks_mysqldump.result (+146/-0)
mysql-test/r/mysqldump-max.result (+57/-0)
mysql-test/suite/binlog/r/binlog_consistent.result (+103/-0)
mysql-test/suite/binlog/t/binlog_consistent.test (+88/-0)
mysql-test/suite/perfschema/r/dml_setup_instruments.result (+1/-1)
mysql-test/t/backup_locks_mysqldump.test (+61/-0)
mysql-test/t/mysqldump-max.test (+83/-0)
sql/binlog.cc (+183/-6)
sql/binlog.h (+12/-1)
sql/handler.cc (+10/-0)
sql/handler.h (+10/-0)
sql/log.cc (+11/-1)
sql/log.h (+28/-0)
sql/mysqld.cc (+8/-2)
sql/mysqld.h (+2/-1)
sql/share/errmsg-utf8.txt (+7/-0)
storage/innobase/buf/buf0flu.cc (+7/-0)
Text conflict in build-ps/debian/control
Text conflict in build-ps/debian/rules
Text conflict in client/client_priv.h
Text conflict in client/mysqldump.c
Text conflict in doc/source/upstream-bug-fixes.rst
Text conflict in mysql-test/r/backup_locks_mysqldump.result
Text conflict in mysql-test/t/backup_locks_mysqldump.test
Text conflict in sql/handler.h
Text conflict in sql/share/errmsg-utf8.txt
Text conflict in storage/innobase/buf/buf0flu.cc
To merge this branch: bzr merge lp:~akopytov/percona-server/enhancements-for-start-transaction-with-consistent
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+207877@code.launchpad.net

Description of the change

    Implementation of
    https://blueprints.launchpad.net/percona-server/+spec/enhancements-for-start-transaction-with-consistent.

    This is a port of enhancements to START TRANSACTION WITH CONSISTENT
    SNAPSHOT in MariaDB 5.3+ to the group commit implementation available in
    MySQL/PS 5.6.

    The major difference with the MariaDB group commit implementation is
    that there’s just one mutex to block storage engine commits and binary
    log updates, LOCK_commit_ordered, which is used by both TC_LOG_MMAP and
    MYSQL_BIN_LOG. In PS 5.6 LOCK_log is used to protect binary log updates
    and commits are performed by the commit stage leader thread under the
    LOCK_commit mutex. Unless binlog_order_commits is 0, in which case
    commits are performed in parallel by the corresponding threads. When
    binary log is not used as a transaction coordinator, there is no mutex
    protecting commits neither.

    Introducing new mutexes to provide atomicity for START TRANSACTION WITH
    CONSISTENT SNAPSHOT would have a serious performance impact: we don’t
    really want to serialize commits, but rather make block them for a short
    duration when STWCS initiates snapshot creation for all storage
    engines. Therefore, this patch introduces four new “methods” to the
    transaction coordinator class: xlock(), xunlock(), slock() and
    sunlock(). The first 2 acquire/release an exclusive lock on commits,
    whereas the other 2 acquire/release a shared lock. Depending on the
    transaction coordinator being used and the binlog_order_commits value,
    those functions may either:

    1) be no-ops (for TC_LOG_DUMMY)
    2) just lock LOCK_log and LOCK_commit, as that guarantees that no binary
    log updates and commits will occur with binlog_order_commits=1
    3) lock LOCK_log and a new global rwlock, LOCK_consistent_snapshot. A
    shared lock on it may be acquired on commits, and an exclusive lock may
    only be acquired for STWCS.
    4) use only LOCK_consistent_snapshot without LOCK_log when no binary log
    is used (i.e. in TC_LOG_MMAP).

    mysqldump changes have been merged with backup locks changes. Now
    mysqldump --lock-for-backup --single-transaction does not resort to
    FTWRL even if --master-data is also requested.

http://jenkins.percona.com/view/PS%205.6/job/percona-server-5.6-param/527/

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

    - mysqlbinlog.c:check_consistent_binlog_pos: shouldn't the first
      exit from the function return 0 not 1?
    - check_consistent_binlog_pos returns 1 for position found, 0 for
      not found. Most other mysqldump.c functions return 0 for
      success, 1 failure. Don't have a strong opinion whether this
      should be fixed, just pointing out.
    - Might be a good idea to include show_binlog_events[2].inc in MTR
      instead of direct replace_regex/SHOW BINLOG EVENTS, to save any
      future regexp maintenance, and, if we ever do MTR collections
      runs, make the testcase more compatible with GTID mode I guess.
    - MYSQL_BIN_LOG::get_commit_lock is unused.
    - Diff lines 1077/1078: spurious change?

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hi Laurynas,

On Tue, May 06 2014 11:03:13 +0400, Laurynas Biveinis wrote:

> Review: Needs Fixing
>
> - mysqlbinlog.c:check_consistent_binlog_pos: shouldn't the first
> exit from the function return 0 not 1?

Hard to tell. The only case when we reach the first exit in
check_consistent_binlog_pos() is when the SHOW STATUS LIKE query
fails (as in, not returns an empty result set, but fails), and mysqldump
is invoked with --force. Now, if we are running with --force and the
SHOW STATUS query fails for whatever reasons, should we proceed with the
assumption that STWCS enhancements are available or not?

The original MariaDB patch assumes that they are available. I didn’t
mind. Looked like a corner case to me.

> - check_consistent_binlog_pos returns 1 for position found, 0 for
> not found. Most other mysqldump.c functions return 0 for
> success, 1 failure. Don't have a strong opinion whether this
> should be fixed, just pointing out.

That’s correct, but OTOH the purpose of the function is to check whether
something is available. I.e. it should be boolean and named something
like ‘has_consistent_binlog_pos’. I.e. the return code of 0 actually
indicates ‘false’ rather than a failure.

> - Might be a good idea to include show_binlog_events[2].inc in MTR
> instead of direct replace_regex/SHOW BINLOG EVENTS, to save any
> future regexp maintenance, and, if we ever do MTR collections
> runs, make the testcase more compatible with GTID mode I guess.

That’s one of the things I tried to change from the MariaDB’s
implementation. That didn’t work out, because show_binlog_events[2] also
mask binlog positions. Which are essential to that specific test case:
we want to make sure that reported binlog coordinates map to specific
binlog positions. Which is hard to do without positions being reported
in SHOW BINLOG EVENTS.

> - MYSQL_BIN_LOG::get_commit_lock is unused.

Yep, fixed.

> - Diff lines 1077/1078: spurious change?

Yep, fixed.

http://jenkins.percona.com/view/PS%205.6/job/percona-server-5.6-param/598/

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Looks good.

The diff shows many spurious changes now. Would you mind either rebasing the branch on the current trunk, either just pushing to the trunk yourself?

review: Approve
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Yep, noticed the conflicts. I will merge it to trunk and see what is.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

No conflicts occurred with bzr merge --weave (it was a criss-cross merge due to backup locks dependency).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'build-ps/debian/control'
--- build-ps/debian/control 2014-04-25 10:55:01 +0000
+++ build-ps/debian/control 2014-05-06 08:36:28 +0000
@@ -2,6 +2,7 @@
2Section: database2Section: database
3Priority: extra3Priority: extra
4Maintainer: Percona Server Development Team <mysql-dev@percona.com>4Maintainer: Percona Server Development Team <mysql-dev@percona.com>
5<<<<<<< TREE
5Uploaders: George Lorch <george.lorch@percona.com>,6Uploaders: George Lorch <george.lorch@percona.com>,
6 Alexey Bychko <alexey.bychko@percona.com>7 Alexey Bychko <alexey.bychko@percona.com>
7Build-Depends: libtool (>= 1.4.2-7),8Build-Depends: libtool (>= 1.4.2-7),
@@ -26,6 +27,10 @@
26 libaio-dev[linux-any],27 libaio-dev[linux-any],
27 libpam-dev,28 libpam-dev,
28 libssl-dev29 libssl-dev
30=======
31Uploaders: Stewart Smith <stewart.smith@percona.com>, Alexey Bychko <alexey.bychko@percona.com>
32Build-Depends: libtool (>= 1.4.2-7), procps, debhelper (>= 7.0.50~), file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), libreadline-dev, psmisc, po-debconf, chrpath, ghostscript, gawk, bison, lsb-release, cmake, gcc (>= 4.4), g++ (>= 4.4), libaio-dev[linux-any], libpam-dev, libssl-dev
33>>>>>>> MERGE-SOURCE
29Standards-Version: 3.9.434Standards-Version: 3.9.4
30Homepage: http://www.percona.com/software/percona-server/35Homepage: http://www.percona.com/software/percona-server/
31Vcs-Bzr: lp:percona-server/5.636Vcs-Bzr: lp:percona-server/5.6
@@ -140,6 +145,7 @@
140Package: percona-server-server-5.6145Package: percona-server-server-5.6
141Architecture: any146Architecture: any
142Suggests: tinyca147Suggests: tinyca
148<<<<<<< TREE
143Pre-Depends: percona-server-common-5.6 (>= ${source:Version}),149Pre-Depends: percona-server-common-5.6 (>= ${source:Version}),
144 adduser (>= 3.4.0),150 adduser (>= 3.4.0),
145 debconf151 debconf
@@ -175,6 +181,13 @@
175 mariadb-server,181 mariadb-server,
176 mariadb-server-core-5.5,182 mariadb-server-core-5.5,
177 mariadb-server-5.5183 mariadb-server-5.5
184=======
185Pre-Depends: percona-server-common-5.6 (>= ${source:Version}), adduser (>= 3.4.0), debconf
186Depends: percona-server-client-5.6 (>= ${source:Version}), libdbi-perl, libdbd-mysql-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10)
187Conflicts: mysql-server, mysql-server-4.1, mysql-server-core-5.1, percona-xtradb-server-5.0, percona-server-server-5.1, percona-server-server-5.5
188Provides: mysql-server
189Replaces: mysql-server, mysql-server-5.0, mysql-server-core-5.1, percona-xtradb-server-5.0, percona-server-server-5.1, percona-server-server-5.5
190>>>>>>> MERGE-SOURCE
178Description: Percona Server database server binaries191Description: Percona Server database server binaries
179 Percona Server is a fast, stable and true multi-user, multi-threaded SQL192 Percona Server is a fast, stable and true multi-user, multi-threaded SQL
180 database server. SQL (Structured Query Language) is the most popular database193 database server. SQL (Structured Query Language) is the most popular database
@@ -214,10 +227,14 @@
214227
215Package: percona-server-test-5.6228Package: percona-server-test-5.6
216Architecture: any229Architecture: any
230<<<<<<< TREE
217Depends: percona-server-client-5.6 (>= ${source:Version}),231Depends: percona-server-client-5.6 (>= ${source:Version}),
218 percona-server-server-5.6 (>= ${source:Version}),232 percona-server-server-5.6 (>= ${source:Version}),
219 ${misc:Depends},233 ${misc:Depends},
220 ${shlibs:Depends}234 ${shlibs:Depends}
235=======
236Depends: percona-server-client-5.6 (>= ${source:Version}), percona-server-server-5.6 (>= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}
237>>>>>>> MERGE-SOURCE
221Description: Percona Server database test suite238Description: Percona Server database test suite
222 Percona Server is a fast, stable and true multi-user, multi-threaded SQL239 Percona Server is a fast, stable and true multi-user, multi-threaded SQL
223 database server. SQL (Structured Query Language) is the most popular database240 database server. SQL (Structured Query Language) is the most popular database
224241
=== modified file 'build-ps/debian/rules'
--- build-ps/debian/rules 2014-04-25 10:55:01 +0000
+++ build-ps/debian/rules 2014-05-06 08:36:28 +0000
@@ -73,6 +73,7 @@
73 -DWITH_LIBWRAP=ON \73 -DWITH_LIBWRAP=ON \
74 -DWITH_ZLIB=system \74 -DWITH_ZLIB=system \
75 -DWITH_SSL=system \75 -DWITH_SSL=system \
76<<<<<<< TREE
76 -DCOMPILATION_COMMENT="($(DISTRIBUTION))" \77 -DCOMPILATION_COMMENT="($(DISTRIBUTION))" \
77 -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \78 -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \
78 -DSYSTEM_TYPE="debian-linux-gnu" \79 -DSYSTEM_TYPE="debian-linux-gnu" \
@@ -85,6 +86,19 @@
85 -DWITH_BLACKHOLE_STORAGE_ENGINE=ON \86 -DWITH_BLACKHOLE_STORAGE_ENGINE=ON \
86 -DWITH_FEDERATED_STORAGE_ENGINE=ON \87 -DWITH_FEDERATED_STORAGE_ENGINE=ON \
87 -DWITH_PAM=ON \88 -DWITH_PAM=ON \
89=======
90 -DCOMPILATION_COMMENT="($(DISTRIBUTION))" \
91 -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \
92 -DSYSTEM_TYPE="debian-linux-gnu" \
93 -DINSTALL_LAYOUT=RPM \
94 -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
95 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
96 -DWITH_EMBEDDED_SERVER=OFF \
97 -DWITH_ARCHIVE_STORAGE_ENGINE=ON \
98 -DWITH_BLACKHOLE_STORAGE_ENGINE=ON \
99 -DWITH_FEDERATED_STORAGE_ENGINE=ON \
100 -DWITH_PAM=ON \
101>>>>>>> MERGE-SOURCE
88 -DWITH_EXTRA_CHARSETS=all ..'102 -DWITH_EXTRA_CHARSETS=all ..'
89 touch $@103 touch $@
90104
@@ -258,8 +272,13 @@
258 dh_installinfo -a272 dh_installinfo -a
259 dh_installlogcheck -a273 dh_installlogcheck -a
260 dh_installchangelogs -a274 dh_installchangelogs -a
275<<<<<<< TREE
261 dh_strip -a --dbg-package=percona-server-5.6-dbg276 dh_strip -a --dbg-package=percona-server-5.6-dbg
262 dh_lintian277 dh_lintian
278=======
279 dh_strip -a
280 dh_lintian
281>>>>>>> MERGE-SOURCE
263 dh_link -a # .so muss nach .so.1.2.3 installier werden!282 dh_link -a # .so muss nach .so.1.2.3 installier werden!
264 dh_compress -a283 dh_compress -a
265 dh_fixperms -a284 dh_fixperms -a
266285
=== modified file 'client/client_priv.h'
--- client/client_priv.h 2014-02-25 17:05:01 +0000
+++ client/client_priv.h 2014-05-06 08:36:28 +0000
@@ -104,8 +104,12 @@
104 OPT_SERVER_PUBLIC_KEY,104 OPT_SERVER_PUBLIC_KEY,
105 OPT_ENABLE_CLEARTEXT_PLUGIN,105 OPT_ENABLE_CLEARTEXT_PLUGIN,
106 OPT_INNODB_OPTIMIZE_KEYS,106 OPT_INNODB_OPTIMIZE_KEYS,
107<<<<<<< TREE
107 OPT_REWRITE_DB,108 OPT_REWRITE_DB,
108 OPT_LOCK_FOR_BACKUP,109 OPT_LOCK_FOR_BACKUP,
110=======
111 OPT_LOCK_FOR_BACKUP,
112>>>>>>> MERGE-SOURCE
109 OPT_MAX_CLIENT_OPTION113 OPT_MAX_CLIENT_OPTION
110};114};
111115
112116
=== modified file 'client/mysqldump.c'
--- client/mysqldump.c 2014-04-24 05:16:52 +0000
+++ client/mysqldump.c 2014-05-06 08:36:28 +0000
@@ -85,6 +85,9 @@
85#define IGNORE_DATA 0x01 /* don't dump data for this table */85#define IGNORE_DATA 0x01 /* don't dump data for this table */
86#define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */86#define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */
8787
88/* Chars needed to store LONGLONG, excluding trailing '\0'. */
89#define LONGLONG_LEN 20
90
88typedef enum {91typedef enum {
89 KEY_TYPE_NONE,92 KEY_TYPE_NONE,
90 KEY_TYPE_PRIMARY,93 KEY_TYPE_PRIMARY,
@@ -419,9 +422,10 @@
419 "This causes the binary log position and filename to be appended to the "422 "This causes the binary log position and filename to be appended to the "
420 "output. If equal to 1, will print it as a CHANGE MASTER command; if equal"423 "output. If equal to 1, will print it as a CHANGE MASTER command; if equal"
421 " to 2, that command will be prefixed with a comment symbol. "424 " to 2, that command will be prefixed with a comment symbol. "
422 "This option will turn --lock-all-tables on, unless "425 "This option will turn --lock-all-tables on, unless --single-transaction "
423 "--single-transaction is specified too (in which case a "426 "is specified too (on servers that don't provide Binlog_snapshot_file and "
424 "global read lock is only taken a short time at the beginning of the dump; "427 "Binlog_snapshot_position status variables this will still take a "
428 "global read lock for a short time at the beginning of the dump; "
425 "don't forget to read about --single-transaction below). In all cases, "429 "don't forget to read about --single-transaction below). In all cases, "
426 "any action on logs will happen at the exact moment of the dump. "430 "any action on logs will happen at the exact moment of the dump. "
427 "Option automatically turns --lock-tables off.",431 "Option automatically turns --lock-tables off.",
@@ -1226,6 +1230,44 @@
1226}1230}
12271231
12281232
1233/*
1234 Check if server supports non-blocking binlog position using the
1235 binlog_snapshot_file and binlog_snapshot_position status variables. If it
1236 does, also return the position obtained if output pointers are non-NULL.
1237 Returns 1 if position available, 0 if not.
1238*/
1239static int
1240check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset)
1241{
1242 MYSQL_RES *res;
1243 MYSQL_ROW row;
1244 int found;
1245
1246 if (mysql_query_with_error_report(mysql, &res,
1247 "SHOW STATUS LIKE 'binlog_snapshot_%'"))
1248 return 1;
1249
1250 found= 0;
1251 while ((row= mysql_fetch_row(res)))
1252 {
1253 if (0 == strcmp(row[0], "Binlog_snapshot_file"))
1254 {
1255 if (binlog_pos_file)
1256 strmake(binlog_pos_file, row[1], FN_REFLEN-1);
1257 found++;
1258 }
1259 else if (0 == strcmp(row[0], "Binlog_snapshot_position"))
1260 {
1261 if (binlog_pos_offset)
1262 strmake(binlog_pos_offset, row[1], LONGLONG_LEN);
1263 found++;
1264 }
1265 }
1266 mysql_free_result(res);
1267
1268 return (found == 2);
1269}
1270
1229static char *my_case_str(const char *str,1271static char *my_case_str(const char *str,
1230 uint str_len,1272 uint str_len,
1231 const char *token,1273 const char *token,
@@ -5302,41 +5344,64 @@
5302} /* dump_selected_tables */5344} /* dump_selected_tables */
53035345
53045346
5305static int do_show_master_status(MYSQL *mysql_con)5347static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos)
5306{5348{
5307 MYSQL_ROW row;5349 MYSQL_ROW row;
5308 MYSQL_RES *master;5350 MYSQL_RES *master;
5351 char binlog_pos_file[FN_REFLEN];
5352 char binlog_pos_offset[LONGLONG_LEN+1];
5353 char *file, *offset;
5309 const char *comment_prefix=5354 const char *comment_prefix=
5310 (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : "";5355 (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : "";
5311 if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS"))5356
5357 if (consistent_binlog_pos)
5312 {5358 {
5313 return 1;5359 if (!check_consistent_binlog_pos(binlog_pos_file, binlog_pos_offset))
5360 return 1;
5361
5362 file= binlog_pos_file;
5363 offset= binlog_pos_offset;
5314 }5364 }
5315 else5365 else
5316 {5366 {
5367 if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS"))
5368 return 1;
5369
5317 row= mysql_fetch_row(master);5370 row= mysql_fetch_row(master);
5318 if (row && row[0] && row[1])5371 if (row && row[0] && row[1])
5319 {5372 {
5320 /* SHOW MASTER STATUS reports file and position */5373 file= row[0];
5321 print_comment(md_result_file, 0,5374 offset= row[1];
5322 "\n--\n-- Position to start replication or point-in-time "
5323 "recovery from\n--\n\n");
5324 fprintf(md_result_file,
5325 "%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n",
5326 comment_prefix, row[0], row[1]);
5327 check_io(md_result_file);
5328 }5375 }
5329 else if (!ignore_errors)5376 else
5330 {5377 {
5331 /* SHOW MASTER STATUS reports nothing and --force is not enabled */
5332 my_printf_error(0, "Error: Binlogging on server not active",
5333 MYF(0));
5334 mysql_free_result(master);5378 mysql_free_result(master);
5335 maybe_exit(EX_MYSQLERR);5379 if (!ignore_errors)
5336 return 1;5380 {
5381 /* SHOW MASTER STATUS reports nothing and --force is not enabled */
5382 my_printf_error(0, "Error: Binlogging on server not active", MYF(0));
5383 maybe_exit(EX_MYSQLERR);
5384 return 1;
5385 }
5386 else
5387 {
5388 return 0;
5389 }
5337 }5390 }
5391 }
5392
5393 /* SHOW MASTER STATUS reports file and position */
5394 print_comment(md_result_file, 0,
5395 "\n--\n-- Position to start replication or point-in-time "
5396 "recovery from\n--\n\n");
5397 fprintf(md_result_file,
5398 "%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n",
5399 comment_prefix, file, offset);
5400 check_io(md_result_file);
5401
5402 if (!consistent_binlog_pos)
5338 mysql_free_result(master);5403 mysql_free_result(master);
5339 }5404
5340 return 0;5405 return 0;
5341}5406}
53425407
@@ -6295,6 +6360,7 @@
6295{6360{
6296 char bin_log_name[FN_REFLEN];6361 char bin_log_name[FN_REFLEN];
6297 int exit_code;6362 int exit_code;
6363 int consistent_binlog_pos= 0;
6298 MY_INIT("mysqldump");6364 MY_INIT("mysqldump");
62996365
6300 compatible_mode_normal_str[0]= 0;6366 compatible_mode_normal_str[0]= 0;
@@ -6343,6 +6409,7 @@
6343 if (opt_slave_data && do_stop_slave_sql(mysql))6409 if (opt_slave_data && do_stop_slave_sql(mysql))
6344 goto err;6410 goto err;
63456411
6412<<<<<<< TREE
6346 if ((opt_lock_all_tables || opt_master_data ||6413 if ((opt_lock_all_tables || opt_master_data ||
6347 (opt_single_transaction && flush_logs)))6414 (opt_single_transaction && flush_logs)))
6348 {6415 {
@@ -6350,6 +6417,24 @@
6350 goto err;6417 goto err;
6351 }6418 }
6352 else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))6419 else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))
6420=======
6421 if (opt_single_transaction && opt_master_data)
6422 {
6423 /*
6424 See if we can avoid FLUSH TABLES WITH READ LOCK with Binlog_snapshot_*
6425 variables.
6426 */
6427 consistent_binlog_pos= check_consistent_binlog_pos(NULL, NULL);
6428 }
6429
6430 if ((opt_lock_all_tables || (opt_master_data && !consistent_binlog_pos) ||
6431 (opt_single_transaction && flush_logs)))
6432 {
6433 if (do_flush_tables_read_lock(mysql))
6434 goto err;
6435 }
6436 else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))
6437>>>>>>> MERGE-SOURCE
6353 goto err;6438 goto err;
63546439
6355 /*6440 /*
@@ -6390,7 +6475,7 @@
6390 goto err;6475 goto err;
63916476
63926477
6393 if (opt_master_data && do_show_master_status(mysql))6478 if (opt_master_data && do_show_master_status(mysql, consistent_binlog_pos))
6394 goto err;6479 goto err;
6395 if (opt_slave_data && do_show_slave_status(mysql))6480 if (opt_slave_data && do_show_slave_status(mysql))
6396 goto err;6481 goto err;
63976482
=== modified file 'doc/source/upstream-bug-fixes.rst'
--- doc/source/upstream-bug-fixes.rst 2014-04-25 10:55:01 +0000
+++ doc/source/upstream-bug-fixes.rst 2014-05-06 08:36:28 +0000
@@ -5,6 +5,7 @@
5=============================================================5=============================================================
66
7+-------------------------------------------------------------------------------------------------------------+7+-------------------------------------------------------------------------------------------------------------+
8<<<<<<< TREE
8|:Upstream bug: :mysqlbug:`71374` - Slave IO thread won't attempt auto reconnect to the master/error-code 1159|9|:Upstream bug: :mysqlbug:`71374` - Slave IO thread won't attempt auto reconnect to the master/error-code 1159|
9|:Launchpad bug: :bug:`1268729` |10|:Launchpad bug: :bug:`1268729` |
10|:Upstream state: Verified (checked on 2014-03-17) |11|:Upstream state: Verified (checked on 2014-03-17) |
@@ -71,6 +72,14 @@
71|:Fix Released: :rn:`5.6.15-63.0` |72|:Fix Released: :rn:`5.6.15-63.0` |
72|:Upstream fix: N/A |73|:Upstream fix: N/A |
73+-------------------------------------------------------------------------------------------------------------+74+-------------------------------------------------------------------------------------------------------------+
75=======
76|:Upstream bug: :mysqlbug:`71217` - Threadpool - add thd_wait_begin/thd_wait_end to the network IO functions |
77|:Launchpad bug: :bug:`1159743` |
78|:Upstream state: Open (checked on 2014-02-05) |
79|:Fix Released: :rn:`5.6.15-63.0` |
80|:Upstream fix: N/A |
81+-------------------------------------------------------------------------------------------------------------+
82>>>>>>> MERGE-SOURCE
74|:Upstream bug: :mysqlbug:`41975` - Support for SSL options not included in mysqlbinlog |83|:Upstream bug: :mysqlbug:`41975` - Support for SSL options not included in mysqlbinlog |
75|:Launchpad bug: :bug:`1258154` |84|:Launchpad bug: :bug:`1258154` |
76|:Upstream state: Closed |85|:Upstream state: Closed |
@@ -81,12 +90,21 @@
81|:Launchpad bug: :bug:`1258154` |90|:Launchpad bug: :bug:`1258154` |
82|:Upstream state: Closed |91|:Upstream state: Closed |
83|:Fix Released: :rn:`5.6.15-63.0` |92|:Fix Released: :rn:`5.6.15-63.0` |
93<<<<<<< TREE
84|:Upstream fix: 5.6.12 |94|:Upstream fix: 5.6.12 |
85+-------------------------------------------------------------------------------------------------------------+95+-------------------------------------------------------------------------------------------------------------+
86|:Upstream bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed pages|96|:Upstream bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed pages|
87|:Launchpad bug: :bug:`1231918` |97|:Launchpad bug: :bug:`1231918` |
88|:Upstream state: Verified (checked on 2014-03-17) |98|:Upstream state: Verified (checked on 2014-03-17) |
89|:Fix Released: :rn:`5.6.13-61.0` |99|:Fix Released: :rn:`5.6.13-61.0` |
100=======
101|:Upstream fix: 5.6.12 |
102+-------------------------------------------------------------------------------------------------------------+
103|:Upstream bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed pages|
104|:Launchpad bug: :bug:`1231918` |
105|:Upstream state: Verified (checked on 2014-02-05) |
106|:Fix Released: :rn:`5.6.13-61.0` |
107>>>>>>> MERGE-SOURCE
90|:Upstream fix: N/A |108|:Upstream fix: N/A |
91+-------------------------------------------------------------------------------------------------------------+109+-------------------------------------------------------------------------------------------------------------+
92|:Upstream bug: :mysqlbug:`70417` - rw_lock_x_lock_func_nowait() calls os_thread_get_curr_id() mostly ... |110|:Upstream bug: :mysqlbug:`70417` - rw_lock_x_lock_func_nowait() calls os_thread_get_curr_id() mostly ... |
@@ -97,7 +115,11 @@
97+-------------------------------------------------------------------------------------------------------------+115+-------------------------------------------------------------------------------------------------------------+
98|:Upstream bug: :mysqlbug:`70490` - Suppression is too strict on some systems |116|:Upstream bug: :mysqlbug:`70490` - Suppression is too strict on some systems |
99|:Launchpad bug: :bug:`1205196` |117|:Launchpad bug: :bug:`1205196` |
118<<<<<<< TREE
100|:Upstream state: No Feedback (checked on 2014-03-17) |119|:Upstream state: No Feedback (checked on 2014-03-17) |
120=======
121|:Upstream state: No Feedback (checked on 2014-02-05) |
122>>>>>>> MERGE-SOURCE
101|:Fix Released: :rn:`5.6.13-61.0` |123|:Fix Released: :rn:`5.6.13-61.0` |
102|:Upstream fix: N/A |124|:Upstream fix: N/A |
103+-------------------------------------------------------------------------------------------------------------+125+-------------------------------------------------------------------------------------------------------------+
@@ -109,7 +131,11 @@
109+-------------------------------------------------------------------------------------------------------------+131+-------------------------------------------------------------------------------------------------------------+
110|:Upstream bug: :mysqlbug:`70500` - Page cleaner should perform LRU flushing regardless of server activity |132|:Upstream bug: :mysqlbug:`70500` - Page cleaner should perform LRU flushing regardless of server activity |
111|:Launchpad bug: :bug:`1234562` |133|:Launchpad bug: :bug:`1234562` |
134<<<<<<< TREE
112|:Upstream state: Open (checked on 2014-03-17) |135|:Upstream state: Open (checked on 2014-03-17) |
136=======
137|:Upstream state: Open (checked on 2014-02-05) |
138>>>>>>> MERGE-SOURCE
113|:Fix Released: :rn:`5.6.13-61.0` |139|:Fix Released: :rn:`5.6.13-61.0` |
114|:Upstream fix: N/A |140|:Upstream fix: N/A |
115+-------------------------------------------------------------------------------------------------------------+141+-------------------------------------------------------------------------------------------------------------+
@@ -127,31 +153,51 @@
127+-------------------------------------------------------------------------------------------------------------+153+-------------------------------------------------------------------------------------------------------------+
128|:Upstream bug: :mysqlbug:`68481` - InnoDB LRU flushing for MySQL 5.6 needs work |154|:Upstream bug: :mysqlbug:`68481` - InnoDB LRU flushing for MySQL 5.6 needs work |
129|:Launchpad bug: :bug:`1232406` |155|:Launchpad bug: :bug:`1232406` |
156<<<<<<< TREE
130|:Upstream state: Verified (checked on 2014-03-17) |157|:Upstream state: Verified (checked on 2014-03-17) |
158=======
159|:Upstream state: Verified (checked on 2014-02-05) |
160>>>>>>> MERGE-SOURCE
131|:Fix Released: :rn:`5.6.13-61.0` |161|:Fix Released: :rn:`5.6.13-61.0` |
132|:Upstream fix: N/A |162|:Upstream fix: N/A |
133+-------------------------------------------------------------------------------------------------------------+163+-------------------------------------------------------------------------------------------------------------+
134|:Upstream bug: :mysqlbug:`70453` - Add hard timeouts to page cleaner flushes |164|:Upstream bug: :mysqlbug:`70453` - Add hard timeouts to page cleaner flushes |
135|:Launchpad bug: :bug:`1232101` |165|:Launchpad bug: :bug:`1232101` |
166<<<<<<< TREE
136|:Upstream state: Verified (checked on 2014-03-17) |167|:Upstream state: Verified (checked on 2014-03-17) |
168=======
169|:Upstream state: Verified (checked on 2014-02-05) |
170>>>>>>> MERGE-SOURCE
137|:Fix Released: :rn:`5.6.13-61.0` |171|:Fix Released: :rn:`5.6.13-61.0` |
138|:Upstream fix: N/A |172|:Upstream fix: N/A |
139+-------------------------------------------------------------------------------------------------------------+173+-------------------------------------------------------------------------------------------------------------+
140|:Upstream bug: :mysqlbug:`69170` - buf_flush_LRU is lazy |174|:Upstream bug: :mysqlbug:`69170` - buf_flush_LRU is lazy |
141|:Launchpad bug: :bug:`1231918` |175|:Launchpad bug: :bug:`1231918` |
176<<<<<<< TREE
142|:Upstream state: Verified (checked on 2014-03-17) |177|:Upstream state: Verified (checked on 2014-03-17) |
178=======
179|:Upstream state: Verified (checked on 2014-02-05) |
180>>>>>>> MERGE-SOURCE
143|:Fix Released: :rn:`5.6.13-61.0` |181|:Fix Released: :rn:`5.6.13-61.0` |
144|:Upstream fix: N/A |182|:Upstream fix: N/A |
145+-------------------------------------------------------------------------------------------------------------+183+-------------------------------------------------------------------------------------------------------------+
146|:Upstream bug: :mysqlbug:`68555` - thread convoys from log_checkpoint_margin with innodb_buffer_pool_inst... |184|:Upstream bug: :mysqlbug:`68555` - thread convoys from log_checkpoint_margin with innodb_buffer_pool_inst... |
147|:Launchpad bug: :bug:`1236884` |185|:Launchpad bug: :bug:`1236884` |
186<<<<<<< TREE
148|:Upstream state: Verified (checked on 2014-03-17) |187|:Upstream state: Verified (checked on 2014-03-17) |
188=======
189|:Upstream state: Verified (checked on 2014-02-05) |
190>>>>>>> MERGE-SOURCE
149|:Fix Released: :rn:`5.6.13-61.0` |191|:Fix Released: :rn:`5.6.13-61.0` |
150|:Upstream fix: N/A |192|:Upstream fix: N/A |
151+-------------------------------------------------------------------------------------------------------------+193+-------------------------------------------------------------------------------------------------------------+
152|:Upstream bug: :mysqlbug:`70228` - Is buf_LRU_free_page() really supposed to make non-zip block sticky at ...|194|:Upstream bug: :mysqlbug:`70228` - Is buf_LRU_free_page() really supposed to make non-zip block sticky at ...|
153|:Launchpad bug: :bug:`1220544` |195|:Launchpad bug: :bug:`1220544` |
196<<<<<<< TREE
154|:Upstream state: Verified (checked on 2014-03-17) |197|:Upstream state: Verified (checked on 2014-03-17) |
198=======
199|:Upstream state: Verified (checked on 2014-02-05) |
200>>>>>>> MERGE-SOURCE
155|:Fix Released: :rn:`5.6.13-60.6` |201|:Fix Released: :rn:`5.6.13-60.6` |
156|:Upstream fix: N/A |202|:Upstream fix: N/A |
157+-------------------------------------------------------------------------------------------------------------+203+-------------------------------------------------------------------------------------------------------------+
@@ -169,13 +215,21 @@
169+-------------------------------------------------------------------------------------------------------------+215+-------------------------------------------------------------------------------------------------------------+
170|:Upstream bug: :mysqlbug:`70216` - Unnecessary overhead from persistent adaptive hash index latches |216|:Upstream bug: :mysqlbug:`70216` - Unnecessary overhead from persistent adaptive hash index latches |
171|:Launchpad bug: :bug:`1218347` |217|:Launchpad bug: :bug:`1218347` |
218<<<<<<< TREE
172|:Upstream state: Verified (checked on 2014-03-17) |219|:Upstream state: Verified (checked on 2014-03-17) |
220=======
221|:Upstream state: Verified (checked on 2014-02-05) |
222>>>>>>> MERGE-SOURCE
173|:Fix Released: :rn:`5.6.13-60.6` |223|:Fix Released: :rn:`5.6.13-60.6` |
174|:Upstream fix: N/A |224|:Upstream fix: N/A |
175+-------------------------------------------------------------------------------------------------------------+225+-------------------------------------------------------------------------------------------------------------+
176|:Upstream bug: :mysqlbug:`62018` - innodb adaptive hash index mutex contention |226|:Upstream bug: :mysqlbug:`62018` - innodb adaptive hash index mutex contention |
177|:Launchpad bug: :bug:`1216804` |227|:Launchpad bug: :bug:`1216804` |
228<<<<<<< TREE
178|:Upstream state: Verified (checked on 2014-03-17) |229|:Upstream state: Verified (checked on 2014-03-17) |
230=======
231|:Upstream state: Verified (checked on 2014-02-05) |
232>>>>>>> MERGE-SOURCE
179|:Fix Released: :rn:`5.6.13-60.6` |233|:Fix Released: :rn:`5.6.13-60.6` |
180|:Upstream fix: N/A |234|:Upstream fix: N/A |
181+-------------------------------------------------------------------------------------------------------------+235+-------------------------------------------------------------------------------------------------------------+
@@ -193,13 +247,21 @@
193+-------------------------------------------------------------------------------------------------------------+247+-------------------------------------------------------------------------------------------------------------+
194|:Upstream bug: :mysqlbug:`42415` - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... |248|:Upstream bug: :mysqlbug:`42415` - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... |
195|:Launchpad bug: :bug:`1132194` |249|:Launchpad bug: :bug:`1132194` |
250<<<<<<< TREE
196|:Upstream state: Verified (checked on 2014-03-17) |251|:Upstream state: Verified (checked on 2014-03-17) |
252=======
253|:Upstream state: Verified (checked on 2014-02-05) |
254>>>>>>> MERGE-SOURCE
197|:Fix Released: :rn:`5.6.13-60.5` |255|:Fix Released: :rn:`5.6.13-60.5` |
198|:Upstream fix: N/A |256|:Upstream fix: N/A |
199+-------------------------------------------------------------------------------------------------------------+257+-------------------------------------------------------------------------------------------------------------+
200|:Upstream bug: :mysqlbug:`69639` - mysql failed to build with dtrace Sun D 1.11 |258|:Upstream bug: :mysqlbug:`69639` - mysql failed to build with dtrace Sun D 1.11 |
201|:Launchpad bug: :bug:`1196460` |259|:Launchpad bug: :bug:`1196460` |
260<<<<<<< TREE
202|:Upstream state: Open (checked on 2014-03-17) |261|:Upstream state: Open (checked on 2014-03-17) |
262=======
263|:Upstream state: Open (checked on 2014-02-05) |
264>>>>>>> MERGE-SOURCE
203|:Fix Released: :rn:`5.6.13-60.5` |265|:Fix Released: :rn:`5.6.13-60.5` |
204|:Upstream fix: N/A |266|:Upstream fix: N/A |
205+-------------------------------------------------------------------------------------------------------------+267+-------------------------------------------------------------------------------------------------------------+
@@ -217,10 +279,15 @@
217+-------------------------------------------------------------------------------------------------------------+279+-------------------------------------------------------------------------------------------------------------+
218|:Upstream bug: :mysqlbug:`69856` - mysql_install_db does not function properly in 5.6 for debug builds |280|:Upstream bug: :mysqlbug:`69856` - mysql_install_db does not function properly in 5.6 for debug builds |
219|:Launchpad bug: :bug:`1179359` |281|:Launchpad bug: :bug:`1179359` |
282<<<<<<< TREE
220|:Upstream state: Verified (checked on 2014-03-17) |283|:Upstream state: Verified (checked on 2014-03-17) |
284=======
285|:Upstream state: Verified (checked on 2014-02-05) |
286>>>>>>> MERGE-SOURCE
221|:Fix Released: :rn:`5.6.12-60.4` |287|:Fix Released: :rn:`5.6.12-60.4` |
222|:Upstream fix: N/A |288|:Upstream fix: N/A |
223+-------------------------------------------------------------------------------------------------------------+289+-------------------------------------------------------------------------------------------------------------+
290<<<<<<< TREE
224|:Upstream bug: :mysqlbug:`71603` - file name is not escaped in binlog for LOAD DATA INFILE statement |291|:Upstream bug: :mysqlbug:`71603` - file name is not escaped in binlog for LOAD DATA INFILE statement |
225|:Launchpad bug: :bug:`1277351` |292|:Launchpad bug: :bug:`1277351` |
226|:Upstream state: N/A |293|:Upstream state: N/A |
@@ -233,6 +300,14 @@
233|:Fix Released: :rn:`5.6.11-60.3` |300|:Fix Released: :rn:`5.6.11-60.3` |
234|:Upstream fix: N/A |301|:Upstream fix: N/A |
235+-------------------------------------------------------------------------------------------------------------+302+-------------------------------------------------------------------------------------------------------------+
303=======
304|:Upstream bug: :mysqlbug:`71183` - os_file_fsync() should handle fsync() returning EINTR |
305|:Launchpad bug: :bug:`1262651` |
306|:Upstream state: Verified (checked on 2014-02-05) |
307|:Fix Released: :rn:`5.6.11-60.3` |
308|:Upstream fix: N/A |
309+-------------------------------------------------------------------------------------------------------------+
310>>>>>>> MERGE-SOURCE
236|:Upstream bug: :mysqlbug:`63451` - atomic/x86-gcc.h:make_atomic_cas_body64 potential miscompilation bug |311|:Upstream bug: :mysqlbug:`63451` - atomic/x86-gcc.h:make_atomic_cas_body64 potential miscompilation bug |
237|:Launchpad bug: :bug:`878022` |312|:Launchpad bug: :bug:`878022` |
238|:Upstream state: Closed |313|:Upstream state: Closed |
@@ -247,7 +322,11 @@
247+-------------------------------------------------------------------------------------------------------------+322+-------------------------------------------------------------------------------------------------------------+
248|:Upstream bug: :mysqlbug:`69252` - All the parts.partition_max* tests are broken with MTR --parallel |323|:Upstream bug: :mysqlbug:`69252` - All the parts.partition_max* tests are broken with MTR --parallel |
249|:Launchpad bug: :bug:`1180481` |324|:Launchpad bug: :bug:`1180481` |
325<<<<<<< TREE
250|:Upstream state: Closed |326|:Upstream state: Closed |
327=======
328|:Upstream state: Verified (checked on 2014-02-05) |
329>>>>>>> MERGE-SOURCE
251|:Fix Released: :rn:`5.6.11-60.3` |330|:Fix Released: :rn:`5.6.11-60.3` |
252|:Upstream fix: 5.6.15 |331|:Upstream fix: 5.6.15 |
253+-------------------------------------------------------------------------------------------------------------+332+-------------------------------------------------------------------------------------------------------------+
@@ -259,7 +338,11 @@
259+-------------------------------------------------------------------------------------------------------------+338+-------------------------------------------------------------------------------------------------------------+
260|:Upstream bug: :mysqlbug:`68714` - Remove literal statement digest values from perfschema tests |339|:Upstream bug: :mysqlbug:`68714` - Remove literal statement digest values from perfschema tests |
261|:Launchpad bug: :bug:`1157078` |340|:Launchpad bug: :bug:`1157078` |
341<<<<<<< TREE
262|:Upstream state: Verified (checked on 2014-03-17) |342|:Upstream state: Verified (checked on 2014-03-17) |
343=======
344|:Upstream state: Verified (checked on 2014-02-05) |
345>>>>>>> MERGE-SOURCE
263|:Fix Released: :rn:`5.6.11-60.3` |346|:Fix Released: :rn:`5.6.11-60.3` |
264|:Upstream fix: N/A |347|:Upstream fix: N/A |
265+-------------------------------------------------------------------------------------------------------------+348+-------------------------------------------------------------------------------------------------------------+
@@ -283,13 +366,21 @@
283+-------------------------------------------------------------------------------------------------------------+366+-------------------------------------------------------------------------------------------------------------+
284|:Upstream bug: :mysqlbug:`68970` - fsp_reserve_free_extents switches from small to big tblspace handling ... |367|:Upstream bug: :mysqlbug:`68970` - fsp_reserve_free_extents switches from small to big tblspace handling ... |
285|:Launchpad bug: :bug:`1169494` |368|:Launchpad bug: :bug:`1169494` |
369<<<<<<< TREE
286|:Upstream state: Verified (checked on 2014-03-17) |370|:Upstream state: Verified (checked on 2014-03-17) |
371=======
372|:Upstream state: Verified (checked on 2014-02-05) |
373>>>>>>> MERGE-SOURCE
287|:Fix Released: :rn:`5.6.11-60.3` |374|:Fix Released: :rn:`5.6.11-60.3` |
288|:Upstream fix: N/A |375|:Upstream fix: N/A |
289+-------------------------------------------------------------------------------------------------------------+376+-------------------------------------------------------------------------------------------------------------+
290|:Upstream bug: :mysqlbug:`68713` - create_duplicate_weedout_tmp_table() leaves key_part_flag uninitialized |377|:Upstream bug: :mysqlbug:`68713` - create_duplicate_weedout_tmp_table() leaves key_part_flag uninitialized |
291|:Launchpad bug: :bug:`1157037` |378|:Launchpad bug: :bug:`1157037` |
379<<<<<<< TREE
292|:Upstream state: Verified (checked on 2014-03-17) |380|:Upstream state: Verified (checked on 2014-03-17) |
381=======
382|:Upstream state: Verified (checked on 2014-02-05) |
383>>>>>>> MERGE-SOURCE
293|:Fix Released: :rn:`5.6.11-60.3` |384|:Fix Released: :rn:`5.6.11-60.3` |
294|:Upstream fix: N/A |385|:Upstream fix: N/A |
295+-------------------------------------------------------------------------------------------------------------+386+-------------------------------------------------------------------------------------------------------------+
@@ -301,13 +392,21 @@
301+-------------------------------------------------------------------------------------------------------------+392+-------------------------------------------------------------------------------------------------------------+
302|:Upstream bug: :mysqlbug:`68999` - SSL_OP_NO_COMPRESSION not defined |393|:Upstream bug: :mysqlbug:`68999` - SSL_OP_NO_COMPRESSION not defined |
303|:Launchpad bug: :bug:`1183610` |394|:Launchpad bug: :bug:`1183610` |
395<<<<<<< TREE
304|:Upstream state: No Feedback (checked on 2014-03-17) |396|:Upstream state: No Feedback (checked on 2014-03-17) |
397=======
398|:Upstream state: No Feedback (checked on 2014-02-05) |
399>>>>>>> MERGE-SOURCE
305|:Fix Released: :rn:`5.6.11-60.3` |400|:Fix Released: :rn:`5.6.11-60.3` |
306|:Upstream fix: N/A |401|:Upstream fix: N/A |
307+-------------------------------------------------------------------------------------------------------------+402+-------------------------------------------------------------------------------------------------------------+
308|:Upstream bug: :mysqlbug:`68845` - Unnecessary log_sys->mutex reacquisition in mtr_log_reserve_and_write() |403|:Upstream bug: :mysqlbug:`68845` - Unnecessary log_sys->mutex reacquisition in mtr_log_reserve_and_write() |
309|:Launchpad bug: :bug:`1163439` |404|:Launchpad bug: :bug:`1163439` |
405<<<<<<< TREE
310|:Upstream state: Verified (checked on 2014-03-17) |406|:Upstream state: Verified (checked on 2014-03-17) |
407=======
408|:Upstream state: Verified (checked on 2014-02-05) |
409>>>>>>> MERGE-SOURCE
311|:Fix Released: :rn:`5.6.11-60.3` |410|:Fix Released: :rn:`5.6.11-60.3` |
312|:Upstream fix: N/A |411|:Upstream fix: N/A |
313+-------------------------------------------------------------------------------------------------------------+412+-------------------------------------------------------------------------------------------------------------+
@@ -337,7 +436,11 @@
337+-------------------------------------------------------------------------------------------------------------+436+-------------------------------------------------------------------------------------------------------------+
338|:Upstream bug: :mysqlbug:`68476` - Suboptimal code in my_strnxfrm_simple() |437|:Upstream bug: :mysqlbug:`68476` - Suboptimal code in my_strnxfrm_simple() |
339|:Launchpad bug: :bug:`1132350` |438|:Launchpad bug: :bug:`1132350` |
439<<<<<<< TREE
340|:Upstream state: Verified (checked on 2014-03-17) |440|:Upstream state: Verified (checked on 2014-03-17) |
441=======
442|:Upstream state: Verified (checked on 2014-02-05) |
443>>>>>>> MERGE-SOURCE
341|:Fix Released: :rn:`5.6.11-60.3` |444|:Fix Released: :rn:`5.6.11-60.3` |
342|:Upstream fix: N/A |445|:Upstream fix: N/A |
343+-------------------------------------------------------------------------------------------------------------+446+-------------------------------------------------------------------------------------------------------------+
@@ -391,13 +494,21 @@
391+-------------------------------------------------------------------------------------------------------------+494+-------------------------------------------------------------------------------------------------------------+
392|:Upstream bug: :mysqlbug:`61180` - korr/store macros in my_global.h assume the argument to be a char pointer |495|:Upstream bug: :mysqlbug:`61180` - korr/store macros in my_global.h assume the argument to be a char pointer |
393|:Launchpad bug: :bug:`1042517` |496|:Launchpad bug: :bug:`1042517` |
497<<<<<<< TREE
394|:Upstream state: Closed |498|:Upstream state: Closed |
499=======
500|:Upstream state: Verified (checked on 2014-02-05) |
501>>>>>>> MERGE-SOURCE
395|:Fix Released: :rn:`5.6.11-60.3` |502|:Fix Released: :rn:`5.6.11-60.3` |
396|:Upstream fix: N/A |503|:Upstream fix: N/A |
397+-------------------------------------------------------------------------------------------------------------+504+-------------------------------------------------------------------------------------------------------------+
398|:Upstream bug: :mysqlbug:`61178` - Incorrect implementation of intersect(ulonglong) in non-optimized Bitmap..|505|:Upstream bug: :mysqlbug:`61178` - Incorrect implementation of intersect(ulonglong) in non-optimized Bitmap..|
399|:Launchpad bug: :bug:`1042517` |506|:Launchpad bug: :bug:`1042517` |
507<<<<<<< TREE
400|:Upstream state: Verified (checked on 2014-03-17) |508|:Upstream state: Verified (checked on 2014-03-17) |
509=======
510|:Upstream state: Verified (checked on 2014-02-05) |
511>>>>>>> MERGE-SOURCE
401|:Fix Released: :rn:`5.6.11-60.3` |512|:Fix Released: :rn:`5.6.11-60.3` |
402|:Upstream fix: N/A |513|:Upstream fix: N/A |
403+-------------------------------------------------------------------------------------------------------------+514+-------------------------------------------------------------------------------------------------------------+
@@ -409,7 +520,11 @@
409+-------------------------------------------------------------------------------------------------------------+520+-------------------------------------------------------------------------------------------------------------+
410|:Upstream bug: :mysqlbug:`64800` - mysqldump with --include-master-host-port putting quotes around port no. | 521|:Upstream bug: :mysqlbug:`64800` - mysqldump with --include-master-host-port putting quotes around port no. |
411|:Launchpad bug: :bug:`1013432` |522|:Launchpad bug: :bug:`1013432` |
523<<<<<<< TREE
412|:Upstream state: Verified (checked on 2014-03-17) |524|:Upstream state: Verified (checked on 2014-03-17) |
525=======
526|:Upstream state: Verified (checked on 2014-02-05) |
527>>>>>>> MERGE-SOURCE
413|:Fix Released: :rn:`5.6.11-60.3` |528|:Fix Released: :rn:`5.6.11-60.3` |
414|:Upstream fix: N/A |529|:Upstream fix: N/A |
415+-------------------------------------------------------------------------------------------------------------+530+-------------------------------------------------------------------------------------------------------------+
@@ -439,13 +554,21 @@
439+-------------------------------------------------------------------------------------------------------------+554+-------------------------------------------------------------------------------------------------------------+
440|:Upstream bug: :mysqlbug:`25007` - memory tables with dynamic rows format |555|:Upstream bug: :mysqlbug:`25007` - memory tables with dynamic rows format |
441|:Launchpad bug: N/A |556|:Launchpad bug: N/A |
557<<<<<<< TREE
442|:Upstream state: Verified (checked on 2014-03-17) |558|:Upstream state: Verified (checked on 2014-03-17) |
559=======
560|:Upstream state: Verified (checked on 2014-02-05) |
561>>>>>>> MERGE-SOURCE
443|:Fix Released: :rn:`5.6.11-60.3` |562|:Fix Released: :rn:`5.6.11-60.3` |
444|:Upstream fix: N/A |563|:Upstream fix: N/A |
445+-------------------------------------------------------------------------------------------------------------+564+-------------------------------------------------------------------------------------------------------------+
446|:Upstream bug: :mysqlbug:`61595` - mysql-test/include/wait_for_slave_param.inc timeout logic is incorrect |565|:Upstream bug: :mysqlbug:`61595` - mysql-test/include/wait_for_slave_param.inc timeout logic is incorrect |
447|:Launchpad bug: :bug:`800035` |566|:Launchpad bug: :bug:`800035` |
567<<<<<<< TREE
448|:Upstream state: Verified (checked on 2014-03-17) |568|:Upstream state: Verified (checked on 2014-03-17) |
569=======
570|:Upstream state: Verified (checked on 2014-02-05) |
571>>>>>>> MERGE-SOURCE
449|:Fix Released: :rn:`5.6.11-60.3` |572|:Fix Released: :rn:`5.6.11-60.3` |
450|:Upstream fix: N/A |573|:Upstream fix: N/A |
451+-------------------------------------------------------------------------------------------------------------+574+-------------------------------------------------------------------------------------------------------------+
@@ -457,7 +580,11 @@
457+-------------------------------------------------------------------------------------------------------------+580+-------------------------------------------------------------------------------------------------------------+
458|:Upstream bug: :mysqlbug:`68116` - InnoDB monitor may hit an assertion error in buf_page_get_gen in debug ...|581|:Upstream bug: :mysqlbug:`68116` - InnoDB monitor may hit an assertion error in buf_page_get_gen in debug ...|
459|:Launchpad bug: :bug:`1100178` |582|:Launchpad bug: :bug:`1100178` |
583<<<<<<< TREE
460|:Upstream state: Verified (checked on 2014-03-17) |584|:Upstream state: Verified (checked on 2014-03-17) |
585=======
586|:Upstream state: Verified (checked on 2014-02-05) |
587>>>>>>> MERGE-SOURCE
461|:Fix Released: :rn:`5.6.10-60.2` |588|:Fix Released: :rn:`5.6.10-60.2` |
462|:Upstream fix: N/A |589|:Upstream fix: N/A |
463+-------------------------------------------------------------------------------------------------------------+590+-------------------------------------------------------------------------------------------------------------+
@@ -469,13 +596,21 @@
469+-------------------------------------------------------------------------------------------------------------+596+-------------------------------------------------------------------------------------------------------------+
470|:Upstream bug: :mysqlbug:`20001` - Support for temp-tables in INFORMATION_SCHEMA |597|:Upstream bug: :mysqlbug:`20001` - Support for temp-tables in INFORMATION_SCHEMA |
471|:Launchpad bug: N/A |598|:Launchpad bug: N/A |
599<<<<<<< TREE
472|:Upstream state: Verified (checked on 2014-03-17) |600|:Upstream state: Verified (checked on 2014-03-17) |
601=======
602|:Upstream state: Verified (checked on 2014-02-05) |
603>>>>>>> MERGE-SOURCE
473|:Fix Released: :rn:`5.6.5-60.0` |604|:Fix Released: :rn:`5.6.5-60.0` |
474|:Upstream fix: N/A |605|:Upstream fix: N/A |
475+-------------------------------------------------------------------------------------------------------------+606+-------------------------------------------------------------------------------------------------------------+
476|:Upstream bug: :mysqlbug:`69146` - Optimization in buf_pool_get_oldest_modification if srv_buf_pool_instances|607|:Upstream bug: :mysqlbug:`69146` - Optimization in buf_pool_get_oldest_modification if srv_buf_pool_instances|
477|:Launchpad bug: :bug:`1176496` |608|:Launchpad bug: :bug:`1176496` |
609<<<<<<< TREE
478|:Upstream state: Open (checked on 2014-03-17) |610|:Upstream state: Open (checked on 2014-03-17) |
611=======
612|:Upstream state: Open (checked on 2014-02-05) |
613>>>>>>> MERGE-SOURCE
479|:Fix Released: :rn:`5.6.5-60.0` |614|:Fix Released: :rn:`5.6.5-60.0` |
480|:Upstream fix: N/A |615|:Upstream fix: N/A |
481+-------------------------------------------------------------------------------------------------------------+616+-------------------------------------------------------------------------------------------------------------+
482617
=== modified file 'mysql-test/r/backup_locks_mysqldump.result'
--- mysql-test/r/backup_locks_mysqldump.result 2014-02-27 12:29:47 +0000
+++ mysql-test/r/backup_locks_mysqldump.result 2014-05-06 08:36:28 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1SHOW VARIABLES LIKE 'have_backup_locks';2SHOW VARIABLES LIKE 'have_backup_locks';
2Variable_name Value3Variable_name Value
3have_backup_locks YES4have_backup_locks YES
@@ -149,3 +150,148 @@
149SET GLOBAL log_output = @old_log_output;150SET GLOBAL log_output = @old_log_output;
150SET GLOBAL general_log = @old_general_log;151SET GLOBAL general_log = @old_general_log;
151DROP TABLE t1, t2;152DROP TABLE t1, t2;
153=======
154SHOW VARIABLES LIKE 'have_backup_locks';
155Variable_name Value
156have_backup_locks YES
157CREATE TABLE t1 (a INT) ENGINE=InnoDB;
158CREATE TABLE t2 (a INT) ENGINE=MyISAM;
159SET @old_general_log = @@general_log;
160SET @old_log_output = @@log_output;
161TRUNCATE TABLE mysql.general_log;
162SET GLOBAL log_output = 'TABLE';
163SET GLOBAL general_log = ON;
164# Check that --lock-for-backup is converted to --lock-all-tables if
165# --single-transaction is not specified
166SELECT argument FROM mysql.general_log WHERE argument != '';
167argument
168SET GLOBAL general_log = ON
169root@localhost on
170/*!40100 SET @@SQL_MODE='' */
171/*!40103 SET TIME_ZONE='+00:00' */
172FLUSH TABLES
173FLUSH TABLES WITH READ LOCK
174SHOW VARIABLES LIKE 'gtid\_mode'
175SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test'))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE ORDER BY LOGFILE_GROUP_NAME
176SELECT DISTINCT TABLESPACE_NAME, FILE_NAME, LOGFILE_GROUP_NAME, EXTENT_SIZE, INITIAL_SIZE, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test')) ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME
177SHOW VARIABLES LIKE 'ndbinfo\_version'
178test
179show tables
180show table status like 't1'
181SET SQL_QUOTE_SHOW_CREATE=1
182SET SESSION character_set_results = 'binary'
183show create table `t1`
184SET SESSION character_set_results = 'utf8'
185show fields from `t1`
186SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1`
187SET SESSION character_set_results = 'binary'
188use `test`
189select @@collation_database
190SHOW TRIGGERS LIKE 't1'
191SET SESSION character_set_results = 'utf8'
192show table status like 't2'
193SET SQL_QUOTE_SHOW_CREATE=1
194SET SESSION character_set_results = 'binary'
195show create table `t2`
196SET SESSION character_set_results = 'utf8'
197show fields from `t2`
198SELECT /*!40001 SQL_NO_CACHE */ * FROM `t2`
199SET SESSION character_set_results = 'binary'
200use `test`
201select @@collation_database
202SHOW TRIGGERS LIKE 't2'
203SET SESSION character_set_results = 'utf8'
204SELECT argument FROM mysql.general_log WHERE argument != ''
205TRUNCATE TABLE mysql.general_log;
206# Check that --lock-for-backup --single-transaction uses LOCK TABLES FOR
207# BACKUP
208SELECT argument FROM mysql.general_log WHERE argument != '';
209argument
210root@localhost on
211/*!40100 SET @@SQL_MODE='' */
212/*!40103 SET TIME_ZONE='+00:00' */
213SHOW VARIABLES LIKE 'have_backup_locks'
214LOCK TABLES FOR BACKUP
215SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ
216START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */
217SHOW VARIABLES LIKE 'gtid\_mode'
218SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test'))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE ORDER BY LOGFILE_GROUP_NAME
219SELECT DISTINCT TABLESPACE_NAME, FILE_NAME, LOGFILE_GROUP_NAME, EXTENT_SIZE, INITIAL_SIZE, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test')) ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME
220SHOW VARIABLES LIKE 'ndbinfo\_version'
221test
222show tables
223show table status like 't1'
224SET SQL_QUOTE_SHOW_CREATE=1
225SET SESSION character_set_results = 'binary'
226show create table `t1`
227SET SESSION character_set_results = 'utf8'
228show fields from `t1`
229SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1`
230SET SESSION character_set_results = 'binary'
231use `test`
232select @@collation_database
233SHOW TRIGGERS LIKE 't1'
234SET SESSION character_set_results = 'utf8'
235show table status like 't2'
236SET SQL_QUOTE_SHOW_CREATE=1
237SET SESSION character_set_results = 'binary'
238show create table `t2`
239SET SESSION character_set_results = 'utf8'
240show fields from `t2`
241SELECT /*!40001 SQL_NO_CACHE */ * FROM `t2`
242SET SESSION character_set_results = 'binary'
243use `test`
244select @@collation_database
245SHOW TRIGGERS LIKE 't2'
246SET SESSION character_set_results = 'utf8'
247SELECT argument FROM mysql.general_log WHERE argument != ''
248TRUNCATE TABLE mysql.general_log;
249# Check that --master-data does not disable --lock-for-backup
250SELECT argument FROM mysql.general_log WHERE argument != '';
251argument
252root@localhost on
253/*!40100 SET @@SQL_MODE='' */
254/*!40103 SET TIME_ZONE='+00:00' */
255SHOW VARIABLES LIKE 'have_backup_locks'
256SHOW STATUS LIKE 'binlog_snapshot_%'
257LOCK TABLES FOR BACKUP
258SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ
259START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */
260SHOW VARIABLES LIKE 'gtid\_mode'
261SHOW STATUS LIKE 'binlog_snapshot_%'
262UNLOCK TABLES
263SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test'))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE ORDER BY LOGFILE_GROUP_NAME
264SELECT DISTINCT TABLESPACE_NAME, FILE_NAME, LOGFILE_GROUP_NAME, EXTENT_SIZE, INITIAL_SIZE, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test')) ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME
265SHOW VARIABLES LIKE 'ndbinfo\_version'
266test
267show tables
268show table status like 't1'
269SET SQL_QUOTE_SHOW_CREATE=1
270SET SESSION character_set_results = 'binary'
271show create table `t1`
272SET SESSION character_set_results = 'utf8'
273show fields from `t1`
274SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1`
275SET SESSION character_set_results = 'binary'
276use `test`
277select @@collation_database
278SHOW TRIGGERS LIKE 't1'
279SET SESSION character_set_results = 'utf8'
280show table status like 't2'
281SET SQL_QUOTE_SHOW_CREATE=1
282SET SESSION character_set_results = 'binary'
283show create table `t2`
284SET SESSION character_set_results = 'utf8'
285show fields from `t2`
286SELECT /*!40001 SQL_NO_CACHE */ * FROM `t2`
287SET SESSION character_set_results = 'binary'
288use `test`
289select @@collation_database
290SHOW TRIGGERS LIKE 't2'
291SET SESSION character_set_results = 'utf8'
292SELECT argument FROM mysql.general_log WHERE argument != ''
293TRUNCATE TABLE mysql.general_log;
294SET GLOBAL log_output = @old_log_output;
295SET GLOBAL general_log = @old_general_log;
296DROP TABLE t1, t2;
297>>>>>>> MERGE-SOURCE
152298
=== modified file 'mysql-test/r/mysqldump-max.result'
--- mysql-test/r/mysqldump-max.result 2010-10-25 09:20:53 +0000
+++ mysql-test/r/mysqldump-max.result 2014-05-06 08:36:28 +0000
@@ -290,3 +290,60 @@
290DROP VIEW v1;290DROP VIEW v1;
291DROP TABLE t1;291DROP TABLE t1;
292SET GLOBAL default_storage_engine=@old_engine;292SET GLOBAL default_storage_engine=@old_engine;
293# Connection default
294SET binlog_format= mixed;
295RESET MASTER;
296CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
297INSERT INTO t1 VALUES (1),(2);
298CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
299INSERT INTO t2 VALUES (1,0), (2,0);
300SELECT GET_LOCK("block_queries_1", 120);
301GET_LOCK("block_queries_1", 120)
3021
303# Connection c3
304SELECT GET_LOCK("block_queries_2", 120);
305GET_LOCK("block_queries_2", 120)
3061
307# Connection c1
308SET @c= 0;
309SELECT IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120)) FROM t1 ORDER BY a;
310# Connection c2
311SET binlog_format="row";
312SET @d= 10;
313UPDATE t2 SET b=IF(@d<=10, @d:=@d+1, GET_LOCK("block_queries_2", 120)) ORDER BY a;
314# Connection default
315# Make sure other queries are running (and waiting).
316SELECT RELEASE_LOCK("block_queries_1");
317RELEASE_LOCK("block_queries_1")
3181
319# Connection c3
320SELECT RELEASE_LOCK("block_queries_2");
321RELEASE_LOCK("block_queries_2")
3221
323# Connection c1
324IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120))
3251
3261
327# Connection c2
328# Connection default
329SELECT * FROM t2 ORDER BY a;
330a b
3311 11
3322 1
333DROP TABLE t1;
334DROP TABLE t2;
335SHOW BINLOG EVENTS LIMIT 7,3;
336Log_name Pos Event_type Server_id End_log_pos Info
337master-bin.000001 665 Query 1 773 use `test`; INSERT INTO t2 VALUES (1,0), (2,0)
338master-bin.000001 773 Xid 1 804 COMMIT /* XID */
339master-bin.000001 804 Query 1 876 BEGIN
340-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=804;
341SELECT * FROM t1 ORDER BY a;
342a
3431
3442
345SELECT * FROM t2 ORDER BY a;
346a b
3471 0
3482 0
349DROP TABLE t1,t2;
293350
=== added file 'mysql-test/suite/binlog/r/binlog_consistent.result'
--- mysql-test/suite/binlog/r/binlog_consistent.result 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/binlog/r/binlog_consistent.result 2014-05-06 08:36:28 +0000
@@ -0,0 +1,103 @@
1RESET MASTER;
2# Connection default
3CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
4SHOW MASTER STATUS;
5File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
6master-bin.000001 266
7SHOW STATUS LIKE 'binlog_snapshot_%';
8Variable_name Value
9Binlog_snapshot_file master-bin.000001
10Binlog_snapshot_position 266
11BEGIN;
12INSERT INTO t1 VALUES (0, "");
13# Connection con1
14BEGIN;
15INSERT INTO t1 VALUES (1, "");
16# Connection con2
17CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam;
18BEGIN;
19INSERT INTO t1 VALUES (2, "first");
20INSERT INTO t2 VALUES (2);
21INSERT INTO t1 VALUES (2, "second");
22# Connection default
23COMMIT;
24SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
25START TRANSACTION WITH CONSISTENT SNAPSHOT;
26# Connection con3
27BEGIN;
28INSERT INTO t1 VALUES (3, "");
29INSERT INTO t2 VALUES (3);
30# Connection con4
31BEGIN;
32INSERT INTO t1 VALUES (4, "");
33COMMIT;
34# Connection default
35SELECT * FROM t1 ORDER BY a,b;
36a b
370
38SHOW STATUS LIKE 'binlog_snapshot_%';
39Variable_name Value
40Binlog_snapshot_file master-bin.000001
41Binlog_snapshot_position 860
42SHOW MASTER STATUS;
43File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
44master-bin.000001 1331
45SELECT * FROM t2 ORDER BY a;
46a
472
483
49# Connection con1
50COMMIT;
51# Connection con2
52COMMIT;
53# Connection con3
54COMMIT;
55FLUSH LOGS;
56# Connection default
57SELECT * FROM t1 ORDER BY a,b;
58a b
590
60SHOW STATUS LIKE 'binlog_snapshot_%';
61Variable_name Value
62Binlog_snapshot_file master-bin.000001
63Binlog_snapshot_position 860
64SHOW MASTER STATUS;
65File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
66master-bin.000002 120
67COMMIT;
68SHOW STATUS LIKE 'binlog_snapshot_%';
69Variable_name Value
70Binlog_snapshot_file master-bin.000002
71Binlog_snapshot_position 120
72SHOW MASTER STATUS;
73File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
74master-bin.000002 120
75SHOW BINLOG EVENTS;
76Log_name Pos Event_type Server_id End_log_pos Info
77master-bin.000001 4 Format_desc 1 120 Server ver: #, Binlog ver: #
78master-bin.000001 120 Query 1 266 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
79master-bin.000001 266 Query 1 389 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
80master-bin.000001 389 Query 1 468 BEGIN
81master-bin.000001 468 Query 1 567 use `test`; INSERT INTO t2 VALUES (2)
82master-bin.000001 567 Query 1 647 COMMIT
83master-bin.000001 647 Query 1 726 BEGIN
84master-bin.000001 726 Query 1 829 use `test`; INSERT INTO t1 VALUES (0, "")
85master-bin.000001 829 Xid 1 860 COMMIT /* XID */
86master-bin.000001 860 Query 1 939 BEGIN
87master-bin.000001 939 Query 1 1038 use `test`; INSERT INTO t2 VALUES (3)
88master-bin.000001 1038 Query 1 1118 COMMIT
89master-bin.000001 1118 Query 1 1197 BEGIN
90master-bin.000001 1197 Query 1 1300 use `test`; INSERT INTO t1 VALUES (4, "")
91master-bin.000001 1300 Xid 1 1331 COMMIT /* XID */
92master-bin.000001 1331 Query 1 1410 BEGIN
93master-bin.000001 1410 Query 1 1513 use `test`; INSERT INTO t1 VALUES (1, "")
94master-bin.000001 1513 Xid 1 1544 COMMIT /* XID */
95master-bin.000001 1544 Query 1 1623 BEGIN
96master-bin.000001 1623 Query 1 1731 use `test`; INSERT INTO t1 VALUES (2, "first")
97master-bin.000001 1731 Query 1 1840 use `test`; INSERT INTO t1 VALUES (2, "second")
98master-bin.000001 1840 Xid 1 1871 COMMIT /* XID */
99master-bin.000001 1871 Query 1 1950 BEGIN
100master-bin.000001 1950 Query 1 2053 use `test`; INSERT INTO t1 VALUES (3, "")
101master-bin.000001 2053 Xid 1 2084 COMMIT /* XID */
102master-bin.000001 2084 Rotate 1 2132 master-bin.000002;pos=4
103DROP TABLE t1,t2;
0104
=== added file 'mysql-test/suite/binlog/t/binlog_consistent.test'
--- mysql-test/suite/binlog/t/binlog_consistent.test 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/binlog/t/binlog_consistent.test 2014-05-06 08:36:28 +0000
@@ -0,0 +1,88 @@
1--source include/have_innodb.inc
2--source include/have_log_bin.inc
3--source include/have_binlog_format_mixed_or_statement.inc
4
5RESET MASTER;
6
7# Test that we get the correct binlog position from START TRANSACTION WITH
8# CONSISTENT SNAPSHOT even when other transactions are active.
9
10connect(con1,localhost,root,,);
11connect(con2,localhost,root,,);
12connect(con3,localhost,root,,);
13connect(con4,localhost,root,,);
14
15connection default;
16--echo # Connection default
17
18CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
19SHOW MASTER STATUS;
20SHOW STATUS LIKE 'binlog_snapshot_%';
21BEGIN;
22INSERT INTO t1 VALUES (0, "");
23
24connection con1;
25--echo # Connection con1
26BEGIN;
27INSERT INTO t1 VALUES (1, "");
28
29connection con2;
30--echo # Connection con2
31CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam;
32BEGIN;
33INSERT INTO t1 VALUES (2, "first");
34INSERT INTO t2 VALUES (2);
35INSERT INTO t1 VALUES (2, "second");
36
37connection default;
38--echo # Connection default
39COMMIT;
40
41SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
42START TRANSACTION WITH CONSISTENT SNAPSHOT;
43
44connection con3;
45--echo # Connection con3
46BEGIN;
47INSERT INTO t1 VALUES (3, "");
48INSERT INTO t2 VALUES (3);
49
50connection con4;
51--echo # Connection con4
52BEGIN;
53INSERT INTO t1 VALUES (4, "");
54COMMIT;
55
56connection default;
57--echo # Connection default
58SELECT * FROM t1 ORDER BY a,b;
59SHOW STATUS LIKE 'binlog_snapshot_%';
60SHOW MASTER STATUS;
61SELECT * FROM t2 ORDER BY a;
62
63connection con1;
64--echo # Connection con1
65COMMIT;
66
67connection con2;
68--echo # Connection con2
69COMMIT;
70
71connection con3;
72--echo # Connection con3
73COMMIT;
74FLUSH LOGS;
75
76connection default;
77--echo # Connection default
78SELECT * FROM t1 ORDER BY a,b;
79SHOW STATUS LIKE 'binlog_snapshot_%';
80SHOW MASTER STATUS;
81COMMIT;
82SHOW STATUS LIKE 'binlog_snapshot_%';
83SHOW MASTER STATUS;
84
85--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
86SHOW BINLOG EVENTS;
87
88DROP TABLE t1,t2;
089
=== modified file 'mysql-test/suite/perfschema/r/dml_setup_instruments.result'
--- mysql-test/suite/perfschema/r/dml_setup_instruments.result 2013-12-05 17:23:10 +0000
+++ mysql-test/suite/perfschema/r/dml_setup_instruments.result 2014-05-06 08:36:28 +0000
@@ -23,12 +23,12 @@
23wait/synch/rwlock/sql/Binlog_storage_delegate::lock YES YES23wait/synch/rwlock/sql/Binlog_storage_delegate::lock YES YES
24wait/synch/rwlock/sql/Binlog_transmit_delegate::lock YES YES24wait/synch/rwlock/sql/Binlog_transmit_delegate::lock YES YES
25wait/synch/rwlock/sql/gtid_commit_rollback YES YES25wait/synch/rwlock/sql/gtid_commit_rollback YES YES
26wait/synch/rwlock/sql/LOCK_consistent_snapshot YES YES
26wait/synch/rwlock/sql/LOCK_dboptions YES YES27wait/synch/rwlock/sql/LOCK_dboptions YES YES
27wait/synch/rwlock/sql/LOCK_grant YES YES28wait/synch/rwlock/sql/LOCK_grant YES YES
28wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES29wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
29wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES30wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES
30wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES31wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES
31wait/synch/rwlock/sql/LOGGER::LOCK_logger YES YES
32select * from performance_schema.setup_instruments32select * from performance_schema.setup_instruments
33where name like 'Wait/Synch/Cond/sql/%'33where name like 'Wait/Synch/Cond/sql/%'
34 and name not in (34 and name not in (
3535
=== modified file 'mysql-test/t/backup_locks_mysqldump.test'
--- mysql-test/t/backup_locks_mysqldump.test 2014-02-25 07:30:22 +0000
+++ mysql-test/t/backup_locks_mysqldump.test 2014-05-06 08:36:28 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1########################################################################2########################################################################
2# mysqldump --lock-for-backup tests3# mysqldump --lock-for-backup tests
3########################################################################4########################################################################
@@ -56,3 +57,63 @@
56SET GLOBAL general_log = @old_general_log;57SET GLOBAL general_log = @old_general_log;
5758
58DROP TABLE t1, t2;59DROP TABLE t1, t2;
60=======
61########################################################################
62# mysqldump --lock-for-backup tests
63########################################################################
64
65--source include/have_log_bin.inc
66--source include/have_innodb.inc
67--source include/not_embedded.inc
68
69SHOW VARIABLES LIKE 'have_backup_locks';
70
71CREATE TABLE t1 (a INT) ENGINE=InnoDB;
72CREATE TABLE t2 (a INT) ENGINE=MyISAM;
73
74SET @old_general_log = @@general_log;
75SET @old_log_output = @@log_output;
76
77TRUNCATE TABLE mysql.general_log;
78
79SET GLOBAL log_output = 'TABLE';
80SET GLOBAL general_log = ON;
81
82--let $file=$MYSQLTEST_VARDIR/tmp/dump.sql
83
84--error 1
85--exec $MYSQL_DUMP --lock-for-backup --lock-all-tables >$file
86
87--echo # Check that --lock-for-backup is converted to --lock-all-tables if
88--echo # --single-transaction is not specified
89
90--exec $MYSQL_DUMP --lock-for-backup test >$file
91
92SELECT argument FROM mysql.general_log WHERE argument != '';
93
94TRUNCATE TABLE mysql.general_log;
95
96--echo # Check that --lock-for-backup --single-transaction uses LOCK TABLES FOR
97--echo # BACKUP
98
99--exec $MYSQL_DUMP --lock-for-backup --single-transaction test >$file
100
101SELECT argument FROM mysql.general_log WHERE argument != '';
102
103TRUNCATE TABLE mysql.general_log;
104
105--echo # Check that --master-data does not disable --lock-for-backup
106
107--exec $MYSQL_DUMP --lock-for-backup --single-transaction --master-data test >$file
108
109SELECT argument FROM mysql.general_log WHERE argument != '';
110
111TRUNCATE TABLE mysql.general_log;
112
113--remove_file $file
114
115SET GLOBAL log_output = @old_log_output;
116SET GLOBAL general_log = @old_general_log;
117
118DROP TABLE t1, t2;
119>>>>>>> MERGE-SOURCE
59120
=== modified file 'mysql-test/t/mysqldump-max.test'
--- mysql-test/t/mysqldump-max.test 2010-10-25 09:20:53 +0000
+++ mysql-test/t/mysqldump-max.test 2014-05-06 08:36:28 +0000
@@ -2,6 +2,7 @@
2--source include/not_embedded.inc2--source include/not_embedded.inc
3--source include/have_innodb.inc3--source include/have_innodb.inc
4--source include/have_archive.inc4--source include/have_archive.inc
5--source include/have_log_bin.inc
56
6--disable_warnings7--disable_warnings
7drop table if exists t1, t2, t3, t4, t5, t6;8drop table if exists t1, t2, t3, t4, t5, t6;
@@ -1124,3 +1125,85 @@
1124DROP TABLE t1;1125DROP TABLE t1;
11251126
1126SET GLOBAL default_storage_engine=@old_engine;1127SET GLOBAL default_storage_engine=@old_engine;
1128
1129# Test fully non-locking mysqldump with consistent binlog position (MWL#136).
1130
1131connect(c1,127.0.0.1,root,,test,$MASTER_MYPORT,);
1132connect(c2,127.0.0.1,root,,test,$MASTER_MYPORT,);
1133connect(c3,127.0.0.1,root,,test,$MASTER_MYPORT,);
1134
1135connection default;
1136--echo # Connection default
1137SET binlog_format= mixed;
1138RESET MASTER;
1139CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
1140INSERT INTO t1 VALUES (1),(2);
1141CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
1142INSERT INTO t2 VALUES (1,0), (2,0);
1143SELECT GET_LOCK("block_queries_1", 120);
1144
1145connection c3;
1146--echo # Connection c3
1147SELECT GET_LOCK("block_queries_2", 120);
1148
1149# Start two queries that will be running on the tables during mysqldump
1150connection c1;
1151--echo # Connection c1
1152SET @c= 0;
1153send SELECT IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120)) FROM t1 ORDER BY a;
1154
1155connection c2;
1156--echo # Connection c2
1157SET binlog_format="row";
1158SET @d= 10;
1159send UPDATE t2 SET b=IF(@d<=10, @d:=@d+1, GET_LOCK("block_queries_2", 120)) ORDER BY a;
1160
1161connection default;
1162--echo # Connection default
1163--echo # Make sure other queries are running (and waiting).
1164let $wait_condition=
1165 SELECT COUNT(*) FROM information_schema.processlist
1166 WHERE state = "User lock" AND info LIKE 'SELECT%block_queries_1%';
1167--source include/wait_condition.inc
1168let $wait_condition=
1169 SELECT COUNT(*) FROM information_schema.processlist
1170 WHERE state = "User lock" AND info LIKE 'UPDATE%block_queries_2%';
1171--source include/wait_condition.inc
1172
1173--exec $MYSQL_DUMP --master-data=2 --single-transaction test t1 t2 > $MYSQLTEST_VARDIR/tmp/mwl136.sql
1174
1175SELECT RELEASE_LOCK("block_queries_1");
1176
1177connection c3;
1178--echo # Connection c3
1179SELECT RELEASE_LOCK("block_queries_2");
1180
1181connection c1;
1182--echo # Connection c1
1183reap;
1184
1185connection c2;
1186--echo # Connection c2
1187reap;
1188
1189connection default;
1190--echo # Connection default
1191SELECT * FROM t2 ORDER BY a;
1192DROP TABLE t1;
1193DROP TABLE t2;
1194--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mwl136.sql
1195
1196--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
1197SHOW BINLOG EVENTS LIMIT 7,3;
1198
1199--perl
1200my $f= "$ENV{MYSQLTEST_VARDIR}/tmp/mwl136.sql";
1201open F, '<', $f or die "Failed to open $f: $!\n";
1202while (<F>) {
1203 print if /CHANGE MASTER TO/;
1204}
1205EOF
1206SELECT * FROM t1 ORDER BY a;
1207SELECT * FROM t2 ORDER BY a;
1208
1209DROP TABLE t1,t2;
11271210
=== modified file 'sql/binlog.cc'
--- sql/binlog.cc 2014-04-24 05:16:52 +0000
+++ sql/binlog.cc 2014-05-06 08:36:28 +0000
@@ -79,7 +79,19 @@
79static int binlog_commit(handlerton *hton, THD *thd, bool all);79static int binlog_commit(handlerton *hton, THD *thd, bool all);
80static int binlog_rollback(handlerton *hton, THD *thd, bool all);80static int binlog_rollback(handlerton *hton, THD *thd, bool all);
81static int binlog_prepare(handlerton *hton, THD *thd, bool all);81static int binlog_prepare(handlerton *hton, THD *thd, bool all);
8282static int binlog_start_consistent_snapshot(handlerton *hton, THD *thd);
83
84static char binlog_snapshot_file[FN_REFLEN];
85static ulonglong binlog_snapshot_position;
86
87static SHOW_VAR binlog_status_vars_detail[]=
88{
89 {"snapshot_file",
90 (char *)&binlog_snapshot_file, SHOW_CHAR},
91 {"snapshot_position",
92 (char *)&binlog_snapshot_position, SHOW_LONGLONG},
93 {NullS, NullS, SHOW_LONG}
94};
8395
84/**96/**
85 Helper class to hold a mutex for the duration of the97 Helper class to hold a mutex for the duration of the
@@ -788,6 +800,8 @@
788 binlog_stmt_cache_data stmt_cache;800 binlog_stmt_cache_data stmt_cache;
789 binlog_trx_cache_data trx_cache;801 binlog_trx_cache_data trx_cache;
790802
803 LOG_INFO binlog_info;
804
791private:805private:
792806
793 binlog_cache_mngr& operator=(const binlog_cache_mngr& info);807 binlog_cache_mngr& operator=(const binlog_cache_mngr& info);
@@ -914,6 +928,7 @@
914 binlog_hton->commit= binlog_commit;928 binlog_hton->commit= binlog_commit;
915 binlog_hton->rollback= binlog_rollback;929 binlog_hton->rollback= binlog_rollback;
916 binlog_hton->prepare= binlog_prepare;930 binlog_hton->prepare= binlog_prepare;
931 binlog_hton->start_consistent_snapshot= binlog_start_consistent_snapshot;
917 binlog_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;932 binlog_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;
918 return 0;933 return 0;
919}934}
@@ -1325,6 +1340,25 @@
1325 return 0;1340 return 0;
1326}1341}
13271342
1343static int binlog_start_consistent_snapshot(handlerton *hton, THD *thd)
1344{
1345 int err= 0;
1346 LOG_INFO li;
1347 DBUG_ENTER("binlog_start_consistent_snapshot");
1348
1349 if ((err= thd->binlog_setup_trx_data()))
1350 DBUG_RETURN(err);
1351
1352 binlog_cache_mngr * const cache_mngr= thd_get_cache_mngr(thd);
1353
1354 /* Server layer calls us with LOCK_log locked, so this is safe. */
1355 mysql_bin_log.raw_get_current_log(&cache_mngr->binlog_info);
1356
1357 trans_register_ha(thd, TRUE, hton);
1358
1359 DBUG_RETURN(err);
1360}
1361
1328/**1362/**
1329 This function is called once after each statement.1363 This function is called once after each statement.
13301364
@@ -1567,8 +1601,18 @@
1567 rollback.1601 rollback.
1568 */1602 */
1569 if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT)1603 if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT)
1604 {
1605 /*
1606 Reset binlog_snapshot_% variables for the current connection so that the
1607 current coordinates are shown after committing a consistent snapshot
1608 transaction.
1609 */
1610 if (cache_mngr != NULL)
1611 cache_mngr->binlog_info.log_file_name[0]= '\0';
1612
1570 if ((error= ha_rollback_low(thd, all)))1613 if ((error= ha_rollback_low(thd, all)))
1571 goto end;1614 goto end;
1615 }
15721616
1573 /*1617 /*
1574 If there is no cache manager, or if there is nothing in the1618 If there is no cache manager, or if there is nothing in the
@@ -2436,7 +2480,7 @@
2436 is_relay_log(0), signal_cnt(0),2480 is_relay_log(0), signal_cnt(0),
2437 checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF),2481 checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF),
2438 relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF),2482 relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF),
2439 previous_gtid_set(0)2483 previous_gtid_set(0), snapshot_lock_acquired(false)
2440{2484{
2441 /*2485 /*
2442 We don't want to initialize locks here as such initialization depends on2486 We don't want to initialize locks here as such initialization depends on
@@ -6313,6 +6357,14 @@
6313 DBUG_RETURN(RESULT_SUCCESS);6357 DBUG_RETURN(RESULT_SUCCESS);
6314 }6358 }
63156359
6360 /*
6361 Reset binlog_snapshot_% variables for the current connection so that the
6362 current coordinates are shown after committing a consistent snapshot
6363 transaction.
6364 */
6365 if (all)
6366 cache_mngr->binlog_info.log_file_name[0]= '\0';
6367
6316 THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt;6368 THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt;
63176369
6318 DBUG_PRINT("debug", ("in_transaction: %s, no_2pc: %s, rw_ha_count: %d",6370 DBUG_PRINT("debug", ("in_transaction: %s, no_2pc: %s, rw_ha_count: %d",
@@ -6810,9 +6862,22 @@
6810 /*6862 /*
6811 storage engine commit6863 storage engine commit
6812 */6864 */
6813 if (thd->commit_error == THD::CE_NONE &&6865 if (thd->commit_error == THD::CE_NONE)
6814 ha_commit_low(thd, all, false))6866 {
6815 thd->commit_error= THD::CE_COMMIT_ERROR;6867 /*
6868 Acquire a shared lock to block commits until START TRANSACTION WITH
6869 CONSISTENT SNAPSHOT completes snapshot creation for all storage
6870 engines. We only reach this code if binlog_order_commits=0.
6871 */
6872 DBUG_ASSERT(opt_binlog_order_commits == 0);
6873
6874 slock();
6875
6876 if (ha_commit_low(thd, all, false))
6877 thd->commit_error= THD::CE_COMMIT_ERROR;
6878
6879 sunlock();
6880 }
6816 /*6881 /*
6817 Decrement the prepared XID counter after storage engine commit6882 Decrement the prepared XID counter after storage engine commit
6818 */6883 */
@@ -7201,6 +7266,99 @@
7201 return 1;7266 return 1;
7202}7267}
72037268
7269/*
7270 Copy out the non-directory part of binlog position filename for the
7271 `binlog_snapshot_file' status variable, same way as it is done for
7272 SHOW MASTER STATUS.
7273*/
7274static void set_binlog_snapshot_file(const char *src)
7275{
7276 int dir_len = dirname_length(src);
7277 strmake(binlog_snapshot_file, src + dir_len,
7278 sizeof(binlog_snapshot_file) - 1);
7279}
7280
7281/*
7282 Copy out current values of status variables, for SHOW STATUS or
7283 information_schema.global_status.
7284
7285 This is called only under LOCK_status, so we can fill in a static array.
7286*/
7287void MYSQL_BIN_LOG::set_status_variables(THD *thd)
7288{
7289 binlog_cache_mngr *cache_mngr;
7290
7291 if (thd && opt_bin_log)
7292 cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
7293 else
7294 cache_mngr= 0;
7295
7296 bool have_snapshot= (cache_mngr &&
7297 cache_mngr->binlog_info.log_file_name[0] != '\0');
7298 mysql_mutex_lock(&LOCK_log);
7299 if (!have_snapshot)
7300 {
7301 set_binlog_snapshot_file(log_file_name);
7302 binlog_snapshot_position= my_b_tell(&log_file);
7303 }
7304 mysql_mutex_unlock(&LOCK_log);
7305
7306 if (have_snapshot)
7307 {
7308 set_binlog_snapshot_file(cache_mngr->binlog_info.log_file_name);
7309 binlog_snapshot_position= cache_mngr->binlog_info.pos;
7310 }
7311}
7312
7313
7314void MYSQL_BIN_LOG::xlock(void)
7315{
7316 DBUG_ASSERT(!snapshot_lock_acquired);
7317
7318 mysql_mutex_lock(&LOCK_log);
7319
7320 /*
7321 We must ensure that no writes to binlog and no commits to storage engines
7322 occur after function is called for START TRANSACTION FOR CONSISTENT
7323 SNAPSHOT. With binlog_order_commits=1 (the default) flushing to binlog is
7324 performed under the LOCK_log mutex and commits are done under the
7325 LOCK_commit mutex, both in the stage leader thread. So acquiring those 2
7326 mutexes is sufficient to guarantee atomicity.
7327
7328 With binlog_order_commits=0 commits are performed in parallel by separate
7329 threads with each acquiring a shared lock on LOCK_consistent_snapshot.
7330
7331 binlog_order_commits is a dynamic variable, so we have to keep track what
7332 primitives should be used in unlock_for_snapshot().
7333 */
7334 if (opt_binlog_order_commits)
7335 {
7336 mysql_mutex_lock(&LOCK_commit);
7337 }
7338 else
7339 {
7340 snapshot_lock_acquired= true;
7341 mysql_rwlock_wrlock(&LOCK_consistent_snapshot);
7342 }
7343}
7344
7345
7346void MYSQL_BIN_LOG::xunlock(void)
7347{
7348 if (!snapshot_lock_acquired)
7349 {
7350 mysql_mutex_unlock(&LOCK_commit);
7351 }
7352 else
7353 {
7354 mysql_rwlock_unlock(&LOCK_consistent_snapshot);
7355 snapshot_lock_acquired= false;
7356 }
7357
7358 mysql_mutex_unlock(&LOCK_log);
7359}
7360
7361
7204Group_cache *THD::get_group_cache(bool is_transactional)7362Group_cache *THD::get_group_cache(bool is_transactional)
7205{7363{
7206 DBUG_ENTER("THD::get_group_cache(bool)");7364 DBUG_ENTER("THD::get_group_cache(bool)");
@@ -9052,6 +9210,25 @@
90529210
9053#endif /* !defined(MYSQL_CLIENT) */9211#endif /* !defined(MYSQL_CLIENT) */
90549212
9213static int show_binlog_vars(THD *thd, SHOW_VAR *var, char *buff)
9214{
9215 if (mysql_bin_log.is_open())
9216 mysql_bin_log.set_status_variables(thd);
9217 else
9218 {
9219 binlog_snapshot_file[0]= '\0';
9220 binlog_snapshot_position= 0;
9221 }
9222 var->type= SHOW_ARRAY;
9223 var->value= (char *)&binlog_status_vars_detail;
9224 return 0;
9225}
9226
9227static SHOW_VAR binlog_status_vars_top[]= {
9228 {"Binlog", (char *) &show_binlog_vars, SHOW_FUNC},
9229 {NullS, NullS, SHOW_LONG}
9230};
9231
9055struct st_mysql_storage_engine binlog_storage_engine=9232struct st_mysql_storage_engine binlog_storage_engine=
9056{ MYSQL_HANDLERTON_INTERFACE_VERSION };9233{ MYSQL_HANDLERTON_INTERFACE_VERSION };
90579234
@@ -9068,7 +9245,7 @@
9068 binlog_init, /* Plugin Init */9245 binlog_init, /* Plugin Init */
9069 NULL, /* Plugin Deinit */9246 NULL, /* Plugin Deinit */
9070 0x0100 /* 1.0 */,9247 0x0100 /* 1.0 */,
9071 NULL, /* status variables */9248 binlog_status_vars_top, /* status variables */
9072 NULL, /* system variables */9249 NULL, /* system variables */
9073 NULL, /* config options */9250 NULL, /* config options */
9074 0, 9251 0,
90759252
=== modified file 'sql/binlog.h'
--- sql/binlog.h 2014-02-17 11:12:40 +0000
+++ sql/binlog.h 2014-05-06 08:36:28 +0000
@@ -501,6 +501,8 @@
501private:501private:
502 Gtid_set* previous_gtid_set;502 Gtid_set* previous_gtid_set;
503503
504 bool snapshot_lock_acquired;
505
504 int open(const char *opt_name) { return open_binlog(opt_name); }506 int open(const char *opt_name) { return open_binlog(opt_name); }
505 bool change_stage(THD *thd, Stage_manager::StageID stage,507 bool change_stage(THD *thd, Stage_manager::StageID stage,
506 THD* queue, mysql_mutex_t *leave,508 THD* queue, mysql_mutex_t *leave,
@@ -528,7 +530,15 @@
528 void update_thd_next_event_pos(THD *thd);530 void update_thd_next_event_pos(THD *thd);
529 int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event,531 int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event,
530 bool is_transactional);532 bool is_transactional);
531533 void xlock(void);
534 void xunlock(void);
535 void slock(void) { mysql_rwlock_rdlock(&LOCK_consistent_snapshot); }
536 void sunlock(void) { mysql_rwlock_unlock(&LOCK_consistent_snapshot); }
537#else
538 void xlock(void) { }
539 void xunlock(void) { }
540 void slock(void) { }
541 void sunlock(void) { }
532#endif /* !defined(MYSQL_CLIENT) */542#endif /* !defined(MYSQL_CLIENT) */
533 void add_bytes_written(ulonglong inc)543 void add_bytes_written(ulonglong inc)
534 {544 {
@@ -674,6 +684,7 @@
674 inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);}684 inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);}
675 inline IO_CACHE *get_index_file() { return &index_file;}685 inline IO_CACHE *get_index_file() { return &index_file;}
676 inline uint32 get_open_count() { return open_count; }686 inline uint32 get_open_count() { return open_count; }
687 void set_status_variables(THD *thd);
677};688};
678689
679typedef struct st_load_file_info690typedef struct st_load_file_info
680691
=== modified file 'sql/handler.cc'
--- sql/handler.cc 2014-04-24 05:16:52 +0000
+++ sql/handler.cc 2014-05-06 08:36:28 +0000
@@ -2270,8 +2270,18 @@
2270{2270{
2271 bool warn= true;2271 bool warn= true;
22722272
2273 /*
2274 Blocking commits and binlog updates ensures that we get the same snapshot
2275 for all engines (including the binary log). This allows us among other
2276 things to do backups with START TRANSACTION WITH CONSISTENT SNAPSHOT and
2277 have a consistent binlog position.
2278 */
2279 tc_log->xlock();
2280
2273 plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);2281 plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);
22742282
2283 tc_log->xunlock();
2284
2275 /*2285 /*
2276 Same idea as when one wants to CREATE TABLE in one engine which does not2286 Same idea as when one wants to CREATE TABLE in one engine which does not
2277 exist:2287 exist:
22782288
=== modified file 'sql/handler.h'
--- sql/handler.h 2014-04-24 05:16:52 +0000
+++ sql/handler.h 2014-05-06 08:36:28 +0000
@@ -1024,6 +1024,7 @@
10241024
1025#define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10)1025#define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10)
10261026
1027<<<<<<< TREE
1027/**1028/**
1028 Set if the storage engine supports 'online' backups. This means that there1029 Set if the storage engine supports 'online' backups. This means that there
1029 exists a way to create a consistent copy of its tables without blocking1030 exists a way to create a consistent copy of its tables without blocking
@@ -1036,6 +1037,15 @@
1036 Engine supports secondary clustered keys.1037 Engine supports secondary clustered keys.
1037*/1038*/
1038#define HTON_SUPPORTS_CLUSTERED_KEYS (1 << 12)1039#define HTON_SUPPORTS_CLUSTERED_KEYS (1 << 12)
1040=======
1041/**
1042 Set if the storage engine supports 'online' backups. This means that there
1043 exists a way to create a consistent copy of its tables without blocking
1044 updates to them. If so, statements that update such tables will not be
1045 affected by an active LOCK TABLES FOR BACKUP.
1046*/
1047#define HTON_SUPPORTS_ONLINE_BACKUPS (1 << 11)
1048>>>>>>> MERGE-SOURCE
10391049
1040enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,1050enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
1041 ISO_REPEATABLE_READ, ISO_SERIALIZABLE};1051 ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
10421052
=== modified file 'sql/log.cc'
--- sql/log.cc 2014-04-25 10:55:01 +0000
+++ sql/log.cc 2014-05-06 08:36:28 +0000
@@ -53,6 +53,7 @@
53#include "rpl_handler.h"53#include "rpl_handler.h"
54#include "debug_sync.h"54#include "debug_sync.h"
55#include "sql_show.h"55#include "sql_show.h"
56#include "mysqld.h"
5657
57/* max size of the log message */58/* max size of the log message */
58#define MAX_LOG_BUFFER_SIZE 102459#define MAX_LOG_BUFFER_SIZE 1024
@@ -2899,12 +2900,21 @@
2899 DBUG_ENTER("TC_LOG_MMAP::commit");2900 DBUG_ENTER("TC_LOG_MMAP::commit");
2900 unsigned long cookie= 0;2901 unsigned long cookie= 0;
2901 my_xid xid= thd->transaction.xid_state.xid.get_my_xid();2902 my_xid xid= thd->transaction.xid_state.xid.get_my_xid();
2903 int rc;
29022904
2903 if (all && xid)2905 if (all && xid)
2904 if (!(cookie= log_xid(thd, xid)))2906 if (!(cookie= log_xid(thd, xid)))
2905 DBUG_RETURN(RESULT_ABORTED); // Failed to log the transaction2907 DBUG_RETURN(RESULT_ABORTED); // Failed to log the transaction
29062908
2907 if (ha_commit_low(thd, all))2909 /*
2910 Acquire a shared lock to block commits until START TRANSACTION WITH
2911 CONSISTENT SNAPSHOT completes snapshot creation for all storage engines.
2912 */
2913 slock();
2914 rc= ha_commit_low(thd, all);
2915 sunlock();
2916
2917 if (rc)
2908 DBUG_RETURN(RESULT_INCONSISTENT); // Transaction logged, but not committed2918 DBUG_RETURN(RESULT_INCONSISTENT); // Transaction logged, but not committed
29092919
2910 /* If cookie is non-zero, something was logged */2920 /* If cookie is non-zero, something was logged */
29112921
=== modified file 'sql/log.h'
--- sql/log.h 2014-02-17 11:12:40 +0000
+++ sql/log.h 2014-05-06 08:36:28 +0000
@@ -102,6 +102,26 @@
102 @return Error code on failure, zero on success.102 @return Error code on failure, zero on success.
103 */103 */
104 virtual int prepare(THD *thd, bool all) = 0;104 virtual int prepare(THD *thd, bool all) = 0;
105
106 /**
107 Acquire an exclusive lock to block binary log updates and commits. This is
108 used by START TRANSACTION WITH CONSISTENT SNAPSHOT to create an atomic
109 snapshot.
110 */
111 virtual void xlock(void) = 0;
112
113 /** Release lock acquired with xlock(). */
114 virtual void xunlock(void) = 0;
115
116 /**
117 Acquire a shared lock to block commits. This is used when calling
118 ha_commit_low() to block commits if there's an exclusive lock acquired by
119 START TRANSACTION WITH CONSISTENT SNAPSHOT.
120 */
121 virtual void slock(void) = 0;
122
123 /** Release lock acquired with slock(). */
124 virtual void sunlock(void) = 0;
105};125};
106126
107127
@@ -120,6 +140,10 @@
120 int prepare(THD *thd, bool all) {140 int prepare(THD *thd, bool all) {
121 return ha_prepare_low(thd, all);141 return ha_prepare_low(thd, all);
122 }142 }
143 void xlock(void) {}
144 void xunlock(void) {}
145 void slock(void) {}
146 void sunlock(void) {}
123};147};
124148
125#ifdef HAVE_MMAP149#ifdef HAVE_MMAP
@@ -166,6 +190,10 @@
166 enum_result commit(THD *thd, bool all);190 enum_result commit(THD *thd, bool all);
167 int rollback(THD *thd, bool all) { return ha_rollback_low(thd, all); }191 int rollback(THD *thd, bool all) { return ha_rollback_low(thd, all); }
168 int prepare(THD *thd, bool all) { return ha_prepare_low(thd, all); }192 int prepare(THD *thd, bool all) { return ha_prepare_low(thd, all); }
193 void xlock(void) { mysql_rwlock_wrlock(&LOCK_consistent_snapshot); }
194 void xunlock(void) { mysql_rwlock_unlock(&LOCK_consistent_snapshot); }
195 void slock(void) { mysql_rwlock_rdlock(&LOCK_consistent_snapshot); }
196 void sunlock(void) { mysql_rwlock_unlock(&LOCK_consistent_snapshot); }
169 int recover();197 int recover();
170 uint size() const;198 uint size() const;
171199
172200
=== modified file 'sql/mysqld.cc'
--- sql/mysqld.cc 2014-04-25 10:55:01 +0000
+++ sql/mysqld.cc 2014-05-06 08:36:28 +0000
@@ -781,6 +781,8 @@
781mysql_mutex_t LOCK_server_started;781mysql_mutex_t LOCK_server_started;
782mysql_cond_t COND_server_started;782mysql_cond_t COND_server_started;
783783
784mysql_rwlock_t LOCK_consistent_snapshot;
785
784int mysqld_server_started= 0;786int mysqld_server_started= 0;
785787
786File_parser_dummy_hook file_parser_dummy_hook;788File_parser_dummy_hook file_parser_dummy_hook;
@@ -2062,6 +2064,7 @@
2062 mysql_mutex_destroy(&LOCK_global_user_client_stats);2064 mysql_mutex_destroy(&LOCK_global_user_client_stats);
2063 mysql_mutex_destroy(&LOCK_global_table_stats);2065 mysql_mutex_destroy(&LOCK_global_table_stats);
2064 mysql_mutex_destroy(&LOCK_global_index_stats);2066 mysql_mutex_destroy(&LOCK_global_index_stats);
2067 mysql_rwlock_destroy(&LOCK_consistent_snapshot);
2065}2068}
2066#endif /*EMBEDDED_LIBRARY*/2069#endif /*EMBEDDED_LIBRARY*/
20672070
@@ -4322,6 +4325,8 @@
4322 mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect);4325 mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect);
4323 mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave);4326 mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave);
4324 mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant);4327 mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant);
4328 mysql_rwlock_init(key_rwlock_LOCK_consistent_snapshot,
4329 &LOCK_consistent_snapshot);
4325 mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL);4330 mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL);
4326 mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);4331 mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);
4327 mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);4332 mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);
@@ -9727,7 +9732,7 @@
9727PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,9732PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
9728 key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,9733 key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
9729 key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,9734 key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,
9730 key_rwlock_global_sid_lock;9735 key_rwlock_global_sid_lock, key_rwlock_LOCK_consistent_snapshot;
97319736
9732PSI_rwlock_key key_rwlock_Trans_delegate_lock;9737PSI_rwlock_key key_rwlock_Trans_delegate_lock;
9733PSI_rwlock_key key_rwlock_Binlog_storage_delegate_lock;9738PSI_rwlock_key key_rwlock_Binlog_storage_delegate_lock;
@@ -9753,7 +9758,8 @@
9753 { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0},9758 { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0},
9754 { &key_rwlock_global_sid_lock, "gtid_commit_rollback", PSI_FLAG_GLOBAL},9759 { &key_rwlock_global_sid_lock, "gtid_commit_rollback", PSI_FLAG_GLOBAL},
9755 { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL},9760 { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL},
9756 { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL}9761 { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL},
9762 { &key_rwlock_LOCK_consistent_snapshot, "LOCK_consistent_snapshot", PSI_FLAG_GLOBAL}
9757};9763};
97589764
9759#ifdef HAVE_MMAP9765#ifdef HAVE_MMAP
97609766
=== modified file 'sql/mysqld.h'
--- sql/mysqld.h 2014-04-25 10:55:01 +0000
+++ sql/mysqld.h 2014-05-06 08:36:28 +0000
@@ -386,7 +386,7 @@
386extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,386extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
387 key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,387 key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
388 key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,388 key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,
389 key_rwlock_global_sid_lock;389 key_rwlock_global_sid_lock, key_rwlock_LOCK_consistent_snapshot;
390390
391#ifdef HAVE_MMAP391#ifdef HAVE_MMAP
392extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;392extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
@@ -620,6 +620,7 @@
620extern mysql_cond_t COND_server_started;620extern mysql_cond_t COND_server_started;
621extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;621extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
622extern mysql_rwlock_t LOCK_system_variables_hash;622extern mysql_rwlock_t LOCK_system_variables_hash;
623extern mysql_rwlock_t LOCK_consistent_snapshot;
623extern mysql_cond_t COND_manager;624extern mysql_cond_t COND_manager;
624extern int32 thread_running;625extern int32 thread_running;
625extern my_atomic_rwlock_t thread_running_lock;626extern my_atomic_rwlock_t thread_running_lock;
626627
=== modified file 'sql/share/errmsg-utf8.txt'
--- sql/share/errmsg-utf8.txt 2014-04-24 05:16:52 +0000
+++ sql/share/errmsg-utf8.txt 2014-05-06 08:36:28 +0000
@@ -7088,6 +7088,7 @@
7088ER_TEMP_FILE_WRITE_FAILURE7088ER_TEMP_FILE_WRITE_FAILURE
7089 eng "Temporary file write failure."7089 eng "Temporary file write failure."
70907090
7091<<<<<<< TREE
7091ER_INNODB_FT_AUX_NOT_HEX_ID7092ER_INNODB_FT_AUX_NOT_HEX_ID
7092 eng "Upgrade index name failed, please use create index(alter table) algorithm copy to rebuild index."7093 eng "Upgrade index name failed, please use create index(alter table) algorithm copy to rebuild index."
70937094
@@ -7108,6 +7109,12 @@
7108 eng "Can’t execute the query because you have a conflicting backup lock"7109 eng "Can’t execute the query because you have a conflicting backup lock"
7109 rus "Запрос не может быть выполнен из-за конфликтующей блокировки резервного копирования"7110 rus "Запрос не может быть выполнен из-за конфликтующей блокировки резервного копирования"
71107111
7112=======
7113ER_CANT_EXECUTE_WITH_BACKUP_LOCK
7114 eng "Can’t execute the query because you have a conflicting backup lock"
7115 rus "Запрос не может быть выполнен из-за конфликтующей блокировки резервного копирования"
7116
7117>>>>>>> MERGE-SOURCE
7111#7118#
7112# End of 5.6 error messages.7119# End of 5.6 error messages.
7113#7120#
71147121
=== modified file 'storage/innobase/buf/buf0flu.cc'
--- storage/innobase/buf/buf0flu.cc 2014-04-24 05:16:52 +0000
+++ storage/innobase/buf/buf0flu.cc 2014-05-06 08:36:28 +0000
@@ -1376,10 +1376,17 @@
13761376
1377 /* These fields are protected by the buf_page_get_mutex()1377 /* These fields are protected by the buf_page_get_mutex()
1378 mutex. */1378 mutex. */
1379<<<<<<< TREE
1379 /* Read the fields directly in order to avoid asserting on1380 /* Read the fields directly in order to avoid asserting on
1380 BUF_BLOCK_REMOVE_HASH pages. */1381 BUF_BLOCK_REMOVE_HASH pages. */
1381 ulint space = bpage->space;1382 ulint space = bpage->space;
1382 ulint offset = bpage->offset;1383 ulint offset = bpage->offset;
1384=======
1385 /* Read the fields directly in order to avoid asserting on
1386 BUF_BLOCK_REMOVE_HASH pages. */
1387 space = bpage->space;
1388 offset = bpage->offset;
1389>>>>>>> MERGE-SOURCE
13831390
1384 if (flush_type == BUF_FLUSH_LRU) {1391 if (flush_type == BUF_FLUSH_LRU) {
1385 mutex_exit(block_mutex);1392 mutex_exit(block_mutex);

Subscribers

People subscribed via source and target branches