summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/t/delete_before_lock.test
blob: 93a9d1adaf9401620224be5147e40d48040e9875 (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
--source include/have_rocksdb.inc
--source include/have_debug_sync.inc

# This is a test case to reproduce https://github.com/facebook/mysql-5.6/issues/162
# Expected output of the last select for update was (1,2,100) and (1,3,100), but
# currently it returns (1,2,1) and (1,3,1), which must be fixed.

connect (con, localhost, root,,);
connection default;

--disable_warnings
set debug_sync='RESET';
drop table if exists t1;
--enable_warnings

create table t1 (id1 int, id2 int, value int, primary key (id1, id2)) engine=rocksdb;
insert into t1 values (1, 1, 1),(1, 2, 1),(1, 3, 1), (2, 2, 2);

connection con;
set debug_sync='rocksdb.get_row_by_rowid SIGNAL parked WAIT_FOR go';
send update t1 set value=100 where id1=1;

connection default;
set debug_sync='now WAIT_FOR parked';
delete from t1 where id1=1 and id2=1;
set debug_sync='now SIGNAL go';

connection con;
reap;
select * from t1 where id1=1 for update;

# Cleanup
connection default;
disconnect con;
set debug_sync='RESET';
drop table t1;