1SET DEFAULT_STORAGE_ENGINE = 'tokudb';
2# Establish connection conn1 (user = root)
3connect  conn1,localhost,root,,;
4connect  conn2,localhost,root,,;
5connect  conn3,localhost,root,,;
6connect  conn4,localhost,root,,;
7connect  conn5,localhost,root,,;
8DROP TABLE IF EXISTS foo;
9connection default;
10create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
11show create table foo;
12Table	Create Table
13foo	CREATE TABLE `foo` (
14  `a` int(11) NOT NULL,
15  `b` varchar(100) DEFAULT NULL,
16  PRIMARY KEY (`a`)
17) ENGINE=TokuDB DEFAULT CHARSET=latin1
18connection conn1;
19set session transaction isolation level repeatable read;
20begin;
21select * from foo;
22a	b
23connection default;
24replace into foo values (1, "a");
25connection conn2;
26set session transaction isolation level repeatable read;
27begin;
28select * from foo;
29a	b
301	a
31connection default;
32replace into foo values (1,"ab"), (2, "ab");
33connection conn3;
34set session transaction isolation level repeatable read;
35begin;
36select * from foo;
37a	b
381	ab
392	ab
40connection default;
41replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
42connection conn4;
43set session transaction isolation level repeatable read;
44begin;
45select * from foo;
46a	b
471	abc
482	abc
493	abc
50connection default;
51replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
52connection conn5;
53set session transaction isolation level repeatable read;
54begin;
55select * from foo;
56a	b
571	abcd
582	abcd
593	abcd
604	abcd
61connection conn1;
62select * from foo;
63a	b
64commit;
65connection conn2;
66select * from foo;
67a	b
681	a
69commit;
70connection conn3;
71select * from foo;
72a	b
731	ab
742	ab
75commit;
76connection conn4;
77select * from foo;
78a	b
791	abc
802	abc
813	abc
82commit;
83connection conn5;
84select * from foo;
85a	b
861	abcd
872	abcd
883	abcd
894	abcd
90commit;
91connection default;
92disconnect conn1;
93disconnect conn2;
94disconnect conn3;
95disconnect conn4;
96disconnect conn5;
97connection default;
98set session transaction isolation level serializable;
99DROP TABLE foo;
100