summaryrefslogtreecommitdiff
path: root/mysql-test/r/mysqldump-max.result
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-11-07 22:37:43 +0100
committerunknown <knielsen@knielsen-hq.org>2010-11-07 22:37:43 +0100
commit7322e38827ce50f86e3facbb63d9c77e744da6df (patch)
tree8e9100d053c0c73b30cb1fdd4c1b65650cb595cf /mysql-test/r/mysqldump-max.result
parenta2d921be3634ceff4ab4c67f57b27a481d4a28df (diff)
downloadmariadb-git-7322e38827ce50f86e3facbb63d9c77e744da6df.tar.gz
MWL#136: Cross-engine consistency for START TRANSACTION WITH CONSISTENT SNAPSHOT
Make the binlog handlerton participate in START TRANSACTION WITH CONSISTENT SNAPSHOT, recording the binlog position corresponding to the snapshot taken in other MVCC storage engines. Expose this consistent binlog position as the new status variables binlog_trx_file and binlog_trx_position. This enables to get a fully non-locking snapshot of the database (including binlog position for slave provisioning), avoiding the need for FLUSH TABLES WITH READ LOCK. Modify mysqldump to detect if the server supports this new feature, and if so, avoid FLUSH TABLES WITH READ LOCK for --single-transaction --master-data snapshot backups.
Diffstat (limited to 'mysql-test/r/mysqldump-max.result')
-rw-r--r--mysql-test/r/mysqldump-max.result56
1 files changed, 56 insertions, 0 deletions
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index c300f3d7996..57c9180691a 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -290,3 +290,59 @@ COUNT(*)
DROP VIEW v1;
DROP TABLE t1;
SET GLOBAL storage_engine=@old_engine;
+# Connection default
+RESET MASTER;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,0), (2,0);
+SELECT GET_LOCK("block_queries_1", 120);
+GET_LOCK("block_queries_1", 120)
+1
+# Connection c3
+SELECT GET_LOCK("block_queries_2", 120);
+GET_LOCK("block_queries_2", 120)
+1
+# Connection c1
+SET @c= 0;
+SELECT IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120)) FROM t1 ORDER BY a;
+# Connection c2
+SET binlog_format="row";
+SET @d= 10;
+UPDATE t2 SET b=IF(@d<=10, @d:=@d+1, GET_LOCK("block_queries_2", 120)) ORDER BY a;
+# Connection default
+# Make sure other queries are running (and waiting).
+SELECT RELEASE_LOCK("block_queries_1");
+RELEASE_LOCK("block_queries_1")
+1
+# Connection c3
+SELECT RELEASE_LOCK("block_queries_2");
+RELEASE_LOCK("block_queries_2")
+1
+# Connection c1
+IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120))
+1
+1
+# Connection c2
+# Connection default
+SELECT * FROM t2 ORDER BY a;
+a b
+1 11
+2 1
+DROP TABLE t1;
+DROP TABLE t2;
+SHOW BINLOG EVENTS LIMIT 6,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 524 Query 1 592 BEGIN
+master-bin.000001 592 Query 1 689 use `test`; INSERT INTO t2 VALUES (1,0), (2,0)
+master-bin.000001 689 Xid 1 716 COMMIT /* XID */
+-- CHANGE MASTER TO MASTER_LOG_FILE='./master-bin.000001', MASTER_LOG_POS=716;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+SELECT * FROM t2 ORDER BY a;
+a b
+1 0
+2 0
+DROP TABLE t1,t2;