summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/fast_upsert_deadlock.test
blob: 66b212f3c24ce0021f48f17a2549dc731659a0d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
source include/have_tokudb.inc;

disable_warnings;
drop table if exists t;
enable_warnings;

set default_storage_engine='tokudb';

create table t (id bigint primary key, b bigint not null default 0);

connect (conn1,localhost,root,,);

connection default;
begin;
insert noar into t (id) values (1) on duplicate key update b=b+1;

connection conn1;
begin;
insert noar into t (id) values (2) on duplicate key update b=b-1;

connection default;
send insert noar into t (id) values (2) on duplicate key update b=b+1;

connection conn1;
sleep 1;
error 1205,1213;
insert noar into t (id) values (1) on duplicate key update b=b-1;
rollback;

connection default;
reap;
commit;

connection default;
disconnect conn1;

select * from t;

drop table t;