summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/locks-update-deadlock-1.test
blob: a9c90862b71c4016639e769266dd76b156a79b90 (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
source include/have_tokudb.inc;
# test that update only take write locks
# t1 scans all of the rows in a table and updates 1 of them
# t1 grabs a write range lock on -infinity +infinity
# t2 scans all of the rows in a table except the one updated by t1
# t2 should hang until t1 commits

SET DEFAULT_STORAGE_ENGINE='tokudb';

--disable_warnings
drop table if exists t;
--enable_warnings

connect(conn1,localhost,root);

connection default;
create table t (a int primary key, b int);
insert into t values (1,0),(2,1),(3,0);
begin;
update t set b=b+1 where b>0;

connection conn1;
set transaction isolation level serializable;
send select * from t where a!=2;

connection default;
commit;

connection conn1;
reap;

connection default;
disconnect conn1;

drop table t;