~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/flush_block_commit_notembedded.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
 
2
# transactions.
 
3
# We verify that we did not introduce a deadlock.
 
4
# This is intended to mimick how mysqldump and innobackup work.
 
5
 
 
6
--source include/have_log_bin.inc
 
7
 
 
8
# And it requires InnoDB
 
9
--source include/have_log_bin.inc
 
10
--source include/have_innodb.inc
 
11
 
 
12
# Save the initial number of concurrent sessions
 
13
--source include/count_sessions.inc
 
14
 
 
15
 
 
16
--echo # Establish connection con1 (user=root)
 
17
connect (con1,localhost,root,,);
 
18
--echo # Establish connection con2 (user=root)
 
19
connect (con2,localhost,root,,);
 
20
 
 
21
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
 
22
--echo # Switch to connection con1
 
23
connection con1;
 
24
CREATE TABLE t1 (a INT) ENGINE=innodb;
 
25
RESET MASTER;
 
26
SET AUTOCOMMIT=0;
 
27
INSERT t1 VALUES (1);
 
28
--echo # Switch to connection con2
 
29
connection con2;
 
30
FLUSH TABLES WITH READ LOCK;
 
31
SHOW MASTER STATUS;
 
32
--echo # Switch to connection con1
 
33
connection con1;
 
34
send COMMIT;
 
35
--echo # Switch to connection con2
 
36
connection con2;
 
37
sleep 1;
 
38
SHOW MASTER STATUS;
 
39
UNLOCK TABLES;
 
40
--echo # Switch to connection con1
 
41
connection con1;
 
42
reap;
 
43
DROP TABLE t1;
 
44
SET AUTOCOMMIT=1;
 
45
 
 
46
--echo # Switch to connection default and close connections con1 and con2
 
47
connection default;
 
48
disconnect con1;
 
49
disconnect con2;
 
50
 
 
51
# Wait till all disconnects are completed
 
52
--source include/wait_until_count_sessions.inc
 
53