Merge lp:~akopytov/percona-server/snapshot-cloning into lp:percona-server/5.6

Proposed by Alexey Kopytov
Status: Superseded
Proposed branch: lp:~akopytov/percona-server/snapshot-cloning
Merge into: lp:percona-server/5.6
Diff against target: 2833 lines (+1908/-48) (has conflicts)
32 files modified
build-ps/debian/control (+17/-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/clone_consistent_snapshot.result (+145/-0)
mysql-test/r/mysqldump-max.result (+57/-0)
mysql-test/suite/binlog/r/binlog_consistent.result (+178/-0)
mysql-test/suite/binlog/t/binlog_consistent.test (+144/-0)
mysql-test/suite/perfschema/r/dml_setup_instruments.result (+1/-1)
mysql-test/suite/sys_vars/r/have_snapshot_cloning_basic.result (+11/-0)
mysql-test/suite/sys_vars/t/have_snapshot_cloning_basic.test (+7/-0)
mysql-test/t/backup_locks_mysqldump.test (+61/-0)
mysql-test/t/clone_consistent_snapshot.test (+167/-0)
mysql-test/t/mysqldump-max.test (+83/-0)
sql/binlog.cc (+245/-6)
sql/binlog.h (+13/-1)
sql/handler.cc (+106/-3)
sql/handler.h (+1/-0)
sql/log.cc (+11/-1)
sql/log.h (+28/-0)
sql/mysqld.cc (+23/-6)
sql/mysqld.h (+2/-1)
sql/set_var.h (+6/-1)
sql/share/errmsg-utf8.txt (+7/-0)
sql/sql_yacc.yy (+6/-0)
sql/sys_vars.cc (+15/-4)
storage/innobase/buf/buf0flu.cc (+7/-0)
storage/innobase/handler/ha_innodb.cc (+114/-0)
storage/innobase/include/read0read.h (+21/-0)
storage/innobase/include/trx0trx.h (+10/-0)
storage/innobase/read/read0read.cc (+2/-2)
storage/innobase/trx/trx0trx.cc (+32/-0)
Text conflict in build-ps/debian/control
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/mysqld.cc
Text conflict in sql/set_var.h
Text conflict in sql/share/errmsg-utf8.txt
Text conflict in sql/sys_vars.cc
Text conflict in storage/innobase/buf/buf0flu.cc
To merge this branch: bzr merge lp:~akopytov/percona-server/snapshot-cloning
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+211192@code.launchpad.net

This proposal has been superseded by a proposal from 2014-03-16.

Description of the change

The patch extends START TRANSACTION WITH CONSISTENT SNAPSHOT with the
optional FROM SESSION clause:

START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION <session_id>;

When specified, all participating storage engines and binary log instead
of creating a new snapshot of data (or binary log coordinates), create a
copy of the snapshot which has been created by an active transaction in
the specified session. session_id is the session identifier reported in
the Id column of SHOW PROCESSLIST. The CONNECTION_ID() function returns
the identifier of the current session.

Currently snapshot cloning is only supported by XtraDB and the binary
log.

For XtraDB, a transaction with a cloned snapshot will only see data
visible by the donor transaction at the time it was started. That is,
the cloned transaction will see no changes made between the donor and
cloned transactions were started. It will also see no changes made by
both the donor transaction and even itself.

For binary log, cloning means that Binlog_snapshot_file and
Binlog_snapshot_position variables implemented in
https://blueprints.launchpad.net/percona-server/+spec/enhancements-for-start-transaction-with-consistent
will always have the same values for both the cloned and the donor
transaction.

New server variables
--------------------

have_snapshot_cloning

  This is a server variable implemented to help other utilities detect
  if the server supports the FROM SESSION extention. When available, the
  snapshot cloning feature and the syntax extension to START TRANSACTION
  WITH CONSISTENT SNAPSHOT are supported by the server, and the variable
  value is always YES.

http://jenkins.percona.com/view/PS 5.6/job/percona-server-5.6-param/549/

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
=== modified file 'build-ps/debian/control'
--- build-ps/debian/control 2014-03-03 17:51:33 +0000
+++ build-ps/debian/control 2014-03-16 07:05:06 +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
@@ -141,6 +146,7 @@
141Package: percona-server-server-5.6146Package: percona-server-server-5.6
142Architecture: any147Architecture: any
143Suggests: tinyca148Suggests: tinyca
149<<<<<<< TREE
144Pre-Depends: percona-server-common-5.6 (>= ${source:Version}),150Pre-Depends: percona-server-common-5.6 (>= ${source:Version}),
145 adduser (>= 3.4.0),151 adduser (>= 3.4.0),
146 debconf152 debconf
@@ -176,6 +182,13 @@
176 mariadb-server,182 mariadb-server,
177 mariadb-server-core-5.5,183 mariadb-server-core-5.5,
178 mariadb-server-5.5184 mariadb-server-5.5
185=======
186Pre-Depends: percona-server-common-5.6 (>= ${source:Version}), adduser (>= 3.4.0), debconf
187Depends: 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)
188Conflicts: 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
189Provides: mysql-server
190Replaces: 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
191>>>>>>> MERGE-SOURCE
179Description: Percona Server database server binaries192Description: Percona Server database server binaries
180 Percona Server is a fast, stable and true multi-user, multi-threaded SQL193 Percona Server is a fast, stable and true multi-user, multi-threaded SQL
181 database server. SQL (Structured Query Language) is the most popular database194 database server. SQL (Structured Query Language) is the most popular database
@@ -215,10 +228,14 @@
215228
216Package: percona-server-test-5.6229Package: percona-server-test-5.6
217Architecture: any230Architecture: any
231<<<<<<< TREE
218Depends: percona-server-client-5.6 (>= ${source:Version}),232Depends: percona-server-client-5.6 (>= ${source:Version}),
219 percona-server-server-5.6 (>= ${source:Version}),233 percona-server-server-5.6 (>= ${source:Version}),
220 ${misc:Depends},234 ${misc:Depends},
221 ${shlibs:Depends}235 ${shlibs:Depends}
236=======
237Depends: percona-server-client-5.6 (>= ${source:Version}), percona-server-server-5.6 (>= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}
238>>>>>>> MERGE-SOURCE
222Description: Percona Server database test suite239Description: Percona Server database test suite
223 Percona Server is a fast, stable and true multi-user, multi-threaded SQL240 Percona Server is a fast, stable and true multi-user, multi-threaded SQL
224 database server. SQL (Structured Query Language) is the most popular database241 database server. SQL (Structured Query Language) is the most popular database
225242
=== modified file 'build-ps/debian/rules'
=== modified file 'build-ps/percona-server.spec'
=== modified file 'client/mysqldump.c'
--- client/mysqldump.c 2014-03-03 17:51:33 +0000
+++ client/mysqldump.c 2014-03-16 07:05:06 +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,
@@ -418,9 +421,10 @@
418 "This causes the binary log position and filename to be appended to the "421 "This causes the binary log position and filename to be appended to the "
419 "output. If equal to 1, will print it as a CHANGE MASTER command; if equal"422 "output. If equal to 1, will print it as a CHANGE MASTER command; if equal"
420 " to 2, that command will be prefixed with a comment symbol. "423 " to 2, that command will be prefixed with a comment symbol. "
421 "This option will turn --lock-all-tables on, unless "424 "This option will turn --lock-all-tables on, unless --single-transaction "
422 "--single-transaction is specified too (in which case a "425 "is specified too (on servers that don't provide Binlog_snapshot_file and "
423 "global read lock is only taken a short time at the beginning of the dump; "426 "Binlog_snapshot_position status variables this will still take a "
427 "global read lock for a short time at the beginning of the dump; "
424 "don't forget to read about --single-transaction below). In all cases, "428 "don't forget to read about --single-transaction below). In all cases, "
425 "any action on logs will happen at the exact moment of the dump. "429 "any action on logs will happen at the exact moment of the dump. "
426 "Option automatically turns --lock-tables off.",430 "Option automatically turns --lock-tables off.",
@@ -1222,6 +1226,44 @@
1222}1226}
12231227
12241228
1229/*
1230 Check if server supports non-blocking binlog position using the
1231 binlog_snapshot_file and binlog_snapshot_position status variables. If it
1232 does, also return the position obtained if output pointers are non-NULL.
1233 Returns 1 if position available, 0 if not.
1234*/
1235static int
1236check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset)
1237{
1238 MYSQL_RES *res;
1239 MYSQL_ROW row;
1240 int found;
1241
1242 if (mysql_query_with_error_report(mysql, &res,
1243 "SHOW STATUS LIKE 'binlog_snapshot_%'"))
1244 return 1;
1245
1246 found= 0;
1247 while ((row= mysql_fetch_row(res)))
1248 {
1249 if (0 == strcmp(row[0], "Binlog_snapshot_file"))
1250 {
1251 if (binlog_pos_file)
1252 strmake(binlog_pos_file, row[1], FN_REFLEN-1);
1253 found++;
1254 }
1255 else if (0 == strcmp(row[0], "Binlog_snapshot_position"))
1256 {
1257 if (binlog_pos_offset)
1258 strmake(binlog_pos_offset, row[1], LONGLONG_LEN);
1259 found++;
1260 }
1261 }
1262 mysql_free_result(res);
1263
1264 return (found == 2);
1265}
1266
1225static char *my_case_str(const char *str,1267static char *my_case_str(const char *str,
1226 uint str_len,1268 uint str_len,
1227 const char *token,1269 const char *token,
@@ -5296,41 +5338,64 @@
5296} /* dump_selected_tables */5338} /* dump_selected_tables */
52975339
52985340
5299static int do_show_master_status(MYSQL *mysql_con)5341static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos)
5300{5342{
5301 MYSQL_ROW row;5343 MYSQL_ROW row;
5302 MYSQL_RES *master;5344 MYSQL_RES *master;
5345 char binlog_pos_file[FN_REFLEN];
5346 char binlog_pos_offset[LONGLONG_LEN+1];
5347 char *file, *offset;
5303 const char *comment_prefix=5348 const char *comment_prefix=
5304 (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : "";5349 (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : "";
5305 if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS"))5350
5351 if (consistent_binlog_pos)
5306 {5352 {
5307 return 1;5353 if (!check_consistent_binlog_pos(binlog_pos_file, binlog_pos_offset))
5354 return 1;
5355
5356 file= binlog_pos_file;
5357 offset= binlog_pos_offset;
5308 }5358 }
5309 else5359 else
5310 {5360 {
5361 if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS"))
5362 return 1;
5363
5311 row= mysql_fetch_row(master);5364 row= mysql_fetch_row(master);
5312 if (row && row[0] && row[1])5365 if (row && row[0] && row[1])
5313 {5366 {
5314 /* SHOW MASTER STATUS reports file and position */5367 file= row[0];
5315 print_comment(md_result_file, 0,5368 offset= row[1];
5316 "\n--\n-- Position to start replication or point-in-time "
5317 "recovery from\n--\n\n");
5318 fprintf(md_result_file,
5319 "%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n",
5320 comment_prefix, row[0], row[1]);
5321 check_io(md_result_file);
5322 }5369 }
5323 else if (!ignore_errors)5370 else
5324 {5371 {
5325 /* SHOW MASTER STATUS reports nothing and --force is not enabled */
5326 my_printf_error(0, "Error: Binlogging on server not active",
5327 MYF(0));
5328 mysql_free_result(master);5372 mysql_free_result(master);
5329 maybe_exit(EX_MYSQLERR);5373 if (!ignore_errors)
5330 return 1;5374 {
5375 /* SHOW MASTER STATUS reports nothing and --force is not enabled */
5376 my_printf_error(0, "Error: Binlogging on server not active", MYF(0));
5377 maybe_exit(EX_MYSQLERR);
5378 return 1;
5379 }
5380 else
5381 {
5382 return 0;
5383 }
5331 }5384 }
5385 }
5386
5387 /* SHOW MASTER STATUS reports file and position */
5388 print_comment(md_result_file, 0,
5389 "\n--\n-- Position to start replication or point-in-time "
5390 "recovery from\n--\n\n");
5391 fprintf(md_result_file,
5392 "%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n",
5393 comment_prefix, file, offset);
5394 check_io(md_result_file);
5395
5396 if (!consistent_binlog_pos)
5332 mysql_free_result(master);5397 mysql_free_result(master);
5333 }5398
5334 return 0;5399 return 0;
5335}5400}
53365401
@@ -6289,6 +6354,7 @@
6289{6354{
6290 char bin_log_name[FN_REFLEN];6355 char bin_log_name[FN_REFLEN];
6291 int exit_code;6356 int exit_code;
6357 int consistent_binlog_pos= 0;
6292 MY_INIT("mysqldump");6358 MY_INIT("mysqldump");
62936359
6294 compatible_mode_normal_str[0]= 0;6360 compatible_mode_normal_str[0]= 0;
@@ -6337,6 +6403,7 @@
6337 if (opt_slave_data && do_stop_slave_sql(mysql))6403 if (opt_slave_data && do_stop_slave_sql(mysql))
6338 goto err;6404 goto err;
63396405
6406<<<<<<< TREE
6340 if ((opt_lock_all_tables || opt_master_data ||6407 if ((opt_lock_all_tables || opt_master_data ||
6341 (opt_single_transaction && flush_logs)))6408 (opt_single_transaction && flush_logs)))
6342 {6409 {
@@ -6344,6 +6411,24 @@
6344 goto err;6411 goto err;
6345 }6412 }
6346 else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))6413 else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))
6414=======
6415 if (opt_single_transaction && opt_master_data)
6416 {
6417 /*
6418 See if we can avoid FLUSH TABLES WITH READ LOCK with Binlog_snapshot_*
6419 variables.
6420 */
6421 consistent_binlog_pos= check_consistent_binlog_pos(NULL, NULL);
6422 }
6423
6424 if ((opt_lock_all_tables || (opt_master_data && !consistent_binlog_pos) ||
6425 (opt_single_transaction && flush_logs)))
6426 {
6427 if (do_flush_tables_read_lock(mysql))
6428 goto err;
6429 }
6430 else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))
6431>>>>>>> MERGE-SOURCE
6347 goto err;6432 goto err;
63486433
6349 /*6434 /*
@@ -6384,7 +6469,7 @@
6384 goto err;6469 goto err;
63856470
63866471
6387 if (opt_master_data && do_show_master_status(mysql))6472 if (opt_master_data && do_show_master_status(mysql, consistent_binlog_pos))
6388 goto err;6473 goto err;
6389 if (opt_slave_data && do_show_slave_status(mysql))6474 if (opt_slave_data && do_show_slave_status(mysql))
6390 goto err;6475 goto err;
63916476
=== modified file 'doc/source/index.rst'
=== modified file 'doc/source/upstream-bug-fixes.rst'
--- doc/source/upstream-bug-fixes.rst 2014-03-10 15:05:00 +0000
+++ doc/source/upstream-bug-fixes.rst 2014-03-16 07:05:06 +0000
@@ -5,6 +5,7 @@
5=============================================================5=============================================================
66
7+-------------------------------------------------------------------------------------------------------------+7+-------------------------------------------------------------------------------------------------------------+
8<<<<<<< TREE
8|:Upstream bug: :mysqlbug:`71988` - page_cleaner: aggressive background flushing |9|:Upstream bug: :mysqlbug:`71988` - page_cleaner: aggressive background flushing |
9|:Launchpad bug: :bug:`1238039` |10|:Launchpad bug: :bug:`1238039` |
10|:Upstream state: Verified (checked on 2014-03-10) |11|:Upstream state: Verified (checked on 2014-03-10) |
@@ -65,6 +66,14 @@
65|:Fix Released: :rn:`5.6.15-63.0` |66|:Fix Released: :rn:`5.6.15-63.0` |
66|:Upstream fix: N/A |67|:Upstream fix: N/A |
67+-------------------------------------------------------------------------------------------------------------+68+-------------------------------------------------------------------------------------------------------------+
69=======
70|:Upstream bug: :mysqlbug:`71217` - Threadpool - add thd_wait_begin/thd_wait_end to the network IO functions |
71|:Launchpad bug: :bug:`1159743` |
72|:Upstream state: Open (checked on 2014-02-05) |
73|:Fix Released: :rn:`5.6.15-63.0` |
74|:Upstream fix: N/A |
75+-------------------------------------------------------------------------------------------------------------+
76>>>>>>> MERGE-SOURCE
68|:Upstream bug: :mysqlbug:`41975` - Support for SSL options not included in mysqlbinlog |77|:Upstream bug: :mysqlbug:`41975` - Support for SSL options not included in mysqlbinlog |
69|:Launchpad bug: :bug:`1258154` |78|:Launchpad bug: :bug:`1258154` |
70|:Upstream state: Closed |79|:Upstream state: Closed |
@@ -75,12 +84,21 @@
75|:Launchpad bug: :bug:`1258154` |84|:Launchpad bug: :bug:`1258154` |
76|:Upstream state: Closed |85|:Upstream state: Closed |
77|:Fix Released: :rn:`5.6.15-63.0` |86|:Fix Released: :rn:`5.6.15-63.0` |
87<<<<<<< TREE
78|:Upstream fix: 5.6.12 |88|:Upstream fix: 5.6.12 |
79+-------------------------------------------------------------------------------------------------------------+89+-------------------------------------------------------------------------------------------------------------+
80|:Upstream bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed pages|90|:Upstream bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed pages|
81|:Launchpad bug: :bug:`1231918` |91|:Launchpad bug: :bug:`1231918` |
82|:Upstream state: Verified (checked on 2014-03-07) |92|:Upstream state: Verified (checked on 2014-03-07) |
83|:Fix Released: :rn:`5.6.13-61.0` |93|:Fix Released: :rn:`5.6.13-61.0` |
94=======
95|:Upstream fix: 5.6.12 |
96+-------------------------------------------------------------------------------------------------------------+
97|:Upstream bug: :mysqlbug:`71411` - buf_flush_LRU() does not return correct number in case of compressed pages|
98|:Launchpad bug: :bug:`1231918` |
99|:Upstream state: Verified (checked on 2014-02-05) |
100|:Fix Released: :rn:`5.6.13-61.0` |
101>>>>>>> MERGE-SOURCE
84|:Upstream fix: N/A |102|:Upstream fix: N/A |
85+-------------------------------------------------------------------------------------------------------------+103+-------------------------------------------------------------------------------------------------------------+
86|:Upstream bug: :mysqlbug:`70417` - rw_lock_x_lock_func_nowait() calls os_thread_get_curr_id() mostly ... |104|:Upstream bug: :mysqlbug:`70417` - rw_lock_x_lock_func_nowait() calls os_thread_get_curr_id() mostly ... |
@@ -91,7 +109,11 @@
91+-------------------------------------------------------------------------------------------------------------+109+-------------------------------------------------------------------------------------------------------------+
92|:Upstream bug: :mysqlbug:`70490` - Suppression is too strict on some systems |110|:Upstream bug: :mysqlbug:`70490` - Suppression is too strict on some systems |
93|:Launchpad bug: :bug:`1205196` |111|:Launchpad bug: :bug:`1205196` |
112<<<<<<< TREE
94|:Upstream state: No Feedback (checked on 2014-03-07) |113|:Upstream state: No Feedback (checked on 2014-03-07) |
114=======
115|:Upstream state: No Feedback (checked on 2014-02-05) |
116>>>>>>> MERGE-SOURCE
95|:Fix Released: :rn:`5.6.13-61.0` |117|:Fix Released: :rn:`5.6.13-61.0` |
96|:Upstream fix: N/A |118|:Upstream fix: N/A |
97+-------------------------------------------------------------------------------------------------------------+119+-------------------------------------------------------------------------------------------------------------+
@@ -103,7 +125,11 @@
103+-------------------------------------------------------------------------------------------------------------+125+-------------------------------------------------------------------------------------------------------------+
104|:Upstream bug: :mysqlbug:`70500` - Page cleaner should perform LRU flushing regardless of server activity |126|:Upstream bug: :mysqlbug:`70500` - Page cleaner should perform LRU flushing regardless of server activity |
105|:Launchpad bug: :bug:`1234562` |127|:Launchpad bug: :bug:`1234562` |
128<<<<<<< TREE
106|:Upstream state: Open (checked on 2014-03-07) |129|:Upstream state: Open (checked on 2014-03-07) |
130=======
131|:Upstream state: Open (checked on 2014-02-05) |
132>>>>>>> MERGE-SOURCE
107|:Fix Released: :rn:`5.6.13-61.0` |133|:Fix Released: :rn:`5.6.13-61.0` |
108|:Upstream fix: N/A |134|:Upstream fix: N/A |
109+-------------------------------------------------------------------------------------------------------------+135+-------------------------------------------------------------------------------------------------------------+
@@ -121,31 +147,51 @@
121+-------------------------------------------------------------------------------------------------------------+147+-------------------------------------------------------------------------------------------------------------+
122|:Upstream bug: :mysqlbug:`68481` - InnoDB LRU flushing for MySQL 5.6 needs work |148|:Upstream bug: :mysqlbug:`68481` - InnoDB LRU flushing for MySQL 5.6 needs work |
123|:Launchpad bug: :bug:`1232406` |149|:Launchpad bug: :bug:`1232406` |
150<<<<<<< TREE
124|:Upstream state: Verified (checked on 2014-03-07) |151|:Upstream state: Verified (checked on 2014-03-07) |
152=======
153|:Upstream state: Verified (checked on 2014-02-05) |
154>>>>>>> MERGE-SOURCE
125|:Fix Released: :rn:`5.6.13-61.0` |155|:Fix Released: :rn:`5.6.13-61.0` |
126|:Upstream fix: N/A |156|:Upstream fix: N/A |
127+-------------------------------------------------------------------------------------------------------------+157+-------------------------------------------------------------------------------------------------------------+
128|:Upstream bug: :mysqlbug:`70453` - Add hard timeouts to page cleaner flushes |158|:Upstream bug: :mysqlbug:`70453` - Add hard timeouts to page cleaner flushes |
129|:Launchpad bug: :bug:`1232101` |159|:Launchpad bug: :bug:`1232101` |
160<<<<<<< TREE
130|:Upstream state: Verified (checked on 2014-03-07) |161|:Upstream state: Verified (checked on 2014-03-07) |
162=======
163|:Upstream state: Verified (checked on 2014-02-05) |
164>>>>>>> MERGE-SOURCE
131|:Fix Released: :rn:`5.6.13-61.0` |165|:Fix Released: :rn:`5.6.13-61.0` |
132|:Upstream fix: N/A |166|:Upstream fix: N/A |
133+-------------------------------------------------------------------------------------------------------------+167+-------------------------------------------------------------------------------------------------------------+
134|:Upstream bug: :mysqlbug:`69170` - buf_flush_LRU is lazy |168|:Upstream bug: :mysqlbug:`69170` - buf_flush_LRU is lazy |
135|:Launchpad bug: :bug:`1231918` |169|:Launchpad bug: :bug:`1231918` |
170<<<<<<< TREE
136|:Upstream state: Verified (checked on 2014-03-07) |171|:Upstream state: Verified (checked on 2014-03-07) |
172=======
173|:Upstream state: Verified (checked on 2014-02-05) |
174>>>>>>> MERGE-SOURCE
137|:Fix Released: :rn:`5.6.13-61.0` |175|:Fix Released: :rn:`5.6.13-61.0` |
138|:Upstream fix: N/A |176|:Upstream fix: N/A |
139+-------------------------------------------------------------------------------------------------------------+177+-------------------------------------------------------------------------------------------------------------+
140|:Upstream bug: :mysqlbug:`68555` - thread convoys from log_checkpoint_margin with innodb_buffer_pool_inst... |178|:Upstream bug: :mysqlbug:`68555` - thread convoys from log_checkpoint_margin with innodb_buffer_pool_inst... |
141|:Launchpad bug: :bug:`1236884` |179|:Launchpad bug: :bug:`1236884` |
180<<<<<<< TREE
142|:Upstream state: Verified (checked on 2014-03-07) |181|:Upstream state: Verified (checked on 2014-03-07) |
182=======
183|:Upstream state: Verified (checked on 2014-02-05) |
184>>>>>>> MERGE-SOURCE
143|:Fix Released: :rn:`5.6.13-61.0` |185|:Fix Released: :rn:`5.6.13-61.0` |
144|:Upstream fix: N/A |186|:Upstream fix: N/A |
145+-------------------------------------------------------------------------------------------------------------+187+-------------------------------------------------------------------------------------------------------------+
146|:Upstream bug: :mysqlbug:`70228` - Is buf_LRU_free_page() really supposed to make non-zip block sticky at ...|188|:Upstream bug: :mysqlbug:`70228` - Is buf_LRU_free_page() really supposed to make non-zip block sticky at ...|
147|:Launchpad bug: :bug:`1220544` |189|:Launchpad bug: :bug:`1220544` |
190<<<<<<< TREE
148|:Upstream state: Verified (checked on 2014-03-07) |191|:Upstream state: Verified (checked on 2014-03-07) |
192=======
193|:Upstream state: Verified (checked on 2014-02-05) |
194>>>>>>> MERGE-SOURCE
149|:Fix Released: :rn:`5.6.13-60.6` |195|:Fix Released: :rn:`5.6.13-60.6` |
150|:Upstream fix: N/A |196|:Upstream fix: N/A |
151+-------------------------------------------------------------------------------------------------------------+197+-------------------------------------------------------------------------------------------------------------+
@@ -163,13 +209,21 @@
163+-------------------------------------------------------------------------------------------------------------+209+-------------------------------------------------------------------------------------------------------------+
164|:Upstream bug: :mysqlbug:`70216` - Unnecessary overhead from persistent adaptive hash index latches |210|:Upstream bug: :mysqlbug:`70216` - Unnecessary overhead from persistent adaptive hash index latches |
165|:Launchpad bug: :bug:`1218347` |211|:Launchpad bug: :bug:`1218347` |
212<<<<<<< TREE
166|:Upstream state: Verified (checked on 2014-03-07) |213|:Upstream state: Verified (checked on 2014-03-07) |
214=======
215|:Upstream state: Verified (checked on 2014-02-05) |
216>>>>>>> MERGE-SOURCE
167|:Fix Released: :rn:`5.6.13-60.6` |217|:Fix Released: :rn:`5.6.13-60.6` |
168|:Upstream fix: N/A |218|:Upstream fix: N/A |
169+-------------------------------------------------------------------------------------------------------------+219+-------------------------------------------------------------------------------------------------------------+
170|:Upstream bug: :mysqlbug:`62018` - innodb adaptive hash index mutex contention |220|:Upstream bug: :mysqlbug:`62018` - innodb adaptive hash index mutex contention |
171|:Launchpad bug: :bug:`1216804` |221|:Launchpad bug: :bug:`1216804` |
222<<<<<<< TREE
172|:Upstream state: Verified (checked on 2014-03-07) |223|:Upstream state: Verified (checked on 2014-03-07) |
224=======
225|:Upstream state: Verified (checked on 2014-02-05) |
226>>>>>>> MERGE-SOURCE
173|:Fix Released: :rn:`5.6.13-60.6` |227|:Fix Released: :rn:`5.6.13-60.6` |
174|:Upstream fix: N/A |228|:Upstream fix: N/A |
175+-------------------------------------------------------------------------------------------------------------+229+-------------------------------------------------------------------------------------------------------------+
@@ -187,13 +241,21 @@
187+-------------------------------------------------------------------------------------------------------------+241+-------------------------------------------------------------------------------------------------------------+
188|:Upstream bug: :mysqlbug:`42415` - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... |242|:Upstream bug: :mysqlbug:`42415` - UPDATE/DELETE with LIMIT clause unsafe for SBL even with ORDER BY PK ... |
189|:Launchpad bug: :bug:`1132194` |243|:Launchpad bug: :bug:`1132194` |
244<<<<<<< TREE
190|:Upstream state: Verified (checked on 2014-03-07) |245|:Upstream state: Verified (checked on 2014-03-07) |
246=======
247|:Upstream state: Verified (checked on 2014-02-05) |
248>>>>>>> MERGE-SOURCE
191|:Fix Released: :rn:`5.6.13-60.5` |249|:Fix Released: :rn:`5.6.13-60.5` |
192|:Upstream fix: N/A |250|:Upstream fix: N/A |
193+-------------------------------------------------------------------------------------------------------------+251+-------------------------------------------------------------------------------------------------------------+
194|:Upstream bug: :mysqlbug:`69639` - mysql failed to build with dtrace Sun D 1.11 |252|:Upstream bug: :mysqlbug:`69639` - mysql failed to build with dtrace Sun D 1.11 |
195|:Launchpad bug: :bug:`1196460` |253|:Launchpad bug: :bug:`1196460` |
254<<<<<<< TREE
196|:Upstream state: Open (checked on 2014-03-07) |255|:Upstream state: Open (checked on 2014-03-07) |
256=======
257|:Upstream state: Open (checked on 2014-02-05) |
258>>>>>>> MERGE-SOURCE
197|:Fix Released: :rn:`5.6.13-60.5` |259|:Fix Released: :rn:`5.6.13-60.5` |
198|:Upstream fix: N/A |260|:Upstream fix: N/A |
199+-------------------------------------------------------------------------------------------------------------+261+-------------------------------------------------------------------------------------------------------------+
@@ -211,10 +273,15 @@
211+-------------------------------------------------------------------------------------------------------------+273+-------------------------------------------------------------------------------------------------------------+
212|:Upstream bug: :mysqlbug:`69856` - mysql_install_db does not function properly in 5.6 for debug builds |274|:Upstream bug: :mysqlbug:`69856` - mysql_install_db does not function properly in 5.6 for debug builds |
213|:Launchpad bug: :bug:`1179359` |275|:Launchpad bug: :bug:`1179359` |
276<<<<<<< TREE
214|:Upstream state: Verified (checked on 2014-03-07) |277|:Upstream state: Verified (checked on 2014-03-07) |
278=======
279|:Upstream state: Verified (checked on 2014-02-05) |
280>>>>>>> MERGE-SOURCE
215|:Fix Released: :rn:`5.6.12-60.4` |281|:Fix Released: :rn:`5.6.12-60.4` |
216|:Upstream fix: N/A |282|:Upstream fix: N/A |
217+-------------------------------------------------------------------------------------------------------------+283+-------------------------------------------------------------------------------------------------------------+
284<<<<<<< TREE
218|:Upstream bug: :mysqlbug:`71603` - file name is not escaped in binlog for LOAD DATA INFILE statement |285|:Upstream bug: :mysqlbug:`71603` - file name is not escaped in binlog for LOAD DATA INFILE statement |
219|:Launchpad bug: :bug:`1277351` |286|:Launchpad bug: :bug:`1277351` |
220|:Upstream state: N/A |287|:Upstream state: N/A |
@@ -227,6 +294,14 @@
227|:Fix Released: :rn:`5.6.11-60.3` |294|:Fix Released: :rn:`5.6.11-60.3` |
228|:Upstream fix: N/A |295|:Upstream fix: N/A |
229+-------------------------------------------------------------------------------------------------------------+296+-------------------------------------------------------------------------------------------------------------+
297=======
298|:Upstream bug: :mysqlbug:`71183` - os_file_fsync() should handle fsync() returning EINTR |
299|:Launchpad bug: :bug:`1262651` |
300|:Upstream state: Verified (checked on 2014-02-05) |
301|:Fix Released: :rn:`5.6.11-60.3` |
302|:Upstream fix: N/A |
303+-------------------------------------------------------------------------------------------------------------+
304>>>>>>> MERGE-SOURCE
230|:Upstream bug: :mysqlbug:`63451` - atomic/x86-gcc.h:make_atomic_cas_body64 potential miscompilation bug |305|:Upstream bug: :mysqlbug:`63451` - atomic/x86-gcc.h:make_atomic_cas_body64 potential miscompilation bug |
231|:Launchpad bug: :bug:`878022` |306|:Launchpad bug: :bug:`878022` |
232|:Upstream state: Closed |307|:Upstream state: Closed |
@@ -241,7 +316,11 @@
241+-------------------------------------------------------------------------------------------------------------+316+-------------------------------------------------------------------------------------------------------------+
242|:Upstream bug: :mysqlbug:`69252` - All the parts.partition_max* tests are broken with MTR --parallel |317|:Upstream bug: :mysqlbug:`69252` - All the parts.partition_max* tests are broken with MTR --parallel |
243|:Launchpad bug: :bug:`1180481` |318|:Launchpad bug: :bug:`1180481` |
319<<<<<<< TREE
244|:Upstream state: Verified (checked on 2014-03-07) |320|:Upstream state: Verified (checked on 2014-03-07) |
321=======
322|:Upstream state: Verified (checked on 2014-02-05) |
323>>>>>>> MERGE-SOURCE
245|:Fix Released: :rn:`5.6.11-60.3` |324|:Fix Released: :rn:`5.6.11-60.3` |
246|:Upstream fix: N/A |325|:Upstream fix: N/A |
247+-------------------------------------------------------------------------------------------------------------+326+-------------------------------------------------------------------------------------------------------------+
@@ -253,7 +332,11 @@
253+-------------------------------------------------------------------------------------------------------------+332+-------------------------------------------------------------------------------------------------------------+
254|:Upstream bug: :mysqlbug:`68714` - Remove literal statement digest values from perfschema tests |333|:Upstream bug: :mysqlbug:`68714` - Remove literal statement digest values from perfschema tests |
255|:Launchpad bug: :bug:`1157078` |334|:Launchpad bug: :bug:`1157078` |
335<<<<<<< TREE
256|:Upstream state: Verified (checked on 2014-03-07) |336|:Upstream state: Verified (checked on 2014-03-07) |
337=======
338|:Upstream state: Verified (checked on 2014-02-05) |
339>>>>>>> MERGE-SOURCE
257|:Fix Released: :rn:`5.6.11-60.3` |340|:Fix Released: :rn:`5.6.11-60.3` |
258|:Upstream fix: N/A |341|:Upstream fix: N/A |
259+-------------------------------------------------------------------------------------------------------------+342+-------------------------------------------------------------------------------------------------------------+
@@ -277,13 +360,21 @@
277+-------------------------------------------------------------------------------------------------------------+360+-------------------------------------------------------------------------------------------------------------+
278|:Upstream bug: :mysqlbug:`68970` - fsp_reserve_free_extents switches from small to big tblspace handling ... |361|:Upstream bug: :mysqlbug:`68970` - fsp_reserve_free_extents switches from small to big tblspace handling ... |
279|:Launchpad bug: :bug:`1169494` |362|:Launchpad bug: :bug:`1169494` |
363<<<<<<< TREE
280|:Upstream state: Verified (checked on 2014-03-07) |364|:Upstream state: Verified (checked on 2014-03-07) |
365=======
366|:Upstream state: Verified (checked on 2014-02-05) |
367>>>>>>> MERGE-SOURCE
281|:Fix Released: :rn:`5.6.11-60.3` |368|:Fix Released: :rn:`5.6.11-60.3` |
282|:Upstream fix: N/A |369|:Upstream fix: N/A |
283+-------------------------------------------------------------------------------------------------------------+370+-------------------------------------------------------------------------------------------------------------+
284|:Upstream bug: :mysqlbug:`68713` - create_duplicate_weedout_tmp_table() leaves key_part_flag uninitialized |371|:Upstream bug: :mysqlbug:`68713` - create_duplicate_weedout_tmp_table() leaves key_part_flag uninitialized |
285|:Launchpad bug: :bug:`1157037` |372|:Launchpad bug: :bug:`1157037` |
373<<<<<<< TREE
286|:Upstream state: Verified (checked on 2014-03-07) |374|:Upstream state: Verified (checked on 2014-03-07) |
375=======
376|:Upstream state: Verified (checked on 2014-02-05) |
377>>>>>>> MERGE-SOURCE
287|:Fix Released: :rn:`5.6.11-60.3` |378|:Fix Released: :rn:`5.6.11-60.3` |
288|:Upstream fix: N/A |379|:Upstream fix: N/A |
289+-------------------------------------------------------------------------------------------------------------+380+-------------------------------------------------------------------------------------------------------------+
@@ -295,13 +386,21 @@
295+-------------------------------------------------------------------------------------------------------------+386+-------------------------------------------------------------------------------------------------------------+
296|:Upstream bug: :mysqlbug:`68999` - SSL_OP_NO_COMPRESSION not defined |387|:Upstream bug: :mysqlbug:`68999` - SSL_OP_NO_COMPRESSION not defined |
297|:Launchpad bug: :bug:`1183610` |388|:Launchpad bug: :bug:`1183610` |
389<<<<<<< TREE
298|:Upstream state: No Feedback (checked on 2014-03-07) |390|:Upstream state: No Feedback (checked on 2014-03-07) |
391=======
392|:Upstream state: No Feedback (checked on 2014-02-05) |
393>>>>>>> MERGE-SOURCE
299|:Fix Released: :rn:`5.6.11-60.3` |394|:Fix Released: :rn:`5.6.11-60.3` |
300|:Upstream fix: N/A |395|:Upstream fix: N/A |
301+-------------------------------------------------------------------------------------------------------------+396+-------------------------------------------------------------------------------------------------------------+
302|:Upstream bug: :mysqlbug:`68845` - Unnecessary log_sys->mutex reacquisition in mtr_log_reserve_and_write() |397|:Upstream bug: :mysqlbug:`68845` - Unnecessary log_sys->mutex reacquisition in mtr_log_reserve_and_write() |
303|:Launchpad bug: :bug:`1163439` |398|:Launchpad bug: :bug:`1163439` |
399<<<<<<< TREE
304|:Upstream state: Verified (checked on 2014-03-07) |400|:Upstream state: Verified (checked on 2014-03-07) |
401=======
402|:Upstream state: Verified (checked on 2014-02-05) |
403>>>>>>> MERGE-SOURCE
305|:Fix Released: :rn:`5.6.11-60.3` |404|:Fix Released: :rn:`5.6.11-60.3` |
306|:Upstream fix: N/A |405|:Upstream fix: N/A |
307+-------------------------------------------------------------------------------------------------------------+406+-------------------------------------------------------------------------------------------------------------+
@@ -331,7 +430,11 @@
331+-------------------------------------------------------------------------------------------------------------+430+-------------------------------------------------------------------------------------------------------------+
332|:Upstream bug: :mysqlbug:`68476` - Suboptimal code in my_strnxfrm_simple() |431|:Upstream bug: :mysqlbug:`68476` - Suboptimal code in my_strnxfrm_simple() |
333|:Launchpad bug: :bug:`1132350` |432|:Launchpad bug: :bug:`1132350` |
433<<<<<<< TREE
334|:Upstream state: Verified (checked on 2014-03-07) |434|:Upstream state: Verified (checked on 2014-03-07) |
435=======
436|:Upstream state: Verified (checked on 2014-02-05) |
437>>>>>>> MERGE-SOURCE
335|:Fix Released: :rn:`5.6.11-60.3` |438|:Fix Released: :rn:`5.6.11-60.3` |
336|:Upstream fix: N/A |439|:Upstream fix: N/A |
337+-------------------------------------------------------------------------------------------------------------+440+-------------------------------------------------------------------------------------------------------------+
@@ -385,13 +488,21 @@
385+-------------------------------------------------------------------------------------------------------------+488+-------------------------------------------------------------------------------------------------------------+
386|:Upstream bug: :mysqlbug:`61180` - korr/store macros in my_global.h assume the argument to be a char pointer |489|:Upstream bug: :mysqlbug:`61180` - korr/store macros in my_global.h assume the argument to be a char pointer |
387|:Launchpad bug: :bug:`1042517` |490|:Launchpad bug: :bug:`1042517` |
491<<<<<<< TREE
388|:Upstream state: Closed |492|:Upstream state: Closed |
493=======
494|:Upstream state: Verified (checked on 2014-02-05) |
495>>>>>>> MERGE-SOURCE
389|:Fix Released: :rn:`5.6.11-60.3` |496|:Fix Released: :rn:`5.6.11-60.3` |
390|:Upstream fix: N/A |497|:Upstream fix: N/A |
391+-------------------------------------------------------------------------------------------------------------+498+-------------------------------------------------------------------------------------------------------------+
392|:Upstream bug: :mysqlbug:`61178` - Incorrect implementation of intersect(ulonglong) in non-optimized Bitmap..|499|:Upstream bug: :mysqlbug:`61178` - Incorrect implementation of intersect(ulonglong) in non-optimized Bitmap..|
393|:Launchpad bug: :bug:`1042517` |500|:Launchpad bug: :bug:`1042517` |
501<<<<<<< TREE
394|:Upstream state: Verified (checked on 2014-03-07) |502|:Upstream state: Verified (checked on 2014-03-07) |
503=======
504|:Upstream state: Verified (checked on 2014-02-05) |
505>>>>>>> MERGE-SOURCE
395|:Fix Released: :rn:`5.6.11-60.3` |506|:Fix Released: :rn:`5.6.11-60.3` |
396|:Upstream fix: N/A |507|:Upstream fix: N/A |
397+-------------------------------------------------------------------------------------------------------------+508+-------------------------------------------------------------------------------------------------------------+
@@ -403,7 +514,11 @@
403+-------------------------------------------------------------------------------------------------------------+514+-------------------------------------------------------------------------------------------------------------+
404|:Upstream bug: :mysqlbug:`64800` - mysqldump with --include-master-host-port putting quotes around port no. | 515|:Upstream bug: :mysqlbug:`64800` - mysqldump with --include-master-host-port putting quotes around port no. |
405|:Launchpad bug: :bug:`1013432` |516|:Launchpad bug: :bug:`1013432` |
517<<<<<<< TREE
406|:Upstream state: Verified (checked on 2014-03-07) |518|:Upstream state: Verified (checked on 2014-03-07) |
519=======
520|:Upstream state: Verified (checked on 2014-02-05) |
521>>>>>>> MERGE-SOURCE
407|:Fix Released: :rn:`5.6.11-60.3` |522|:Fix Released: :rn:`5.6.11-60.3` |
408|:Upstream fix: N/A |523|:Upstream fix: N/A |
409+-------------------------------------------------------------------------------------------------------------+524+-------------------------------------------------------------------------------------------------------------+
@@ -433,13 +548,21 @@
433+-------------------------------------------------------------------------------------------------------------+548+-------------------------------------------------------------------------------------------------------------+
434|:Upstream bug: :mysqlbug:`25007` - memory tables with dynamic rows format |549|:Upstream bug: :mysqlbug:`25007` - memory tables with dynamic rows format |
435|:Launchpad bug: N/A |550|:Launchpad bug: N/A |
551<<<<<<< TREE
436|:Upstream state: Verified (checked on 2014-03-07) |552|:Upstream state: Verified (checked on 2014-03-07) |
553=======
554|:Upstream state: Verified (checked on 2014-02-05) |
555>>>>>>> MERGE-SOURCE
437|:Fix Released: :rn:`5.6.11-60.3` |556|:Fix Released: :rn:`5.6.11-60.3` |
438|:Upstream fix: N/A |557|:Upstream fix: N/A |
439+-------------------------------------------------------------------------------------------------------------+558+-------------------------------------------------------------------------------------------------------------+
440|:Upstream bug: :mysqlbug:`61595` - mysql-test/include/wait_for_slave_param.inc timeout logic is incorrect |559|:Upstream bug: :mysqlbug:`61595` - mysql-test/include/wait_for_slave_param.inc timeout logic is incorrect |
441|:Launchpad bug: :bug:`800035` |560|:Launchpad bug: :bug:`800035` |
561<<<<<<< TREE
442|:Upstream state: Verified (checked on 2014-03-07) |562|:Upstream state: Verified (checked on 2014-03-07) |
563=======
564|:Upstream state: Verified (checked on 2014-02-05) |
565>>>>>>> MERGE-SOURCE
443|:Fix Released: :rn:`5.6.11-60.3` |566|:Fix Released: :rn:`5.6.11-60.3` |
444|:Upstream fix: N/A |567|:Upstream fix: N/A |
445+-------------------------------------------------------------------------------------------------------------+568+-------------------------------------------------------------------------------------------------------------+
@@ -451,7 +574,11 @@
451+-------------------------------------------------------------------------------------------------------------+574+-------------------------------------------------------------------------------------------------------------+
452|:Upstream bug: :mysqlbug:`68116` - InnoDB monitor may hit an assertion error in buf_page_get_gen in debug ...|575|:Upstream bug: :mysqlbug:`68116` - InnoDB monitor may hit an assertion error in buf_page_get_gen in debug ...|
453|:Launchpad bug: :bug:`1100178` |576|:Launchpad bug: :bug:`1100178` |
577<<<<<<< TREE
454|:Upstream state: Verified (checked on 2014-03-07) |578|:Upstream state: Verified (checked on 2014-03-07) |
579=======
580|:Upstream state: Verified (checked on 2014-02-05) |
581>>>>>>> MERGE-SOURCE
455|:Fix Released: :rn:`5.6.10-60.2` |582|:Fix Released: :rn:`5.6.10-60.2` |
456|:Upstream fix: N/A |583|:Upstream fix: N/A |
457+-------------------------------------------------------------------------------------------------------------+584+-------------------------------------------------------------------------------------------------------------+
@@ -463,13 +590,21 @@
463+-------------------------------------------------------------------------------------------------------------+590+-------------------------------------------------------------------------------------------------------------+
464|:Upstream bug: :mysqlbug:`20001` - Support for temp-tables in INFORMATION_SCHEMA |591|:Upstream bug: :mysqlbug:`20001` - Support for temp-tables in INFORMATION_SCHEMA |
465|:Launchpad bug: N/A |592|:Launchpad bug: N/A |
593<<<<<<< TREE
466|:Upstream state: Verified (checked on 2014-03-07) |594|:Upstream state: Verified (checked on 2014-03-07) |
595=======
596|:Upstream state: Verified (checked on 2014-02-05) |
597>>>>>>> MERGE-SOURCE
467|:Fix Released: :rn:`5.6.5-60.0` |598|:Fix Released: :rn:`5.6.5-60.0` |
468|:Upstream fix: N/A |599|:Upstream fix: N/A |
469+-------------------------------------------------------------------------------------------------------------+600+-------------------------------------------------------------------------------------------------------------+
470|:Upstream bug: :mysqlbug:`69146` - Optimization in buf_pool_get_oldest_modification if srv_buf_pool_instances|601|:Upstream bug: :mysqlbug:`69146` - Optimization in buf_pool_get_oldest_modification if srv_buf_pool_instances|
471|:Launchpad bug: :bug:`1176496` |602|:Launchpad bug: :bug:`1176496` |
603<<<<<<< TREE
472|:Upstream state: Open (checked on 2014-03-07) |604|:Upstream state: Open (checked on 2014-03-07) |
605=======
606|:Upstream state: Open (checked on 2014-02-05) |
607>>>>>>> MERGE-SOURCE
473|:Fix Released: :rn:`5.6.5-60.0` |608|:Fix Released: :rn:`5.6.5-60.0` |
474|:Upstream fix: N/A |609|:Upstream fix: N/A |
475+-------------------------------------------------------------------------------------------------------------+610+-------------------------------------------------------------------------------------------------------------+
476611
=== 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-03-16 07:05:06 +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
=== added file 'mysql-test/r/clone_consistent_snapshot.result'
--- mysql-test/r/clone_consistent_snapshot.result 1970-01-01 00:00:00 +0000
+++ mysql-test/r/clone_consistent_snapshot.result 2014-03-16 07:05:06 +0000
@@ -0,0 +1,145 @@
1# connection con1
2CREATE TABLE t1 (a INT) ENGINE=InnoDB;
3INSERT INTO t1 VALUES(1);
4START TRANSACTION WITH CONSISTENT SNAPSHOT;
5# connection con2
6INSERT INTO t1 VALUES(2);
7# connection con3
8SELECT * FROM t1;
9a
101
112
12# Basic syntax tests
13START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION;
14ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
15START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION CONNECTION_ID();
16ERROR HY000: Unknown thread id: ID
17START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION
18(SELECT MAX(a) FROM t1);
19ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
20START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION (1,1);
21ERROR 21000: Operand should contain 1 column(s)
22START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION "foo";
23ERROR HY000: Unknown thread id: 0
24START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION NULL;
25ERROR HY000: Unknown thread id: 0
26# Functional tests
27START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id;
28SELECT * FROM t1;
29a
301
31# connection con2
32INSERT INTO t1 VALUES(3);
33SELECT * FROM t1;
34a
351
362
373
38# connection con3
39SELECT * FROM t1;
40a
411
42INSERT INTO t1 VALUES(4);
43SELECT * FROM t1;
44a
451
46# connection con1
47INSERT INTO t1 VALUES(5);
48SELECT * FROM t1;
49a
501
515
52# connection con3
53SELECT * FROM t1;
54a
551
565
57# connection con1
58COMMIT;
59# Test cascading snapshot cloning
60# connection con2
61START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con3_id;
62SELECT * FROM t1;
63a
641
655
66COMMIT;
67SELECT * FROM t1;
68a
691
702
713
725
73# connection con3
74SELECT * FROM t1;
75a
761
775
78COMMIT;
79SELECT * FROM t1;
80a
811
822
833
844
855
86# The following should fail to clone a read view as con1 does not have an
87# active transaction
88START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id;
89Warnings:
90Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT FROM SESSION was ignored because the target transaction has not been assigned a read view.
91# connection con1
92INSERT INTO t1 VALUES(6);
93# connection con3
94SELECT * FROM t1;
95a
961
972
983
994
1005
1016
102# connection con3
103COMMIT;
104# Now test cloning read view from a regular transaction
105# connection con1
106START TRANSACTION;
107INSERT INTO t1 VALUES(7);
108# connection con3
109# The following should fail to clone a read view as con1 does not yet have an
110# active transaction
111START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id;
112Warnings:
113Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT FROM SESSION was ignored because the target transaction has not been assigned a read view.
114SELECT * FROM t1;
115a
1161
1172
1183
1194
1205
1216
122# connection con1
123SELECT * FROM t1;
124a
1251
1262
1273
1284
1295
1306
1317
132INSERT INTO t1 VALUES(8);
133# connection con3
134START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id;
135SELECT * FROM t1;
136a
1371
1382
1393
1404
1415
1426
1437
1448
145DROP TABLE t1;
0146
=== 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-03-16 07:05:06 +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-03-16 07:05:06 +0000
@@ -0,0 +1,178 @@
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
75# Test START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION
76DELETE FROM t1;
77START TRANSACTION WITH CONSISTENT SNAPSHOT;
78SHOW STATUS LIKE 'binlog_snapshot_%';
79Variable_name Value
80Binlog_snapshot_file master-bin.000002
81Binlog_snapshot_position 318
82SHOW MASTER STATUS;
83File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
84master-bin.000002 318
85INSERT INTO t1 VALUES (1, "first");
86SELECT * FROM t1;
87a b
881 first
89# Connection con3
90INSERT INTO t1 VALUES (3, "third");
91SELECT * FROM t1;
92a b
933 third
94SHOW STATUS LIKE 'binlog_snapshot_%';
95Variable_name Value
96Binlog_snapshot_file master-bin.000002
97Binlog_snapshot_position 536
98SHOW MASTER STATUS;
99File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
100master-bin.000002 536
101# Connection con2
102SELECT * FROM t1;
103a b
1043 third
105SHOW STATUS LIKE 'binlog_snapshot_%';
106Variable_name Value
107Binlog_snapshot_file master-bin.000002
108Binlog_snapshot_position 536
109SHOW MASTER STATUS;
110File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
111master-bin.000002 536
112START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $donor_id;
113SELECT * FROM t1;
114a b
1151 first
116SHOW STATUS LIKE 'binlog_snapshot_%';
117Variable_name Value
118Binlog_snapshot_file master-bin.000002
119Binlog_snapshot_position 318
120SHOW MASTER STATUS;
121File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
122master-bin.000002 536
123# Connection con3
124FLUSH LOGS;
125SHOW STATUS LIKE 'binlog_snapshot_%';
126Variable_name Value
127Binlog_snapshot_file master-bin.000003
128Binlog_snapshot_position 120
129SHOW MASTER STATUS;
130File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
131master-bin.000003 120
132# Connection con2
133SHOW STATUS LIKE 'binlog_snapshot_%';
134Variable_name Value
135Binlog_snapshot_file master-bin.000002
136Binlog_snapshot_position 318
137SHOW MASTER STATUS;
138File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
139master-bin.000003 120
140COMMIT;
141# Connection default
142SHOW STATUS LIKE 'binlog_snapshot_%';
143Variable_name Value
144Binlog_snapshot_file master-bin.000002
145Binlog_snapshot_position 318
146SHOW MASTER STATUS;
147File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set
148master-bin.000003 120
149COMMIT;
150SHOW BINLOG EVENTS;
151Log_name Pos Event_type Server_id End_log_pos Info
152master-bin.000001 4 Format_desc 1 120 Server ver: #, Binlog ver: #
153master-bin.000001 120 Query 1 266 use `test`; CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb
154master-bin.000001 266 Query 1 389 use `test`; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam
155master-bin.000001 389 Query 1 468 BEGIN
156master-bin.000001 468 Query 1 567 use `test`; INSERT INTO t2 VALUES (2)
157master-bin.000001 567 Query 1 647 COMMIT
158master-bin.000001 647 Query 1 726 BEGIN
159master-bin.000001 726 Query 1 829 use `test`; INSERT INTO t1 VALUES (0, "")
160master-bin.000001 829 Xid 1 860 COMMIT /* XID */
161master-bin.000001 860 Query 1 939 BEGIN
162master-bin.000001 939 Query 1 1038 use `test`; INSERT INTO t2 VALUES (3)
163master-bin.000001 1038 Query 1 1118 COMMIT
164master-bin.000001 1118 Query 1 1197 BEGIN
165master-bin.000001 1197 Query 1 1300 use `test`; INSERT INTO t1 VALUES (4, "")
166master-bin.000001 1300 Xid 1 1331 COMMIT /* XID */
167master-bin.000001 1331 Query 1 1410 BEGIN
168master-bin.000001 1410 Query 1 1513 use `test`; INSERT INTO t1 VALUES (1, "")
169master-bin.000001 1513 Xid 1 1544 COMMIT /* XID */
170master-bin.000001 1544 Query 1 1623 BEGIN
171master-bin.000001 1623 Query 1 1731 use `test`; INSERT INTO t1 VALUES (2, "first")
172master-bin.000001 1731 Query 1 1840 use `test`; INSERT INTO t1 VALUES (2, "second")
173master-bin.000001 1840 Xid 1 1871 COMMIT /* XID */
174master-bin.000001 1871 Query 1 1950 BEGIN
175master-bin.000001 1950 Query 1 2053 use `test`; INSERT INTO t1 VALUES (3, "")
176master-bin.000001 2053 Xid 1 2084 COMMIT /* XID */
177master-bin.000001 2084 Rotate 1 2132 master-bin.000002;pos=4
178DROP TABLE t1,t2;
0179
=== 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-03-16 07:05:06 +0000
@@ -0,0 +1,144 @@
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--echo # Test START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION
86
87DELETE FROM t1;
88
89--let $donor_id=`SELECT CONNECTION_ID()`
90
91START TRANSACTION WITH CONSISTENT SNAPSHOT;
92SHOW STATUS LIKE 'binlog_snapshot_%';
93SHOW MASTER STATUS;
94
95INSERT INTO t1 VALUES (1, "first");
96SELECT * FROM t1;
97
98--connection con3
99--echo # Connection con3
100INSERT INTO t1 VALUES (3, "third");
101SELECT * FROM t1;
102SHOW STATUS LIKE 'binlog_snapshot_%';
103SHOW MASTER STATUS;
104
105--connection con2
106--echo # Connection con2
107SELECT * FROM t1;
108
109SHOW STATUS LIKE 'binlog_snapshot_%';
110SHOW MASTER STATUS;
111
112--disable_query_log
113--eval START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $donor_id
114--echo START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION \$donor_id;
115--enable_query_log
116SELECT * FROM t1;
117
118SHOW STATUS LIKE 'binlog_snapshot_%';
119SHOW MASTER STATUS;
120
121--connection con3
122--echo # Connection con3
123FLUSH LOGS;
124SHOW STATUS LIKE 'binlog_snapshot_%';
125SHOW MASTER STATUS;
126
127--connection con2
128--echo # Connection con2
129SHOW STATUS LIKE 'binlog_snapshot_%';
130SHOW MASTER STATUS;
131
132COMMIT;
133
134--connection default
135--echo # Connection default
136SHOW STATUS LIKE 'binlog_snapshot_%';
137SHOW MASTER STATUS;
138
139COMMIT;
140
141--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
142SHOW BINLOG EVENTS;
143
144DROP TABLE t1,t2;
0145
=== 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-03-16 07:05:06 +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
=== added file 'mysql-test/suite/sys_vars/r/have_snapshot_cloning_basic.result'
--- mysql-test/suite/sys_vars/r/have_snapshot_cloning_basic.result 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/sys_vars/r/have_snapshot_cloning_basic.result 2014-03-16 07:05:06 +0000
@@ -0,0 +1,11 @@
1SELECT @@GLOBAL.have_snapshot_cloning="YES";
2@@GLOBAL.have_snapshot_cloning="YES"
31
4SELECT @@SESSION.have_snapshot_cloning;
5ERROR HY000: Variable 'have_snapshot_cloning' is a GLOBAL variable
6SHOW GLOBAL VARIABLES LIKE 'have_snapshot_cloning';
7Variable_name Value
8have_snapshot_cloning YES
9SHOW SESSION VARIABLES LIKE 'have_snapshot_cloning';
10Variable_name Value
11have_snapshot_cloning YES
012
=== added file 'mysql-test/suite/sys_vars/t/have_snapshot_cloning_basic.test'
--- mysql-test/suite/sys_vars/t/have_snapshot_cloning_basic.test 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/sys_vars/t/have_snapshot_cloning_basic.test 2014-03-16 07:05:06 +0000
@@ -0,0 +1,7 @@
1SELECT @@GLOBAL.have_snapshot_cloning="YES";
2--error ER_INCORRECT_GLOBAL_LOCAL_VAR
3SELECT @@SESSION.have_snapshot_cloning;
4
5SHOW GLOBAL VARIABLES LIKE 'have_snapshot_cloning';
6
7SHOW SESSION VARIABLES LIKE 'have_snapshot_cloning';
08
=== 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-03-16 07:05:06 +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
=== added file 'mysql-test/t/clone_consistent_snapshot.test'
--- mysql-test/t/clone_consistent_snapshot.test 1970-01-01 00:00:00 +0000
+++ mysql-test/t/clone_consistent_snapshot.test 2014-03-16 07:05:06 +0000
@@ -0,0 +1,167 @@
1########################################################################
2# Tests for START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION
3########################################################################
4
5--source include/have_innodb.inc
6--source include/count_sessions.inc
7
8--connect (con1,localhost,root,,)
9--connect (con2,localhost,root,,)
10--connect (con3,localhost,root,,)
11
12--connection con1
13--echo # connection con1
14
15--let $con1_id=`SELECT CONNECTION_ID()`
16CREATE TABLE t1 (a INT) ENGINE=InnoDB;
17INSERT INTO t1 VALUES(1);
18START TRANSACTION WITH CONSISTENT SNAPSHOT;
19
20--connection con2
21--echo # connection con2
22
23INSERT INTO t1 VALUES(2);
24
25--connection con3
26--echo # connection con3
27
28SELECT * FROM t1;
29
30--echo # Basic syntax tests
31
32--error ER_PARSE_ERROR
33START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION;
34--replace_regex /id: [0-9]+/id: ID/
35--error ER_NO_SUCH_THREAD
36START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION CONNECTION_ID();
37--error ER_NOT_SUPPORTED_YET
38START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION
39 (SELECT MAX(a) FROM t1);
40--error ER_OPERAND_COLUMNS
41START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION (1,1);
42--error ER_NO_SUCH_THREAD
43START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION "foo";
44--error ER_NO_SUCH_THREAD
45START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION NULL;
46
47--echo # Functional tests
48--disable_query_log
49--echo START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION \$con1_id;
50--eval START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id
51--enable_query_log
52SELECT * FROM t1;
53
54--connection con2
55--echo # connection con2
56
57INSERT INTO t1 VALUES(3);
58SELECT * FROM t1;
59
60--connection con3
61--echo # connection con3
62
63SELECT * FROM t1;
64INSERT INTO t1 VALUES(4);
65SELECT * FROM t1;
66
67--connection con1
68--echo # connection con1
69
70INSERT INTO t1 VALUES(5);
71SELECT * FROM t1;
72
73--connection con3
74--echo # connection con3
75
76--let $con3_id=`SELECT CONNECTION_ID()`
77
78SELECT * FROM t1;
79
80--connection con1
81--echo # connection con1
82
83COMMIT;
84
85--echo # Test cascading snapshot cloning
86--connection con2
87--echo # connection con2
88--disable_query_log
89--echo START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION \$con3_id;
90--eval START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con3_id
91--enable_query_log
92
93SELECT * FROM t1;
94
95COMMIT;
96
97SELECT * FROM t1;
98
99--connection con3
100--echo # connection con3
101
102SELECT * FROM t1;
103
104COMMIT;
105
106SELECT * FROM t1;
107
108--echo # The following should fail to clone a read view as con1 does not have an
109--echo # active transaction
110--disable_query_log
111--echo START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION \$con1_id;
112--eval START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id
113--enable_query_log
114
115--connection con1
116--echo # connection con1
117
118INSERT INTO t1 VALUES(6);
119
120--connection con3
121--echo # connection con3
122SELECT * FROM t1;
123
124--connection con3
125--echo # connection con3
126
127COMMIT;
128
129--echo # Now test cloning read view from a regular transaction
130
131--connection con1
132--echo # connection con1
133
134START TRANSACTION;
135INSERT INTO t1 VALUES(7);
136
137--connection con3
138--echo # connection con3
139--echo # The following should fail to clone a read view as con1 does not yet have an
140--echo # active transaction
141--disable_query_log
142--echo START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION \$con1_id;
143--eval START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id
144--enable_query_log
145SELECT * FROM t1;
146
147--connection con1
148--echo # connection con1
149SELECT * FROM t1;
150INSERT INTO t1 VALUES(8);
151
152--connection con3
153--echo # connection con3
154--disable_query_log
155--echo START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION \$con1_id;
156--eval START TRANSACTION WITH CONSISTENT SNAPSHOT FROM SESSION $con1_id
157--enable_query_log
158SELECT * FROM t1;
159
160--connection default
161--disconnect con1
162--disconnect con2
163--disconnect con3
164
165DROP TABLE t1;
166
167--source include/wait_until_count_sessions.inc
0168
=== 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-03-16 07:05:06 +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-02-27 12:29:47 +0000
+++ sql/binlog.cc 2014-03-16 07:05:06 +0000
@@ -79,7 +79,21 @@
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);
83static int binlog_clone_consistent_snapshot(handlerton *hton, THD *thd,
84 THD *from_thd);
85
86static char binlog_snapshot_file[FN_REFLEN];
87static ulonglong binlog_snapshot_position;
88
89static SHOW_VAR binlog_status_vars_detail[]=
90{
91 {"snapshot_file",
92 (char *)&binlog_snapshot_file, SHOW_CHAR},
93 {"snapshot_position",
94 (char *)&binlog_snapshot_position, SHOW_LONGLONG},
95 {NullS, NullS, SHOW_LONG}
96};
8397
84/**98/**
85 Helper class to hold a mutex for the duration of the99 Helper class to hold a mutex for the duration of the
@@ -768,6 +782,8 @@
768 binlog_stmt_cache_data stmt_cache;782 binlog_stmt_cache_data stmt_cache;
769 binlog_trx_cache_data trx_cache;783 binlog_trx_cache_data trx_cache;
770784
785 LOG_INFO binlog_info;
786
771private:787private:
772788
773 binlog_cache_mngr& operator=(const binlog_cache_mngr& info);789 binlog_cache_mngr& operator=(const binlog_cache_mngr& info);
@@ -894,6 +910,8 @@
894 binlog_hton->commit= binlog_commit;910 binlog_hton->commit= binlog_commit;
895 binlog_hton->rollback= binlog_rollback;911 binlog_hton->rollback= binlog_rollback;
896 binlog_hton->prepare= binlog_prepare;912 binlog_hton->prepare= binlog_prepare;
913 binlog_hton->start_consistent_snapshot= binlog_start_consistent_snapshot;
914 binlog_hton->clone_consistent_snapshot= binlog_clone_consistent_snapshot;
897 binlog_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;915 binlog_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;
898 return 0;916 return 0;
899}917}
@@ -1305,6 +1323,76 @@
1305 return 0;1323 return 0;
1306}1324}
13071325
1326static int binlog_start_consistent_snapshot(handlerton *hton, THD *thd)
1327{
1328 int err= 0;
1329 LOG_INFO li;
1330 DBUG_ENTER("binlog_start_consistent_snapshot");
1331
1332 if ((err= thd->binlog_setup_trx_data()))
1333 DBUG_RETURN(err);
1334
1335 binlog_cache_mngr * const cache_mngr= thd_get_cache_mngr(thd);
1336
1337 /* Server layer calls us with LOCK_log locked, so this is safe. */
1338 mysql_bin_log.raw_get_current_log(&cache_mngr->binlog_info);
1339
1340 trans_register_ha(thd, TRUE, hton);
1341
1342 DBUG_RETURN(err);
1343}
1344
1345static int binlog_clone_consistent_snapshot(handlerton *hton, THD *thd,
1346 THD *from_thd)
1347{
1348 binlog_cache_mngr *from_cache_mngr;
1349 binlog_cache_mngr *cache_mngr;
1350 int err= 0;
1351 char log_file_name[FN_REFLEN];
1352 my_off_t pos;
1353
1354 DBUG_ENTER("binlog_start_consistent_snapshot");
1355
1356 from_cache_mngr= opt_bin_log ?
1357 (binlog_cache_mngr *) thd_get_cache_mngr(from_thd) : NULL;
1358
1359 if (from_cache_mngr == NULL)
1360 {
1361 push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
1362 HA_ERR_UNSUPPORTED,
1363 "WITH CONSISTENT SNAPSHOT FROM SESSION was ignored for "
1364 "binary log, because the specified session does not "
1365 "have a consistent snapshot of binary log "
1366 "coordinates.");
1367 DBUG_RETURN(0);
1368 }
1369
1370 if ((err= thd->binlog_setup_trx_data()))
1371 DBUG_RETURN(err);
1372
1373 cache_mngr= thd_get_cache_mngr(thd);
1374
1375 mysql_mutex_lock(&from_cache_mngr->binlog_info.lock);
1376
1377 pos= from_cache_mngr->binlog_info.pos;
1378 strmake(log_file_name, from_cache_mngr->binlog_info.log_file_name,
1379 sizeof(log_file_name) - 1);
1380
1381 mysql_mutex_unlock(&from_cache_mngr->binlog_info.lock);
1382
1383 mysql_mutex_lock(&cache_mngr->binlog_info.lock);
1384
1385 cache_mngr->binlog_info.pos = pos;
1386 strmake(cache_mngr->binlog_info.log_file_name, log_file_name,
1387 sizeof(cache_mngr->binlog_info.log_file_name) - 1);
1388
1389 mysql_mutex_unlock(&cache_mngr->binlog_info.lock);
1390
1391 trans_register_ha(thd, TRUE, hton);
1392
1393 DBUG_RETURN(err);
1394}
1395
1308/**1396/**
1309 This function is called once after each statement.1397 This function is called once after each statement.
13101398
@@ -1547,8 +1635,22 @@
1547 rollback.1635 rollback.
1548 */1636 */
1549 if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT)1637 if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT)
1638 {
1639 /*
1640 Reset binlog_snapshot_% variables for the current connection so that the
1641 current coordinates are shown after committing a consistent snapshot
1642 transaction.
1643 */
1644 if (cache_mngr != NULL)
1645 {
1646 mysql_mutex_lock(&cache_mngr->binlog_info.lock);
1647 cache_mngr->binlog_info.log_file_name[0]= '\0';
1648 mysql_mutex_unlock(&cache_mngr->binlog_info.lock);
1649 }
1650
1550 if ((error= ha_rollback_low(thd, all)))1651 if ((error= ha_rollback_low(thd, all)))
1551 goto end;1652 goto end;
1653 }
15521654
1553 /*1655 /*
1554 If there is no cache manager, or if there is nothing in the1656 If there is no cache manager, or if there is nothing in the
@@ -2416,7 +2518,7 @@
2416 is_relay_log(0), signal_cnt(0),2518 is_relay_log(0), signal_cnt(0),
2417 checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF),2519 checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF),
2418 relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF),2520 relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF),
2419 previous_gtid_set(0)2521 previous_gtid_set(0), snapshot_lock_acquired(false)
2420{2522{
2421 /*2523 /*
2422 We don't want to initialize locks here as such initialization depends on2524 We don't want to initialize locks here as such initialization depends on
@@ -6293,6 +6395,18 @@
6293 DBUG_RETURN(RESULT_SUCCESS);6395 DBUG_RETURN(RESULT_SUCCESS);
6294 }6396 }
62956397
6398 /*
6399 Reset binlog_snapshot_% variables for the current connection so that the
6400 current coordinates are shown after committing a consistent snapshot
6401 transaction.
6402 */
6403 if (all)
6404 {
6405 mysql_mutex_lock(&cache_mngr->binlog_info.lock);
6406 cache_mngr->binlog_info.log_file_name[0]= '\0';
6407 mysql_mutex_unlock(&cache_mngr->binlog_info.lock);
6408 }
6409
6296 THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt;6410 THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt;
62976411
6298 DBUG_PRINT("debug", ("in_transaction: %s, no_2pc: %s, rw_ha_count: %d",6412 DBUG_PRINT("debug", ("in_transaction: %s, no_2pc: %s, rw_ha_count: %d",
@@ -6790,9 +6904,22 @@
6790 /*6904 /*
6791 storage engine commit6905 storage engine commit
6792 */6906 */
6793 if (thd->commit_error == THD::CE_NONE &&6907 if (thd->commit_error == THD::CE_NONE)
6794 ha_commit_low(thd, all, false))6908 {
6795 thd->commit_error= THD::CE_COMMIT_ERROR;6909 /*
6910 Acquire a shared lock to block commits until START TRANSACTION WITH
6911 CONSISTENT SNAPSHOT completes snapshot creation for all storage
6912 engines. We only reach this code if binlog_order_commits=0.
6913 */
6914 DBUG_ASSERT(opt_binlog_order_commits == 0);
6915
6916 slock();
6917
6918 if (ha_commit_low(thd, all, false))
6919 thd->commit_error= THD::CE_COMMIT_ERROR;
6920
6921 sunlock();
6922 }
6796 /*6923 /*
6797 Decrement the prepared XID counter after storage engine commit6924 Decrement the prepared XID counter after storage engine commit
6798 */6925 */
@@ -7171,6 +7298,99 @@
7171 return 1;7298 return 1;
7172}7299}
71737300
7301/*
7302 Copy out the non-directory part of binlog position filename for the
7303 `binlog_snapshot_file' status variable, same way as it is done for
7304 SHOW MASTER STATUS.
7305*/
7306static void set_binlog_snapshot_file(const char *src)
7307{
7308 int dir_len = dirname_length(src);
7309 strmake(binlog_snapshot_file, src + dir_len,
7310 sizeof(binlog_snapshot_file) - 1);
7311}
7312
7313/*
7314 Copy out current values of status variables, for SHOW STATUS or
7315 information_schema.global_status.
7316
7317 This is called only under LOCK_status, so we can fill in a static array.
7318*/
7319void MYSQL_BIN_LOG::set_status_variables(THD *thd)
7320{
7321 binlog_cache_mngr *cache_mngr;
7322
7323 if (thd && opt_bin_log)
7324 cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
7325 else
7326 cache_mngr= 0;
7327
7328 bool have_snapshot= (cache_mngr &&
7329 cache_mngr->binlog_info.log_file_name[0] != '\0');
7330 mysql_mutex_lock(&LOCK_log);
7331 if (!have_snapshot)
7332 {
7333 set_binlog_snapshot_file(log_file_name);
7334 binlog_snapshot_position= my_b_tell(&log_file);
7335 }
7336 mysql_mutex_unlock(&LOCK_log);
7337
7338 if (have_snapshot)
7339 {
7340 set_binlog_snapshot_file(cache_mngr->binlog_info.log_file_name);
7341 binlog_snapshot_position= cache_mngr->binlog_info.pos;
7342 }
7343}
7344
7345
7346void MYSQL_BIN_LOG::xlock(void)
7347{
7348 DBUG_ASSERT(!snapshot_lock_acquired);
7349
7350 mysql_mutex_lock(&LOCK_log);
7351
7352 /*
7353 We must ensure that no writes to binlog and no commits to storage engines
7354 occur after function is called for START TRANSACTION FOR CONSISTENT
7355 SNAPSHOT. With binlog_order_commits=1 (the default) flushing to binlog is
7356 performed under the LOCK_log mutex and commits are done under the
7357 LOCK_commit mutex, both in the stage leader thread. So acquiring those 2
7358 mutexes is sufficient to guarantee atomicity.
7359
7360 With binlog_order_commits=0 commits are performed in parallel by separate
7361 threads with each acquiring a shared lock on LOCK_consistent_snapshot.
7362
7363 binlog_order_commits is a dynamic variable, so we have to keep track what
7364 primitives should be used in unlock_for_snapshot().
7365 */
7366 if (opt_binlog_order_commits)
7367 {
7368 mysql_mutex_lock(&LOCK_commit);
7369 }
7370 else
7371 {
7372 snapshot_lock_acquired= true;
7373 mysql_rwlock_wrlock(&LOCK_consistent_snapshot);
7374 }
7375}
7376
7377
7378void MYSQL_BIN_LOG::xunlock(void)
7379{
7380 if (!snapshot_lock_acquired)
7381 {
7382 mysql_mutex_unlock(&LOCK_commit);
7383 }
7384 else
7385 {
7386 mysql_rwlock_unlock(&LOCK_consistent_snapshot);
7387 snapshot_lock_acquired= false;
7388 }
7389
7390 mysql_mutex_unlock(&LOCK_log);
7391}
7392
7393
7174Group_cache *THD::get_group_cache(bool is_transactional)7394Group_cache *THD::get_group_cache(bool is_transactional)
7175{7395{
7176 DBUG_ENTER("THD::get_group_cache(bool)");7396 DBUG_ENTER("THD::get_group_cache(bool)");
@@ -9022,6 +9242,25 @@
90229242
9023#endif /* !defined(MYSQL_CLIENT) */9243#endif /* !defined(MYSQL_CLIENT) */
90249244
9245static int show_binlog_vars(THD *thd, SHOW_VAR *var, char *buff)
9246{
9247 if (mysql_bin_log.is_open())
9248 mysql_bin_log.set_status_variables(thd);
9249 else
9250 {
9251 binlog_snapshot_file[0]= '\0';
9252 binlog_snapshot_position= 0;
9253 }
9254 var->type= SHOW_ARRAY;
9255 var->value= (char *)&binlog_status_vars_detail;
9256 return 0;
9257}
9258
9259static SHOW_VAR binlog_status_vars_top[]= {
9260 {"Binlog", (char *) &show_binlog_vars, SHOW_FUNC},
9261 {NullS, NullS, SHOW_LONG}
9262};
9263
9025struct st_mysql_storage_engine binlog_storage_engine=9264struct st_mysql_storage_engine binlog_storage_engine=
9026{ MYSQL_HANDLERTON_INTERFACE_VERSION };9265{ MYSQL_HANDLERTON_INTERFACE_VERSION };
90279266
@@ -9038,7 +9277,7 @@
9038 binlog_init, /* Plugin Init */9277 binlog_init, /* Plugin Init */
9039 NULL, /* Plugin Deinit */9278 NULL, /* Plugin Deinit */
9040 0x0100 /* 1.0 */,9279 0x0100 /* 1.0 */,
9041 NULL, /* status variables */9280 binlog_status_vars_top, /* status variables */
9042 NULL, /* system variables */9281 NULL, /* system variables */
9043 NULL, /* config options */9282 NULL, /* config options */
9044 0, 9283 0,
90459284
=== modified file 'sql/binlog.h'
--- sql/binlog.h 2014-02-17 11:12:40 +0000
+++ sql/binlog.h 2014-03-16 07:05:06 +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 {
@@ -667,6 +677,7 @@
667 inline char* get_log_fname() { return log_file_name; }677 inline char* get_log_fname() { return log_file_name; }
668 inline char* get_name() { return name; }678 inline char* get_name() { return name; }
669 inline mysql_mutex_t* get_log_lock() { return &LOCK_log; }679 inline mysql_mutex_t* get_log_lock() { return &LOCK_log; }
680 inline mysql_mutex_t* get_commit_lock() { return &LOCK_commit; }
670 inline mysql_cond_t* get_log_cond() { return &update_cond; }681 inline mysql_cond_t* get_log_cond() { return &update_cond; }
671 inline IO_CACHE* get_log_file() { return &log_file; }682 inline IO_CACHE* get_log_file() { return &log_file; }
672683
@@ -674,6 +685,7 @@
674 inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);}685 inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);}
675 inline IO_CACHE *get_index_file() { return &index_file;}686 inline IO_CACHE *get_index_file() { return &index_file;}
676 inline uint32 get_open_count() { return open_count; }687 inline uint32 get_open_count() { return open_count; }
688 void set_status_variables(THD *thd);
677};689};
678690
679typedef struct st_load_file_info691typedef struct st_load_file_info
680692
=== modified file 'sql/handler.cc'
--- sql/handler.cc 2014-03-03 17:51:33 +0000
+++ sql/handler.cc 2014-03-16 07:05:06 +0000
@@ -40,6 +40,7 @@
40#include "debug_sync.h" // DEBUG_SYNC40#include "debug_sync.h" // DEBUG_SYNC
41#include <my_bit.h>41#include <my_bit.h>
42#include <list>42#include <list>
43#include "global_threads.h"
4344
44#ifdef WITH_PARTITION_STORAGE_ENGINE45#ifdef WITH_PARTITION_STORAGE_ENGINE
45#include "ha_partition.h"46#include "ha_partition.h"
@@ -2252,8 +2253,95 @@
2252}2253}
22532254
22542255
2255static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,2256static my_bool clone_snapshot_handlerton(THD *thd, plugin_ref plugin,
2256 void *arg)2257 void *arg)
2258{
2259 handlerton *hton= plugin_data(plugin, handlerton *);
2260
2261 if (hton->state == SHOW_OPTION_YES &&
2262 hton->clone_consistent_snapshot)
2263 hton->clone_consistent_snapshot(hton, thd, (THD *) arg);
2264
2265 return FALSE;
2266}
2267
2268
2269static int ha_clone_consistent_snapshot(THD *thd)
2270{
2271 THD *from_thd;
2272 ulong id;
2273 Item *val;
2274 Thread_iterator it;
2275 Thread_iterator end;
2276
2277 DBUG_ASSERT(!thd->lex->value_list.is_empty());
2278
2279 val= (Item *) thd->lex->value_list.head();
2280
2281 if (thd->lex->table_or_sp_used())
2282 {
2283 my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
2284 "function calls as part of this statement");
2285 goto error;
2286 }
2287
2288 if ((!val->fixed && val->fix_fields(thd, &val)) || val->check_cols(1))
2289 {
2290 my_error(ER_SET_CONSTANTS_ONLY, MYF(0));
2291 goto error;
2292 }
2293
2294 id= val->val_int();
2295
2296 mysql_mutex_lock(&LOCK_thread_count);
2297
2298 it= global_thread_list_begin();
2299 end= global_thread_list_end();
2300 from_thd= NULL;
2301
2302 for (; it != end; ++it)
2303 {
2304 if ((*it)->thread_id == id && *it != thd)
2305 {
2306 from_thd= *it;
2307 mysql_mutex_lock(&from_thd->LOCK_thd_data);
2308 break;
2309 }
2310 }
2311
2312 mysql_mutex_unlock(&LOCK_thread_count);
2313
2314 if (!from_thd)
2315 {
2316 my_error(ER_NO_SUCH_THREAD, MYF(0), id);
2317 goto error;
2318 }
2319
2320 /*
2321 Blocking commits and binlog updates ensures that we get the same snapshot
2322 for all engines (including the binary log). This allows us among other
2323 things to do backups with START TRANSACTION WITH CONSISTENT SNAPSHOT and
2324 have a consistent binlog position.
2325 */
2326 tc_log->xlock();
2327
2328 plugin_foreach(thd, clone_snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN,
2329 from_thd);
2330
2331 tc_log->xunlock();
2332
2333 mysql_mutex_unlock(&from_thd->LOCK_thd_data);
2334
2335 return 0;
2336
2337error:
2338
2339 return 1;
2340}
2341
2342
2343static my_bool start_snapshot_handlerton(THD *thd, plugin_ref plugin,
2344 void *arg)
2257{2345{
2258 handlerton *hton= plugin_data(plugin, handlerton *);2346 handlerton *hton= plugin_data(plugin, handlerton *);
2259 if (hton->state == SHOW_OPTION_YES &&2347 if (hton->state == SHOW_OPTION_YES &&
@@ -2267,9 +2355,24 @@
22672355
2268int ha_start_consistent_snapshot(THD *thd)2356int ha_start_consistent_snapshot(THD *thd)
2269{2357{
2358
2359 if (!thd->lex->value_list.is_empty())
2360 return ha_clone_consistent_snapshot(thd);
2361
2270 bool warn= true;2362 bool warn= true;
22712363
2272 plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);2364 /*
2365 Blocking commits and binlog updates ensures that we get the same snapshot
2366 for all engines (including the binary log). This allows us among other
2367 things to do backups with START TRANSACTION WITH CONSISTENT SNAPSHOT and
2368 have a consistent binlog position.
2369 */
2370 tc_log->xlock();
2371
2372 plugin_foreach(thd, start_snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN,
2373 &warn);
2374
2375 tc_log->xunlock();
22732376
2274 /*2377 /*
2275 Same idea as when one wants to CREATE TABLE in one engine which does not2378 Same idea as when one wants to CREATE TABLE in one engine which does not
22762379
=== modified file 'sql/handler.h'
--- sql/handler.h 2014-02-27 12:29:47 +0000
+++ sql/handler.h 2014-03-16 07:05:06 +0000
@@ -892,6 +892,7 @@
892 void (*drop_database)(handlerton *hton, char* path);892 void (*drop_database)(handlerton *hton, char* path);
893 int (*panic)(handlerton *hton, enum ha_panic_function flag);893 int (*panic)(handlerton *hton, enum ha_panic_function flag);
894 int (*start_consistent_snapshot)(handlerton *hton, THD *thd);894 int (*start_consistent_snapshot)(handlerton *hton, THD *thd);
895 int (*clone_consistent_snapshot)(handlerton *hton, THD *thd, THD *from_thd);
895 bool (*flush_logs)(handlerton *hton);896 bool (*flush_logs)(handlerton *hton);
896 bool (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);897 bool (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);
897 uint (*partition_flags)();898 uint (*partition_flags)();
898899
=== modified file 'sql/log.cc'
--- sql/log.cc 2014-03-03 17:51:33 +0000
+++ sql/log.cc 2014-03-16 07:05:06 +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
@@ -2901,12 +2902,21 @@
2901 DBUG_ENTER("TC_LOG_MMAP::commit");2902 DBUG_ENTER("TC_LOG_MMAP::commit");
2902 unsigned long cookie= 0;2903 unsigned long cookie= 0;
2903 my_xid xid= thd->transaction.xid_state.xid.get_my_xid();2904 my_xid xid= thd->transaction.xid_state.xid.get_my_xid();
2905 int rc;
29042906
2905 if (all && xid)2907 if (all && xid)
2906 if (!(cookie= log_xid(thd, xid)))2908 if (!(cookie= log_xid(thd, xid)))
2907 DBUG_RETURN(RESULT_ABORTED); // Failed to log the transaction2909 DBUG_RETURN(RESULT_ABORTED); // Failed to log the transaction
29082910
2909 if (ha_commit_low(thd, all))2911 /*
2912 Acquire a shared lock to block commits until START TRANSACTION WITH
2913 CONSISTENT SNAPSHOT completes snapshot creation for all storage engines.
2914 */
2915 slock();
2916 rc= ha_commit_low(thd, all);
2917 sunlock();
2918
2919 if (rc)
2910 DBUG_RETURN(RESULT_INCONSISTENT); // Transaction logged, but not committed2920 DBUG_RETURN(RESULT_INCONSISTENT); // Transaction logged, but not committed
29112921
2912 /* If cookie is non-zero, something was logged */2922 /* If cookie is non-zero, something was logged */
29132923
=== modified file 'sql/log.h'
--- sql/log.h 2014-02-17 11:12:40 +0000
+++ sql/log.h 2014-03-16 07:05:06 +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/log_event.cc'
=== modified file 'sql/log_event.h'
=== modified file 'sql/mdl.cc'
=== modified file 'sql/mysqld.cc'
--- sql/mysqld.cc 2014-02-27 12:29:47 +0000
+++ sql/mysqld.cc 2014-03-16 07:05:06 +0000
@@ -717,7 +717,12 @@
717SHOW_COMP_OPTION have_geometry, have_rtree_keys;717SHOW_COMP_OPTION have_geometry, have_rtree_keys;
718SHOW_COMP_OPTION have_crypt, have_compress;718SHOW_COMP_OPTION have_crypt, have_compress;
719SHOW_COMP_OPTION have_profiling;719SHOW_COMP_OPTION have_profiling;
720SHOW_COMP_OPTION have_backup_locks;720<<<<<<< TREE
721SHOW_COMP_OPTION have_backup_locks;
722=======
723SHOW_COMP_OPTION have_backup_locks;
724SHOW_COMP_OPTION have_snapshot_cloning;
725>>>>>>> MERGE-SOURCE
721726
722ulonglong opt_log_warnings_suppress= 0;727ulonglong opt_log_warnings_suppress= 0;
723728
@@ -780,6 +785,8 @@
780mysql_mutex_t LOCK_server_started;785mysql_mutex_t LOCK_server_started;
781mysql_cond_t COND_server_started;786mysql_cond_t COND_server_started;
782787
788mysql_rwlock_t LOCK_consistent_snapshot;
789
783int mysqld_server_started= 0;790int mysqld_server_started= 0;
784791
785File_parser_dummy_hook file_parser_dummy_hook;792File_parser_dummy_hook file_parser_dummy_hook;
@@ -2061,6 +2068,7 @@
2061 mysql_mutex_destroy(&LOCK_global_user_client_stats);2068 mysql_mutex_destroy(&LOCK_global_user_client_stats);
2062 mysql_mutex_destroy(&LOCK_global_table_stats);2069 mysql_mutex_destroy(&LOCK_global_table_stats);
2063 mysql_mutex_destroy(&LOCK_global_index_stats);2070 mysql_mutex_destroy(&LOCK_global_index_stats);
2071 mysql_rwlock_destroy(&LOCK_consistent_snapshot);
2064}2072}
2065#endif /*EMBEDDED_LIBRARY*/2073#endif /*EMBEDDED_LIBRARY*/
20662074
@@ -4321,6 +4329,8 @@
4321 mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect);4329 mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect);
4322 mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave);4330 mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave);
4323 mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant);4331 mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant);
4332 mysql_rwlock_init(key_rwlock_LOCK_consistent_snapshot,
4333 &LOCK_consistent_snapshot);
4324 mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL);4334 mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL);
4325 mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);4335 mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);
4326 mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);4336 mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);
@@ -8540,8 +8550,14 @@
8540 shared_memory_base_name= default_shared_memory_base_name;8550 shared_memory_base_name= default_shared_memory_base_name;
8541#endif8551#endif
85428552
8543 have_backup_locks= SHOW_OPTION_YES;8553<<<<<<< TREE
85448554 have_backup_locks= SHOW_OPTION_YES;
8555
8556=======
8557 have_backup_locks= SHOW_OPTION_YES;
8558 have_snapshot_cloning= SHOW_OPTION_YES;
8559
8560>>>>>>> MERGE-SOURCE
8545#if defined(__WIN__)8561#if defined(__WIN__)
8546 /* Allow Win32 users to move MySQL anywhere */8562 /* Allow Win32 users to move MySQL anywhere */
8547 {8563 {
@@ -9720,13 +9736,13 @@
9720 { &key_LOCK_thread_count, "LOCK_thread_count", PSI_FLAG_GLOBAL},9736 { &key_LOCK_thread_count, "LOCK_thread_count", PSI_FLAG_GLOBAL},
9721 { &key_LOCK_log_throttle_qni, "LOCK_log_throttle_qni", PSI_FLAG_GLOBAL},9737 { &key_LOCK_log_throttle_qni, "LOCK_log_throttle_qni", PSI_FLAG_GLOBAL},
9722 { &key_gtid_ensure_index_mutex, "Gtid_state", PSI_FLAG_GLOBAL},9738 { &key_gtid_ensure_index_mutex, "Gtid_state", PSI_FLAG_GLOBAL},
9723 { &key_LOCK_thread_created, "LOCK_thread_created", PSI_FLAG_GLOBAL }9739 { &key_LOCK_thread_created, "LOCK_thread_created", PSI_FLAG_GLOBAL },
9724};9740};
97259741
9726PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,9742PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
9727 key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,9743 key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
9728 key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,9744 key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,
9729 key_rwlock_global_sid_lock;9745 key_rwlock_global_sid_lock, key_rwlock_LOCK_consistent_snapshot;
97309746
9731PSI_rwlock_key key_rwlock_Trans_delegate_lock;9747PSI_rwlock_key key_rwlock_Trans_delegate_lock;
9732PSI_rwlock_key key_rwlock_Binlog_storage_delegate_lock;9748PSI_rwlock_key key_rwlock_Binlog_storage_delegate_lock;
@@ -9752,7 +9768,8 @@
9752 { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0},9768 { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0},
9753 { &key_rwlock_global_sid_lock, "gtid_commit_rollback", PSI_FLAG_GLOBAL},9769 { &key_rwlock_global_sid_lock, "gtid_commit_rollback", PSI_FLAG_GLOBAL},
9754 { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL},9770 { &key_rwlock_Trans_delegate_lock, "Trans_delegate::lock", PSI_FLAG_GLOBAL},
9755 { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL}9771 { &key_rwlock_Binlog_storage_delegate_lock, "Binlog_storage_delegate::lock", PSI_FLAG_GLOBAL},
9772 { &key_rwlock_LOCK_consistent_snapshot, "LOCK_consistent_snapshot", PSI_FLAG_GLOBAL}
9756};9773};
97579774
9758#ifdef HAVE_MMAP9775#ifdef HAVE_MMAP
97599776
=== modified file 'sql/mysqld.h'
--- sql/mysqld.h 2014-03-03 17:51:33 +0000
+++ sql/mysqld.h 2014-03-16 07:05:06 +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/rpl_rli.cc'
=== modified file 'sql/set_var.h'
--- sql/set_var.h 2014-03-03 17:51:33 +0000
+++ sql/set_var.h 2014-03-16 07:05:06 +0000
@@ -344,7 +344,12 @@
344extern SHOW_COMP_OPTION have_crypt;344extern SHOW_COMP_OPTION have_crypt;
345extern SHOW_COMP_OPTION have_compress;345extern SHOW_COMP_OPTION have_compress;
346extern SHOW_COMP_OPTION have_statement_timeout;346extern SHOW_COMP_OPTION have_statement_timeout;
347extern SHOW_COMP_OPTION have_backup_locks;347<<<<<<< TREE
348extern SHOW_COMP_OPTION have_backup_locks;
349=======
350extern SHOW_COMP_OPTION have_backup_locks;
351extern SHOW_COMP_OPTION have_snapshot_cloning;
352>>>>>>> MERGE-SOURCE
348353
349/*354/*
350 Prototypes for helper functions355 Prototypes for helper functions
351356
=== modified file 'sql/share/errmsg-utf8.txt'
--- sql/share/errmsg-utf8.txt 2014-02-27 12:29:47 +0000
+++ sql/share/errmsg-utf8.txt 2014-03-16 07:05:06 +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
@@ -7104,6 +7105,12 @@
7104 eng "Can’t execute the query because you have a conflicting backup lock"7105 eng "Can’t execute the query because you have a conflicting backup lock"
7105 rus "Запрос не может быть выполнен из-за конфликтующей блокировки резервного копирования"7106 rus "Запрос не может быть выполнен из-за конфликтующей блокировки резервного копирования"
71067107
7108=======
7109ER_CANT_EXECUTE_WITH_BACKUP_LOCK
7110 eng "Can’t execute the query because you have a conflicting backup lock"
7111 rus "Запрос не может быть выполнен из-за конфликтующей блокировки резервного копирования"
7112
7113>>>>>>> MERGE-SOURCE
7107#7114#
7108# End of 5.6 error messages.7115# End of 5.6 error messages.
7109#7116#
71107117
=== modified file 'sql/sql_yacc.yy'
--- sql/sql_yacc.yy 2014-02-25 07:30:22 +0000
+++ sql/sql_yacc.yy 2014-03-16 07:05:06 +0000
@@ -8149,6 +8149,12 @@
8149 {8149 {
8150 $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT;8150 $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT;
8151 }8151 }
8152 | WITH CONSISTENT_SYM SNAPSHOT_SYM FROM SESSION_SYM expr
8153 {
8154 $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT;
8155 Lex->value_list.empty();
8156 Lex->value_list.push_front($6);
8157 }
8152 | READ_SYM ONLY_SYM8158 | READ_SYM ONLY_SYM
8153 {8159 {
8154 $$= MYSQL_START_TRANS_OPT_READ_ONLY;8160 $$= MYSQL_START_TRANS_OPT_READ_ONLY;
81558161
=== modified file 'sql/sys_vars.cc'
--- sql/sys_vars.cc 2014-03-03 17:51:33 +0000
+++ sql/sys_vars.cc 2014-03-16 07:05:06 +0000
@@ -4017,10 +4017,21 @@
4017 READ_ONLY GLOBAL_VAR(have_profiling), NO_CMD_LINE, NO_MUTEX_GUARD,4017 READ_ONLY GLOBAL_VAR(have_profiling), NO_CMD_LINE, NO_MUTEX_GUARD,
4018 NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), DEPRECATED(""));4018 NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), DEPRECATED(""));
40194019
4020static Sys_var_have Sys_have_backup_locks(4020<<<<<<< TREE
4021 "have_backup_locks", "have_backup_locks",4021static Sys_var_have Sys_have_backup_locks(
4022 READ_ONLY GLOBAL_VAR(have_backup_locks), NO_CMD_LINE);4022 "have_backup_locks", "have_backup_locks",
40234023 READ_ONLY GLOBAL_VAR(have_backup_locks), NO_CMD_LINE);
4024
4025=======
4026static Sys_var_have Sys_have_backup_locks(
4027 "have_backup_locks", "have_backup_locks",
4028 READ_ONLY GLOBAL_VAR(have_backup_locks), NO_CMD_LINE);
4029
4030static Sys_var_have Sys_have_snapshot_cloning(
4031 "have_snapshot_cloning", "have_snapshot_cloning",
4032 READ_ONLY GLOBAL_VAR(have_snapshot_cloning), NO_CMD_LINE);
4033
4034>>>>>>> MERGE-SOURCE
4024static Sys_var_have Sys_have_query_cache(4035static Sys_var_have Sys_have_query_cache(
4025 "have_query_cache", "have_query_cache",4036 "have_query_cache", "have_query_cache",
4026 READ_ONLY GLOBAL_VAR(have_query_cache), NO_CMD_LINE);4037 READ_ONLY GLOBAL_VAR(have_query_cache), NO_CMD_LINE);
40274038
=== modified file 'storage/federated/ha_federated.cc'
=== modified file 'storage/innobase/buf/buf0flu.cc'
--- storage/innobase/buf/buf0flu.cc 2014-02-17 11:12:40 +0000
+++ storage/innobase/buf/buf0flu.cc 2014-03-16 07:05:06 +0000
@@ -1371,10 +1371,17 @@
13711371
1372 /* These fields are protected by the buf_page_get_mutex()1372 /* These fields are protected by the buf_page_get_mutex()
1373 mutex. */1373 mutex. */
1374<<<<<<< TREE
1374 /* Read the fields directly in order to avoid asserting on1375 /* Read the fields directly in order to avoid asserting on
1375 BUF_BLOCK_REMOVE_HASH pages. */1376 BUF_BLOCK_REMOVE_HASH pages. */
1376 ulint space = bpage->space;1377 ulint space = bpage->space;
1377 ulint offset = bpage->offset;1378 ulint offset = bpage->offset;
1379=======
1380 /* Read the fields directly in order to avoid asserting on
1381 BUF_BLOCK_REMOVE_HASH pages. */
1382 space = bpage->space;
1383 offset = bpage->offset;
1384>>>>>>> MERGE-SOURCE
13781385
1379 if (flush_type == BUF_FLUSH_LRU) {1386 if (flush_type == BUF_FLUSH_LRU) {
1380 mutex_exit(block_mutex);1387 mutex_exit(block_mutex);
13811388
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- storage/innobase/handler/ha_innodb.cc 2014-03-03 17:51:33 +0000
+++ storage/innobase/handler/ha_innodb.cc 2014-03-16 07:05:06 +0000
@@ -1148,6 +1148,22 @@
1148 THD* thd); /* in: MySQL thread handle of the1148 THD* thd); /* in: MySQL thread handle of the
1149 user for whom the transaction should1149 user for whom the transaction should
1150 be committed */1150 be committed */
1151/*****************************************************************//**
1152Creates an InnoDB transaction struct for the thd if it does not yet have one.
1153Starts a new InnoDB transaction if a transaction is not yet started. And
1154clones snapshot for a consistent read from another session, if it has one.
1155@return 0 */
1156static
1157int
1158innobase_start_trx_and_clone_read_view(
1159/*====================================*/
1160 handlerton* hton, /* in: Innodb handlerton */
1161 THD* thd, /* in: MySQL thread handle of the
1162 user for whom the transaction should
1163 be committed */
1164 THD* from_thd); /* in: MySQL thread handle of the
1165 user session from which the consistent
1166 read should be cloned */
1151/****************************************************************//**1167/****************************************************************//**
1152Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes1168Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
1153the logs, and the name of this function should be innobase_checkpoint.1169the logs, and the name of this function should be innobase_checkpoint.
@@ -3166,6 +3182,8 @@
31663182
3167 innobase_hton->start_consistent_snapshot =3183 innobase_hton->start_consistent_snapshot =
3168 innobase_start_trx_and_assign_read_view;3184 innobase_start_trx_and_assign_read_view;
3185 innobase_hton->clone_consistent_snapshot =
3186 innobase_start_trx_and_clone_read_view;
31693187
3170 innobase_hton->flush_logs = innobase_flush_logs;3188 innobase_hton->flush_logs = innobase_flush_logs;
3171 innobase_hton->show_status = innobase_show_status;3189 innobase_hton->show_status = innobase_show_status;
@@ -3928,6 +3946,102 @@
39283946
39293947
3930/*****************************************************************//**3948/*****************************************************************//**
3949Creates an InnoDB transaction struct for the thd if it does not yet have one.
3950Starts a new InnoDB transaction if a transaction is not yet started. And
3951clones snapshot for a consistent read from another session, if it has one.
3952@return 0 */
3953static
3954int
3955innobase_start_trx_and_clone_read_view(
3956/*====================================*/
3957 handlerton* hton, /* in: Innodb handlerton */
3958 THD* thd, /* in: MySQL thread handle of the
3959 user for whom the transaction should
3960 be committed */
3961 THD* from_thd) /* in: MySQL thread handle of the
3962 user session from which the consistent
3963 read should be cloned */
3964{
3965 trx_t* trx;
3966 trx_t* from_trx;
3967
3968 DBUG_ENTER("innobase_start_trx_and_clone_read_view");
3969 DBUG_ASSERT(hton == innodb_hton_ptr);
3970
3971 /* Get transaction handle from the donor session */
3972
3973 from_trx = thd_to_trx(from_thd);
3974
3975 if (!from_trx) {
3976 push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
3977 HA_ERR_UNSUPPORTED,
3978 "InnoDB: WITH CONSISTENT SNAPSHOT "
3979 "FROM SESSION was ignored because the "
3980 "specified session does not have an open "
3981 "transaction inside InnoDB.");
3982
3983 DBUG_RETURN(0);
3984 }
3985
3986 /* Create a new trx struct for thd, if it does not yet have one */
3987
3988 trx = check_trx_exists(thd);
3989
3990 /* This is just to play safe: release a possible FIFO ticket and
3991 search latch. Since we can potentially reserve the trx_sys->mutex,
3992 we have to release the search system latch first to obey the latching
3993 order. */
3994
3995 trx_search_latch_release_if_reserved(trx);
3996
3997 innobase_srv_conc_force_exit_innodb(trx);
3998
3999 /* If the transaction is not started yet, start it */
4000
4001 trx_start_if_not_started_xa(trx);
4002
4003 /* Clone the read view from the donor transaction. Do this only if
4004 transaction is using REPEATABLE READ isolation level. */
4005 trx->isolation_level = innobase_map_isolation_level(
4006 thd_get_trx_isolation(thd));
4007
4008 if (trx->isolation_level != TRX_ISO_REPEATABLE_READ) {
4009
4010 push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
4011 HA_ERR_UNSUPPORTED,
4012 "InnoDB: WITH CONSISTENT SNAPSHOT "
4013 "was ignored because this phrase "
4014 "can only be used with "
4015 "REPEATABLE READ isolation level.");
4016 } else {
4017
4018 lock_mutex_enter();
4019 mutex_enter(&trx_sys->mutex);
4020 trx_mutex_enter(from_trx);
4021
4022 if (!trx_clone_read_view(trx, from_trx)) {
4023
4024 push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
4025 HA_ERR_UNSUPPORTED,
4026 "InnoDB: WITH CONSISTENT SNAPSHOT "
4027 "FROM SESSION was ignored because "
4028 "the target transaction has not been "
4029 "assigned a read view.");
4030 }
4031
4032 trx_mutex_exit(from_trx);
4033 mutex_exit(&trx_sys->mutex);
4034 lock_mutex_exit();
4035 }
4036
4037 /* Set the MySQL flag to mark that there is an active transaction */
4038
4039 innobase_register_trx(hton, current_thd, trx);
4040
4041 DBUG_RETURN(0);
4042}
4043
4044/*****************************************************************//**
3931Commits a transaction in an InnoDB database or marks an SQL statement4045Commits a transaction in an InnoDB database or marks an SQL statement
3932ended.4046ended.
3933@return 0 */4047@return 0 */
39344048
=== modified file 'storage/innobase/include/read0read.h'
--- storage/innobase/include/read0read.h 2013-10-23 08:48:28 +0000
+++ storage/innobase/include/read0read.h 2014-03-16 07:05:06 +0000
@@ -50,6 +50,27 @@
50 NULL if a new one needs to be created */50 NULL if a new one needs to be created */
5151
52/*********************************************************************//**52/*********************************************************************//**
53Clones a read view object. This function will allocate space for two read
54views contiguously, one identical in size and content as @param view (starting
55at returned pointer) and another view immediately following the trx_ids array.
56The second view will have space for an extra trx_id_t element.
57@return read view struct */
58UNIV_INTERN
59read_view_t*
60read_view_clone(
61/*============*/
62 const read_view_t* view, /*!< in: view to clone */
63 read_view_t*& prebuilt_clone);/*!< in,out: prebuilt view or
64 NULL */
65/*********************************************************************//**
66Insert the view in the proper order into the trx_sys->view_list. The
67read view list is ordered by read_view_t::low_limit_no in descending order. */
68UNIV_INTERN
69void
70read_view_add(
71/*==========*/
72 read_view_t* view); /*!< in: view to add to */
73/*********************************************************************//**
53Makes a copy of the oldest existing read view, or opens a new. The view74Makes a copy of the oldest existing read view, or opens a new. The view
54must be closed with ..._close.75must be closed with ..._close.
55@return own: read view struct */76@return own: read view struct */
5677
=== modified file 'storage/innobase/include/trx0trx.h'
--- storage/innobase/include/trx0trx.h 2014-02-17 11:12:40 +0000
+++ storage/innobase/include/trx0trx.h 2014-03-16 07:05:06 +0000
@@ -275,6 +275,16 @@
275trx_assign_read_view(275trx_assign_read_view(
276/*=================*/276/*=================*/
277 trx_t* trx); /*!< in: active transaction */277 trx_t* trx); /*!< in: active transaction */
278/********************************************************************//**
279Clones the read view from another transaction. All the consistent reads within
280the receiver transaction will get the same read view as the donor transaction
281@return read view clone */
282UNIV_INTERN
283read_view_t*
284trx_clone_read_view(
285/*================*/
286 trx_t* trx, /*!< in: receiver transaction */
287 trx_t* from_trx); /*!< in: donor transaction */
278/****************************************************************//**288/****************************************************************//**
279Prepares a transaction for commit/rollback. */289Prepares a transaction for commit/rollback. */
280UNIV_INTERN290UNIV_INTERN
281291
=== modified file 'storage/innobase/read/read0read.cc'
--- storage/innobase/read/read0read.cc 2013-10-23 08:48:28 +0000
+++ storage/innobase/read/read0read.cc 2014-03-16 07:05:06 +0000
@@ -221,7 +221,7 @@
221at returned pointer) and another view immediately following the trx_ids array.221at returned pointer) and another view immediately following the trx_ids array.
222The second view will have space for an extra trx_id_t element.222The second view will have space for an extra trx_id_t element.
223@return read view struct */223@return read view struct */
224UNIV_INLINE224UNIV_INTERN
225read_view_t*225read_view_t*
226read_view_clone(226read_view_clone(
227/*============*/227/*============*/
@@ -256,7 +256,7 @@
256/*********************************************************************//**256/*********************************************************************//**
257Insert the view in the proper order into the trx_sys->view_list. The257Insert the view in the proper order into the trx_sys->view_list. The
258read view list is ordered by read_view_t::low_limit_no in descending order. */258read view list is ordered by read_view_t::low_limit_no in descending order. */
259static259UNIV_INTERN
260void260void
261read_view_add(261read_view_add(
262/*==========*/262/*==========*/
263263
=== modified file 'storage/innobase/trx/trx0trx.cc'
--- storage/innobase/trx/trx0trx.cc 2014-02-17 11:12:40 +0000
+++ storage/innobase/trx/trx0trx.cc 2014-03-16 07:05:06 +0000
@@ -1692,6 +1692,38 @@
1692 return(trx->read_view);1692 return(trx->read_view);
1693}1693}
16941694
1695/********************************************************************//**
1696Clones the read view from another transaction. All consistent reads within
1697the receiver transaction will get the same read view as the donor transaction
1698@return read view clone */
1699UNIV_INTERN
1700read_view_t*
1701trx_clone_read_view(
1702/*================*/
1703 trx_t* trx, /*!< in: receiver transaction */
1704 trx_t* from_trx) /*!< in: donor transaction */
1705{
1706 ut_ad(lock_mutex_own());
1707 ut_ad(mutex_own(&trx_sys->mutex));
1708 ut_ad(trx_mutex_own(from_trx));
1709 ut_ad(trx->read_view == NULL);
1710
1711 if (from_trx->state != TRX_STATE_ACTIVE ||
1712 from_trx->read_view == NULL) {
1713
1714 return(NULL);
1715 }
1716
1717 trx->read_view = read_view_clone(from_trx->read_view,
1718 trx->prebuilt_view);
1719
1720 read_view_add(trx->read_view);
1721
1722 trx->global_read_view = trx->read_view;
1723
1724 return(trx->read_view);
1725}
1726
1695/****************************************************************//**1727/****************************************************************//**
1696Prepares a transaction for commit/rollback. */1728Prepares a transaction for commit/rollback. */
1697UNIV_INTERN1729UNIV_INTERN
16981730
=== modified file 'storage/perfschema/ha_perfschema.cc'

Subscribers

People subscribed via source and target branches